Fix warnings trivial warnings.

Fix warnings about:
 . Unused variables
 . format mismatch in printf/scanf format string and arguments
 . Missing parenthesis around assignment as truth values
 . Clang warnings anout unknown GCC pragma
This commit is contained in:
Lionel Sambuc 2012-12-11 18:42:21 +01:00
parent 77399bd649
commit 0ac803292e
65 changed files with 297 additions and 284 deletions

View file

@ -70,7 +70,7 @@ static int lookup_op();
exprcmd(argc, argv) char **argv; { int exprcmd(argc, argv) int argc; char **argv; {
char **ap; char **ap;
char *opname; char *opname;
char c; char c;
@ -178,7 +178,7 @@ overflow: error("Expression too complex");
if (valsp->type == INTEGER) { if (valsp->type == INTEGER) {
p = stalloc(32); p = stalloc(32);
#ifdef SHELL #ifdef SHELL
fmtstr(p, 32, "%d", valsp->u.num); fmtstr(p, 32, "%ld", valsp->u.num);
#else #else
sprintf(p, "%d", valsp->u.num); sprintf(p, "%d", valsp->u.num);
#endif #endif

View file

@ -103,7 +103,9 @@ STATIC pid_t initialpgrp; /* pgrp of shell on invocation */
int in_waitcmd = 0; /* are we in waitcmd()? */ int in_waitcmd = 0; /* are we in waitcmd()? */
int in_dowait = 0; /* are we in dowait()? */ int in_dowait = 0; /* are we in dowait()? */
volatile sig_atomic_t breakwaitcmd = 0; /* should wait be terminated? */ volatile sig_atomic_t breakwaitcmd = 0; /* should wait be terminated? */
#if JOBS
static int ttyfd = -1; static int ttyfd = -1;
#endif
#ifndef WCOREDUMP #ifndef WCOREDUMP
#define WCOREDUMP(s) ((s) & 0x80) #define WCOREDUMP(s) ((s) & 0x80)
@ -328,7 +330,9 @@ showjob(struct job *jp, pid_t pid, int sformat, int lformat)
{ {
char s[64]; char s[64];
struct procstat *ps; struct procstat *ps;
#if JOBS
struct job *j; struct job *j;
#endif
int col, curr, i, jobno, prev, procno; int col, curr, i, jobno, prev, procno;
char c; char c;

View file

@ -90,11 +90,13 @@ readcmd(int argc __unused, char **argv __unused)
int i; int i;
struct timeval tv; struct timeval tv;
char *tvptr; char *tvptr;
#ifndef __minix
#ifndef __minix_vmd #ifndef __minix_vmd
fd_set ifds; fd_set ifds;
#endif #endif
struct termios told, tnew; struct termios told, tnew;
int tsaved; int tsaved;
#endif
rflag = 0; rflag = 0;
prompt = NULL; prompt = NULL;

View file

@ -31,7 +31,9 @@
*/ */
#ifndef lint #ifndef lint
#if 0
static char sccsid[] = "@(#)output.c 8.1 (Berkeley) 5/31/93"; static char sccsid[] = "@(#)output.c 8.1 (Berkeley) 5/31/93";
#endif
#endif /* not lint */ #endif /* not lint */
/* /*

View file

@ -394,8 +394,8 @@ char *dir1, *cbuf2;
} }
/* Both files are now open. Do the copying. */ /* Both files are now open. Do the copying. */
if (!rflag && strncmp((sp->namep + n - 2), ".Z", (size_t)2) || if ((!rflag && strncmp((sp->namep + n - 2), ".Z", (size_t)2)) ||
rflag && !strncmp((sp->namep + n - 2), ".Z", (size_t)2)) { (rflag && !strncmp((sp->namep + n - 2), ".Z", (size_t)2))) {
if (zflag && (rflag || (n <= (NAME_SIZE - 2)))) { if (zflag && (rflag || (n <= (NAME_SIZE - 2)))) {
close(fd1); close(fd1);
close(fd2); close(fd2);

View file

@ -100,12 +100,12 @@ int fd1, fd2;
if (c1 != c2) { if (c1 != c2) {
if (!loud) { if (!loud) {
if (!silent) { if (!silent) {
printf("%s %s differ: char %ld, line %ld\n", printf("%s %s differ: char %d, line %d\n",
name1, name2, pos + i1, line); name1, name2, pos + i1, line);
} }
return(1); return(1);
} }
printf("%10ld %3o %3o\n", pos + i1, c1 & 0xFF, c2 & 0xFF); printf("%10d %3o %3o\n", pos + i1, c1 & 0xFF, c2 & 0xFF);
differ = 1; differ = 1;
} }
if (c1 == '\n') line++; if (c1 == '\n') line++;

View file

@ -1405,11 +1405,12 @@ char *ifname, *ofname;
if (unlink(ifname)) if (unlink(ifname))
perror(ifname); perror(ifname);
*/ */
if(!quiet) if(!quiet) {
if(do_decomp == 0) if(do_decomp == 0)
fprintf(stderr, " -- compressed to %s", ofname); fprintf(stderr, " -- compressed to %s", ofname);
else else
fprintf(stderr, " -- decompressed to %s", ofname); fprintf(stderr, " -- decompressed to %s", ofname);
}
return; /* Successful return */ return; /* Successful return */
} }

View file

@ -84,18 +84,18 @@ int override= 0;
int main(int argc, char *argv []); int main(int argc, char *argv []);
void getgeom(void); void getgeom(void);
int getboot(char *buffer); void getboot(char *buffer);
int putboot(char *buffer); void putboot(char *buffer);
void load_from_file(void); void load_from_file(void);
void save_to_file(void); void save_to_file(void);
int dpl_partitions(int rawflag); void dpl_partitions(int rawflag);
int chk_table(void); int chk_table(void);
int sec_to_hst(long logsec, unsigned char *hd, unsigned char *sec, void sec_to_hst(long logsec, unsigned char *hd, unsigned char *sec,
unsigned char *cyl); unsigned char *cyl);
int mark_partition(struct part_entry *pe); void mark_partition(struct part_entry *pe);
void change_partition(struct part_entry *entry); void change_partition(struct part_entry *entry);
int get_a_char(void); char get_a_char(void);
int print_menu(void); void print_menu(void);
void adj_base(struct part_entry *pe); void adj_base(struct part_entry *pe);
void adj_size(struct part_entry *pe); void adj_size(struct part_entry *pe);
struct part_entry *ask_partition(void); struct part_entry *ask_partition(void);
@ -140,9 +140,7 @@ char bootstrap[] = {
0000,0000, 0000,0000,
}; };
main(argc, argv) int main(int argc, char *argv[])
int argc;
char *argv[];
{ {
int argn; int argn;
char *argp; char *argp;
@ -227,7 +225,7 @@ char *argv[];
#ifdef UNIX #ifdef UNIX
void getgeom() void getgeom(void)
{ {
struct partition geom; struct partition geom;
int fd, r; int fd, r;
@ -249,8 +247,7 @@ void getgeom()
static int devfd; static int devfd;
getboot(buffer) void getboot(char *buffer)
char *buffer;
{ {
devfd = open(devname, 2); devfd = open(devname, 2);
if (devfd < 0) { if (devfd < 0) {
@ -275,8 +272,7 @@ char *buffer;
} }
} }
putboot(buffer) void putboot(char *buffer)
char *buffer;
{ {
if (lseek(devfd, 0L, 0) < 0) { if (lseek(devfd, 0L, 0) < 0) {
printf("Seek error during write\n"); printf("Seek error during write\n");
@ -292,7 +288,7 @@ char *buffer;
#endif #endif
void load_from_file() void load_from_file(void)
{ {
/* Load buffer from file */ /* Load buffer from file */
@ -315,7 +311,7 @@ void load_from_file()
} }
void save_to_file() void save_to_file(void)
{ {
/* Save to file */ /* Save to file */
@ -343,8 +339,7 @@ void save_to_file()
} }
dpl_partitions(rawflag) void dpl_partitions(int rawflag)
int rawflag;
{ {
/* Display partition table */ /* Display partition table */
@ -418,9 +413,9 @@ int rawflag;
devnum = 1; devnum = 1;
for (i1 = 1, pe1 = (struct part_entry *) &secbuf[PART_TABLE_OFF]; for (i1 = 1, pe1 = (struct part_entry *) &secbuf[PART_TABLE_OFF];
i1 <= NR_PARTITIONS; ++i1, ++pe1) i1 <= NR_PARTITIONS; ++i1, ++pe1)
if (pe1->lowsec == 0 && pe->lowsec == 0 && pe1 < pe || if ((pe1->lowsec == 0 && pe->lowsec == 0 && pe1 < pe) ||
pe1->lowsec != 0 && (pe1->lowsec != 0 &&
(pe->lowsec == 0 || pe->lowsec > pe1->lowsec)) (pe->lowsec == 0 || pe->lowsec > pe1->lowsec)))
++devnum; /* pe1 contents < pe contents */ ++devnum; /* pe1 contents < pe contents */
if (devnum != i) { if (devnum != i) {
orderfootnote = '#'; orderfootnote = '#';
@ -448,7 +443,7 @@ int rawflag;
} }
int chk_table() int chk_table(void)
{ {
/* Check partition table */ /* Check partition table */
@ -492,10 +487,10 @@ int chk_table()
if (pe->size == 0) continue; if (pe->size == 0) continue;
seenpart = 1; seenpart = 1;
for (i1 = i + 1, pe1 = pe + 1; i1 <= NR_PARTITIONS; ++i1, ++pe1) { for (i1 = i + 1, pe1 = pe + 1; i1 <= NR_PARTITIONS; ++i1, ++pe1) {
if (pe->lowsec >= pe1->lowsec && if ((pe->lowsec >= pe1->lowsec &&
pe->lowsec < pe1->lowsec + pe1->size || pe->lowsec < pe1->lowsec + pe1->size) ||
pe->lowsec + pe->size - 1 >= pe1->lowsec && (pe->lowsec + pe->size - 1 >= pe1->lowsec &&
pe->lowsec + pe->size - 1 < pe1->lowsec + pe1->size) pe->lowsec + pe->size - 1 < pe1->lowsec + pe1->size))
{ {
printf("Overlap between partitions %d and %d\n", printf("Overlap between partitions %d and %d\n",
i, i1); i, i1);
@ -536,9 +531,8 @@ int chk_table()
return(status); return(status);
} }
sec_to_hst(logsec, hd, sec, cyl) void sec_to_hst(long logsec, unsigned char *hd, unsigned char *sec,
long logsec; unsigned char *cyl)
unsigned char *hd, *sec, *cyl;
{ {
/* Convert a logical sector number to head / sector / cylinder */ /* Convert a logical sector number to head / sector / cylinder */
@ -550,8 +544,7 @@ unsigned char *hd, *sec, *cyl;
*hd = (logsec % (nhead * nsec)) / nsec; *hd = (logsec % (nhead * nsec)) / nsec;
} }
mark_partition(pe) void mark_partition(struct part_entry *pe)
struct part_entry *pe;
{ {
/* Mark a partition as being of type MINIX. */ /* Mark a partition as being of type MINIX. */
@ -561,8 +554,7 @@ struct part_entry *pe;
} }
} }
void change_partition(entry) void change_partition(struct part_entry *entry)
struct part_entry *entry;
{ {
/* Get partition info : first & last cylinder */ /* Get partition info : first & last cylinder */
@ -656,18 +648,17 @@ struct part_entry *entry;
} }
} }
get_a_char() char get_a_char(void)
{ {
/* Read 1 character and discard rest of line */ /* Read 1 character and discard rest of line */
char buf[80]; char buf[80];
int ch;
if (!mygets(buf, (int) sizeof buf)) return(0); if (!mygets(buf, (int) sizeof buf)) return(0);
return(*buf); return(*buf);
} }
print_menu() void print_menu(void)
{ {
printf("Type a command letter, then a carriage return:\n"); printf("Type a command letter, then a carriage return:\n");
printf(" + - explain any footnotes (+, -, #)\n"); printf(" + - explain any footnotes (+, -, #)\n");
@ -698,8 +689,7 @@ union REGS regs;
struct SREGS sregs; struct SREGS sregs;
int drivenum; int drivenum;
getboot(buffer) void getboot(char *buffer)
char *buffer;
{ {
/* Read boot sector */ /* Read boot sector */
@ -731,8 +721,7 @@ char *buffer;
} }
putboot(buffer) void putboot(char *buffer)
char *buffer;
{ {
/* Write boot sector */ /* Write boot sector */
@ -753,8 +742,7 @@ char *buffer;
#endif #endif
void adj_base(pe) void adj_base(struct part_entry *pe)
struct part_entry *pe;
{ {
/* Adjust base sector of partition, usually to make it even. */ /* Adjust base sector of partition, usually to make it even. */
@ -767,10 +755,10 @@ struct part_entry *pe;
return; return;
if (pe->lowsec + adj < 1) if (pe->lowsec + adj < 1)
printf( printf(
"\t\tThat would make the base %d and too small\n", pe->lowsec + adj); "\t\tThat would make the base %lu and too small\n", pe->lowsec + adj);
else if (pe->size - adj < 1) else if (pe->size - adj < 1)
printf( printf(
"\t\tThat would make the size %d and too small\n", pe->size - adj); "\t\tThat would make the size %lu and too small\n", pe->size - adj);
else else
break; break;
} }
@ -781,8 +769,7 @@ struct part_entry *pe;
pe->lowsec, pe->size); pe->lowsec, pe->size);
} }
void adj_size(pe) void adj_size(struct part_entry *pe)
struct part_entry *pe;
{ {
/* Adjust size of partition by reducing high sector. */ /* Adjust size of partition by reducing high sector. */
@ -793,7 +780,7 @@ struct part_entry *pe;
if (!get_an_int("\tEnter adjustment to size (an integer): ", &adj)) if (!get_an_int("\tEnter adjustment to size (an integer): ", &adj))
return; return;
if (pe->size + adj >= 1) break; if (pe->size + adj >= 1) break;
printf("\t\tThat would make the size %d and too small \n", printf("\t\tThat would make the size %lu and too small \n",
pe->size + adj); pe->size + adj);
} }
pe->size += adj; pe->size += adj;
@ -819,7 +806,7 @@ struct part_entry *ask_partition()
return((struct part_entry *) &secbuf[PART_TABLE_OFF] + (num - 1)); return((struct part_entry *) &secbuf[PART_TABLE_OFF] + (num - 1));
} }
void footnotes() void footnotes(void)
{ {
/* Explain the footnotes. */ /* Explain the footnotes. */
@ -861,9 +848,7 @@ void footnotes()
} }
} }
int get_an_int(prompt, intptr) int get_an_int(char *prompt, int *intptr)
char *prompt;
int *intptr;
{ {
/* Read an int from the start of line of stdin, discard rest of line. */ /* Read an int from the start of line of stdin, discard rest of line. */
@ -877,7 +862,7 @@ int *intptr;
} }
} }
void list_part_types() void list_part_types(void)
{ {
/* Print all known partition types. */ /* Print all known partition types. */
@ -898,8 +883,7 @@ void list_part_types()
if (column != 0) putchar('\n'); if (column != 0) putchar('\n');
} }
void mark_npartition(pe) void mark_npartition(struct part_entry *pe)
struct part_entry *pe;
{ {
/* Mark a partition with arbitrary type. */ /* Mark a partition with arbitrary type. */
@ -923,9 +907,7 @@ struct part_entry *pe;
printf("Partition type changed to 0x%02x (%s)\n", type, systype(type)); printf("Partition type changed to 0x%02x (%s)\n", type, systype(type));
} }
int mygets(buf, length) int mygets(char *buf, int length)
char *buf;
int length; /* as for fgets(), but must be >= 2 */
{ {
/* Get a non-empty line of maximum length 'length'. */ /* Get a non-empty line of maximum length 'length'. */
@ -942,8 +924,7 @@ int length; /* as for fgets(), but must be >= 2 */
} }
} }
char *systype(type) char *systype(int type)
int type;
{ {
/* Convert system indicator into system name. */ /* Convert system indicator into system name. */
/* asw 01.03.95: added types based on info in kjb's part.c and output /* asw 01.03.95: added types based on info in kjb's part.c and output
@ -989,8 +970,7 @@ int type;
} }
} }
void toggle_active(pe) void toggle_active(struct part_entry *pe)
struct part_entry *pe;
{ {
/* Toggle active flag of a partition. */ /* Toggle active flag of a partition. */
@ -999,7 +979,7 @@ struct part_entry *pe;
printf("Partition changed to %sactive\n", pe->bootind ? "" : "in"); printf("Partition changed to %sactive\n", pe->bootind ? "" : "in");
} }
void usage() void usage(void)
{ {
/* Print usage message and exit. */ /* Print usage message and exit. */

View file

@ -223,7 +223,9 @@ static void
stat_display(struct xferstat *xs, int force) stat_display(struct xferstat *xs, int force)
{ {
struct timeval now; struct timeval now;
#if !defined(__minix)
int ctty_pgrp; int ctty_pgrp;
#endif /* !defined(__minix) */
/* Minix returns "Not a typewriter error" */ /* Minix returns "Not a typewriter error" */
#if defined(TIOCGPGRP) && !defined(__minix) #if defined(TIOCGPGRP) && !defined(__minix)

View file

@ -122,7 +122,7 @@ void format_track(int ffd, unsigned type, unsigned cyl, unsigned head)
track_pos= (off_t) (cyl * NR_HEADS + head) * nr_sectors * SECTOR_SIZE; track_pos= (off_t) (cyl * NR_HEADS + head) * nr_sectors * SECTOR_SIZE;
if (lseek(ffd, track_pos, SEEK_SET) == -1) { if (lseek(ffd, track_pos, SEEK_SET) == -1) {
fprintf(stderr, fprintf(stderr,
"format: seeking to cyl %u, head %u (pos %ld) failed: %s\n", "format: seeking to cyl %u, head %u (pos %d) failed: %s\n",
cyl, head, track_pos, strerror(errno)); cyl, head, track_pos, strerror(errno));
exit(1); exit(1);
} }
@ -154,7 +154,7 @@ void verify_track(int vfd, unsigned type, unsigned cyl, unsigned head)
track_pos= (off_t) (cyl * NR_HEADS + head) * nr_sectors * SECTOR_SIZE; track_pos= (off_t) (cyl * NR_HEADS + head) * nr_sectors * SECTOR_SIZE;
if (lseek(vfd, track_pos, SEEK_SET) == -1) { if (lseek(vfd, track_pos, SEEK_SET) == -1) {
fprintf(stderr, fprintf(stderr,
"format: seeking to cyl %u, head %u (pos %ld) failed: %s\n", "format: seeking to cyl %u, head %u (pos %d) failed: %s\n",
cyl, head, track_pos, strerror(errno)); cyl, head, track_pos, strerror(errno));
exit(1); exit(1);
} }
@ -167,7 +167,7 @@ void verify_track(int vfd, unsigned type, unsigned cyl, unsigned head)
for (sector= 0; sector < nr_sectors; sector++) { for (sector= 0; sector < nr_sectors; sector++) {
if (lseek(vfd, track_pos, SEEK_SET) == -1) { if (lseek(vfd, track_pos, SEEK_SET) == -1) {
fprintf(stderr, fprintf(stderr,
"format: seeking to cyl %u, head %u, sector %u (pos %ld) failed: %s\n", "format: seeking to cyl %u, head %u, sector %u (pos %d) failed: %s\n",
cyl, head, sector, track_pos, strerror(errno)); cyl, head, sector, track_pos, strerror(errno));
exit(1); exit(1);
} }
@ -175,7 +175,7 @@ void verify_track(int vfd, unsigned type, unsigned cyl, unsigned head)
switch (read(vfd, buf, SECTOR_SIZE)) { switch (read(vfd, buf, SECTOR_SIZE)) {
case -1: case -1:
fprintf(stderr, fprintf(stderr,
"format: bad sector at cyl %u, head %u, sector %u (pos %ld)\n", "format: bad sector at cyl %u, head %u, sector %u (pos %d)\n",
cyl, head, sector, track_pos); cyl, head, sector, track_pos);
bad_count++; bad_count++;
break; break;
@ -183,7 +183,7 @@ void verify_track(int vfd, unsigned type, unsigned cyl, unsigned head)
/* Fine. */ /* Fine. */
break; break;
default: default:
fprintf(stderr, "format: short read at pos %ld\n", fprintf(stderr, "format: short read at pos %d\n",
track_pos); track_pos);
bad_count++; bad_count++;
} }

View file

@ -9,7 +9,9 @@
#define COOKIEJAR "/usr/lib/fortune.dat" #define COOKIEJAR "/usr/lib/fortune.dat"
#if 0
static char *Copyright = "\0Copyright (c) 1990 Bert Reuling"; static char *Copyright = "\0Copyright (c) 1990 Bert Reuling";
#endif
static unsigned long seed; static unsigned long seed;
int main(int argc, char **argv); int main(int argc, char **argv);

View file

@ -227,7 +227,7 @@ void chkdev(char *f, char **clist, char **ilist, char **zlist);
/* Initialize the variables used by this program. */ /* Initialize the variables used by this program. */
void initvars() void initvars()
{ {
register level; register int level;
nregular = ndirectory = nblkspec = ncharspec = nregular = ndirectory = nblkspec = ncharspec =
nbadinode = nsock = npipe = nsyml = 0; nbadinode = nsock = npipe = nsyml = 0;
@ -338,7 +338,7 @@ unsigned nelem, elsize;
void printname(s) void printname(s)
char *s; char *s;
{ {
register n = MFS_NAME_MAX; register int n = MFS_NAME_MAX;
int c; int c;
do { do {
@ -510,7 +510,7 @@ char **getlist(argv, type)
char ***argv, *type; char ***argv, *type;
{ {
register char **list = *argv; register char **list = *argv;
register empty = 1; register int empty = 1;
while (getnumber(**argv) != NO_BIT) { while (getnumber(**argv) != NO_BIT) {
(*argv)++; (*argv)++;
@ -534,7 +534,7 @@ void lsuper()
/* Most of the following atol's enrage lint, for good reason. */ /* Most of the following atol's enrage lint, for good reason. */
printf("ninodes = %u", sb.s_ninodes); printf("ninodes = %u", sb.s_ninodes);
if (input(buf, 80)) sb.s_ninodes = atol(buf); if (input(buf, 80)) sb.s_ninodes = atol(buf);
printf("nzones = %ld", sb.s_zones); printf("nzones = %d", sb.s_zones);
if (input(buf, 80)) sb.s_zones = atol(buf); if (input(buf, 80)) sb.s_zones = atol(buf);
printf("imap_blocks = %u", sb.s_imap_blocks); printf("imap_blocks = %u", sb.s_imap_blocks);
if (input(buf, 80)) sb.s_imap_blocks = atol(buf); if (input(buf, 80)) sb.s_imap_blocks = atol(buf);
@ -544,9 +544,9 @@ void lsuper()
if (input(buf, 80)) sb.s_firstdatazone_old = atol(buf); if (input(buf, 80)) sb.s_firstdatazone_old = atol(buf);
printf("log_zone_size = %u", sb.s_log_zone_size); printf("log_zone_size = %u", sb.s_log_zone_size);
if (input(buf, 80)) sb.s_log_zone_size = atol(buf); if (input(buf, 80)) sb.s_log_zone_size = atol(buf);
printf("maxsize = %ld", sb.s_max_size); printf("maxsize = %d", sb.s_max_size);
if (input(buf, 80)) sb.s_max_size = atol(buf); if (input(buf, 80)) sb.s_max_size = atol(buf);
printf("block size = %ld", sb.s_block_size); printf("block size = %d", sb.s_block_size);
if (input(buf, 80)) sb.s_block_size = atol(buf); if (input(buf, 80)) sb.s_block_size = atol(buf);
if (yes("ok now")) { if (yes("ok now")) {
devwrite(0, OFFSET_SUPER_BLOCK, (char *) &sb, sizeof(sb)); devwrite(0, OFFSET_SUPER_BLOCK, (char *) &sb, sizeof(sb));
@ -594,7 +594,7 @@ void rw_super(int put)
fatal("first data zone too small"); fatal("first data zone too small");
if (sb.s_log_zone_size < 0) fatal("zone size < block size"); if (sb.s_log_zone_size < 0) fatal("zone size < block size");
if (sb.s_max_size <= 0) { if (sb.s_max_size <= 0) {
printf("warning: invalid max file size %ld\n", sb.s_max_size); printf("warning: invalid max file size %d\n", sb.s_max_size);
sb.s_max_size = LONG_MAX; sb.s_max_size = LONG_MAX;
} }
} }
@ -602,7 +602,7 @@ void rw_super(int put)
/* Check the super block for reasonable contents. */ /* Check the super block for reasonable contents. */
void chksuper() void chksuper()
{ {
register n; register int n;
register off_t maxsize; register off_t maxsize;
n = bitmapsize((bit_t) sb.s_ninodes + 1, block_size); n = bitmapsize((bit_t) sb.s_ninodes + 1, block_size);
@ -646,8 +646,8 @@ void chksuper()
if(maxsize <= 0) if(maxsize <= 0)
maxsize = LONG_MAX; maxsize = LONG_MAX;
if (sb.s_max_size != maxsize) { if (sb.s_max_size != maxsize) {
printf("warning: expected max size to be %ld ", maxsize); printf("warning: expected max size to be %d ", maxsize);
printf("instead of %ld\n", sb.s_max_size); printf("instead of %d\n", sb.s_max_size);
} }
if(sb.s_flags & MFSFLAG_MANDATORY_MASK) { if(sb.s_flags & MFSFLAG_MANDATORY_MASK) {
@ -715,7 +715,7 @@ bitchunk_t *bitmap;
block_nr bno; block_nr bno;
int nblk; int nblk;
{ {
register i; register int i;
register bitchunk_t *p; register bitchunk_t *p;
p = bitmap; p = bitmap;
@ -730,7 +730,7 @@ bitchunk_t *bitmap;
block_nr bno; block_nr bno;
int nblk; int nblk;
{ {
register i; register int i;
register bitchunk_t *p = bitmap; register bitchunk_t *p = bitmap;
for (i = 0; i < nblk; i++, bno++, p += WORDS_PER_BLOCK) for (i = 0; i < nblk; i++, bno++, p += WORDS_PER_BLOCK)
@ -749,9 +749,9 @@ char **list;
while ((bit = getnumber(*list++)) != NO_BIT) while ((bit = getnumber(*list++)) != NO_BIT)
if (bit < lwb || bit >= upb) { if (bit < lwb || bit >= upb) {
if (bitmap == spec_imap) if (bitmap == spec_imap)
printf("inode number %ld ", bit); printf("inode number %d ", bit);
else else
printf("zone number %ld ", bit); printf("zone number %d ", bit);
printf("out of range (ignored)\n"); printf("out of range (ignored)\n");
} else } else
setbit(bitmap, bit - lwb + 1); setbit(bitmap, bit - lwb + 1);
@ -798,11 +798,13 @@ bit_nr phys;
if ((w1 ^ w2) & 1 && ++(*n) % MAXPRINT == 0 && *report && if ((w1 ^ w2) & 1 && ++(*n) % MAXPRINT == 0 && *report &&
(!repair || automatic || yes("stop this listing"))) (!repair || automatic || yes("stop this listing")))
*report = 0; *report = 0;
else if (*report) else {
if (*report)
if ((w1 & 1) && !(w2 & 1)) if ((w1 & 1) && !(w2 & 1))
printf("%s %ld is missing\n", type, bit); printf("%s %d is missing\n", type, bit);
else if (!(w1 & 1) && (w2 & 1)) else if (!(w1 & 1) && (w2 & 1))
printf("%s %ld is not free\n", type, bit); printf("%s %d is not free\n", type, bit);
}
} }
/* Check if the given (correct) bitmap is identical with the one that is /* Check if the given (correct) bitmap is identical with the one that is
@ -960,7 +962,7 @@ void list(ino_t ino, d_inode *ip)
case I_BLOCK_SPECIAL: case I_BLOCK_SPECIAL:
printf(" %2x,%2x ", major(ip->i_zone[0]), minor(ip->i_zone[0])); printf(" %2x,%2x ", major(ip->i_zone[0]), minor(ip->i_zone[0]));
break; break;
default: printf("%7ld ", ip->i_size); default: printf("%7d ", ip->i_size);
} }
printpath(0, 1); printpath(0, 1);
} }
@ -1038,7 +1040,7 @@ int chkdots(ino_t ino, off_t pos, dir_struct *dp, ino_t exp)
} }
} else if (pos != (dp->mfs_d_name[1] ? DIR_ENTRY_SIZE : 0)) { } else if (pos != (dp->mfs_d_name[1] ? DIR_ENTRY_SIZE : 0)) {
make_printable_name(printable_name, dp->mfs_d_name, sizeof(dp->mfs_d_name)); make_printable_name(printable_name, dp->mfs_d_name, sizeof(dp->mfs_d_name));
printf("warning: %s has offset %ld in ", printable_name, pos); printf("warning: %s has offset %d in ", printable_name, pos);
printpath(1, 0); printpath(1, 0);
printf("%s is linked to %u)\n", printable_name, dp->d_inum); printf("%s is linked to %u)\n", printable_name, dp->d_inum);
setbit(spec_imap, (bit_nr) ino); setbit(spec_imap, (bit_nr) ino);
@ -1051,7 +1053,7 @@ int chkdots(ino_t ino, off_t pos, dir_struct *dp, ino_t exp)
/* Check the name in a directory entry. */ /* Check the name in a directory entry. */
int chkname(ino_t ino, dir_struct *dp) int chkname(ino_t ino, dir_struct *dp)
{ {
register n = MFS_NAME_MAX + 1; register int n = MFS_NAME_MAX + 1;
register char *p = dp->mfs_d_name; register char *p = dp->mfs_d_name;
if (*p == '\0') { if (*p == '\0') {
@ -1129,7 +1131,7 @@ int chkdirzone(ino_t ino, d_inode *ip, off_t pos, zone_nr zno)
{ {
dir_struct dirblk[CDIRECT]; dir_struct dirblk[CDIRECT];
register dir_struct *dp; register dir_struct *dp;
register n, dirty; register int n, dirty;
long block= ztob(zno); long block= ztob(zno);
register long offset = 0; register long offset = 0;
register off_t size = 0; register off_t size = 0;
@ -1198,14 +1200,14 @@ off_t pos;
{ {
printf("%s zone in ", mess); printf("%s zone in ", mess);
printpath(1, 0); printpath(1, 0);
printf("zno = %ld, type = ", zno); printf("zno = %d, type = ", zno);
switch (level) { switch (level) {
case 0: printf("DATA"); break; case 0: printf("DATA"); break;
case 1: printf("SINGLE INDIRECT"); break; case 1: printf("SINGLE INDIRECT"); break;
case 2: printf("DOUBLE INDIRECT"); break; case 2: printf("DOUBLE INDIRECT"); break;
default: printf("VERY INDIRECT"); default: printf("VERY INDIRECT");
} }
printf(", pos = %ld)\n", pos); printf(", pos = %d)\n", pos);
} }
/* Found the given zone in the given inode. Check it, and if ok, mark it /* Found the given zone in the given inode. Check it, and if ok, mark it
@ -1240,7 +1242,7 @@ off_t pos;
int chkindzone(ino_t ino, d_inode *ip, off_t *pos, zone_nr zno, int level) int chkindzone(ino_t ino, d_inode *ip, off_t *pos, zone_nr zno, int level)
{ {
zone_nr indirect[CINDIR]; zone_nr indirect[CINDIR];
register n = NR_INDIRECTS / CINDIR; register int n = NR_INDIRECTS / CINDIR;
long block= ztob(zno); long block= ztob(zno);
register long offset = 0; register long offset = 0;
@ -1288,7 +1290,7 @@ int zonechk(ino_t ino, d_inode *ip, off_t *pos, zone_nr zno, int level)
int chkzones(ino_t ino, d_inode *ip, off_t *pos, zone_nr *zlist, int chkzones(ino_t ino, d_inode *ip, off_t *pos, zone_nr *zlist,
int len, int level) int len, int level)
{ {
register ok = 1, i; register int ok = 1, i;
/* The check on the position in the next loop is commented out, since FS /* The check on the position in the next loop is commented out, since FS
* now requires valid zone numbers in each level that is necessary and FS * now requires valid zone numbers in each level that is necessary and FS
@ -1308,7 +1310,7 @@ int chkzones(ino_t ino, d_inode *ip, off_t *pos, zone_nr *zlist,
/* Check a file or a directory. */ /* Check a file or a directory. */
int chkfile(ino_t ino, d_inode *ip) int chkfile(ino_t ino, d_inode *ip)
{ {
register ok, i, level; register int ok, i, level;
off_t pos = 0; off_t pos = 0;
ok = chkzones(ino, ip, &pos, &ip->i_zone[0], NR_DZONE_NUM, 0); ok = chkzones(ino, ip, &pos, &ip->i_zone[0], NR_DZONE_NUM, 0);
@ -1320,7 +1322,7 @@ int chkfile(ino_t ino, d_inode *ip)
/* Check a directory by checking the contents. Check if . and .. are present. */ /* Check a directory by checking the contents. Check if . and .. are present. */
int chkdirectory(ino_t ino, d_inode *ip) int chkdirectory(ino_t ino, d_inode *ip)
{ {
register ok; register int ok;
setbit(dirmap, (bit_nr) ino); setbit(dirmap, (bit_nr) ino);
ok = chkfile(ino, ip); ok = chkfile(ino, ip);
@ -1349,7 +1351,7 @@ int chklink(ino_t ino, d_inode *ip)
if (ip->i_size == 0) if (ip->i_size == 0)
printf("empty symbolic link "); printf("empty symbolic link ");
else else
printf("symbolic link too large (size %ld) ", ip->i_size); printf("symbolic link too large (size %d) ", ip->i_size);
printpath(2, 1); printpath(2, 1);
ok = 0; ok = 0;
} }
@ -1365,7 +1367,7 @@ int chkspecial(ino_t ino, d_inode *ip)
ok = 1; ok = 1;
if ((dev_t) ip->i_zone[0] == NO_DEV) { if ((dev_t) ip->i_zone[0] == NO_DEV) {
printf("illegal device number %ld for special file ", ip->i_zone[0]); printf("illegal device number %d for special file ", ip->i_zone[0]);
printpath(2, 1); printpath(2, 1);
ok = 0; ok = 0;
} }
@ -1375,7 +1377,7 @@ int chkspecial(ino_t ino, d_inode *ip)
*/ */
for (i = 1; i < NR_ZONE_NUMS; i++) for (i = 1; i < NR_ZONE_NUMS; i++)
if (ip->i_zone[i] != NO_ZONE) { if (ip->i_zone[i] != NO_ZONE) {
printf("nonzero zone number %ld for special file ", printf("nonzero zone number %d for special file ",
ip->i_zone[i]); ip->i_zone[i]);
printpath(2, 1); printpath(2, 1);
ok = 0; ok = 0;
@ -1452,7 +1454,7 @@ dir_struct *dp;
{ {
d_inode inode; d_inode inode;
register ino_t ino = dp->d_inum; register ino_t ino = dp->d_inum;
register visited; register int visited;
struct stack stk; struct stack stk;
stk.st_dir = dp; stk.st_dir = dp;
@ -1500,7 +1502,7 @@ void chktree()
void printtotal() void printtotal()
{ {
if(preen) { if(preen) {
printf("%d files, %d directories, %d free inodes, %d free zones\n", printf("%d files, %d directories, %d free inodes, %ld free zones\n",
nregular, ndirectory, nfreeinode, nfreezone); nregular, ndirectory, nfreeinode, nfreezone);
return; return;
} }
@ -1616,7 +1618,7 @@ char **argv;
register char **clist = 0, **ilist = 0, **zlist = 0; register char **clist = 0, **ilist = 0, **zlist = 0;
int badflag = 0; int badflag = 0;
register devgiven = 0; register int devgiven = 0;
register char *arg; register char *arg;
if ((1 << BITSHIFT) != 8 * sizeof(bitchunk_t)) { if ((1 << BITSHIFT) != 8 * sizeof(bitchunk_t)) {

View file

@ -261,13 +261,14 @@ int DOstat()
{ {
char *file; char *file;
if(cmdargc < 2) if(cmdargc < 2) {
if(!linkopen) { if(!linkopen) {
printf("You must \"OPEN\" a connection first.\n"); printf("You must \"OPEN\" a connection first.\n");
return(0); return(0);
} else } else {
return(DOcommand("STAT", "")); return(DOcommand("STAT", ""));
}
}
if(DOcmdcheck()) if(DOcmdcheck())
return(0); return(0);
@ -434,7 +435,7 @@ char restart[16];
} else } else
filesize = lseek(fd, 0, SEEK_END); filesize = lseek(fd, 0, SEEK_END);
sprintf(restart, "%lu", filesize); sprintf(restart, "%u", filesize);
s = DOcommand("REST", restart); s = DOcommand("REST", restart);
@ -509,7 +510,7 @@ unsigned short crc(char *fname);
if((s / 100) != 2) if((s / 100) != 2)
return(-1); return(-1);
sscanf(reply, "%*d %*s%u%lu", &ccrc, &csize); sscanf(reply, "%*hu %*s%u%lu", &ccrc, &csize);
if(ss < 0) return(-1); if(ss < 0) return(-1);
lcrc = crc(file); lcrc = crc(file);
if(size != csize || size != st.st_size || ccrc != lcrc) if(size != csize || size != st.st_size || ccrc != lcrc)
@ -521,7 +522,7 @@ unsigned short crc(char *fname);
} else } else
if((ss < 0) && (ft == 'b' || ft == 'c' || ft == 'p')) { if((ss < 0) && (ft == 'b' || ft == 'c' || ft == 'p')) {
s = mknod(file, fmode, maj << 8 | min); s = mknod(file, fmode, maj << 8 | min);
printf("mknod %c %u %u\n", file, maj, min); printf("mknod %s %lu %lu\n", file, maj, min);
} else } else
return(0); return(0);
} }
@ -530,11 +531,11 @@ unsigned short crc(char *fname);
return(-1); return(-1);
if(st.st_uid != uid || st.st_gid != gid) { if(st.st_uid != uid || st.st_gid != gid) {
s = chown(file, uid, gid); s = chown(file, uid, gid);
printf("chown %u:%u %s\n", uid, gid, file); printf("chown %lu:%lu %s\n", uid, gid, file);
} }
if(st.st_mode != fmode) { if(st.st_mode != fmode) {
s = chmod(file, fmode); s = chmod(file, fmode);
printf("chmod %04o %s\n", fmode, file); printf("chmod %04lo %s\n", fmode, file);
} }
if(st.st_mtime != mtime) { if(st.st_mtime != mtime) {
ut.actime = mtime; ut.actime = mtime;
@ -727,7 +728,7 @@ char restart[16];
return(0); return(0);
} }
sprintf(restart, "%lu", rmtsize); sprintf(restart, "%u", rmtsize);
s = DOcommand("REST", restart); s = DOcommand("REST", restart);

View file

@ -34,7 +34,6 @@ int DOlpwd()
int DOlcd() int DOlcd()
{ {
char *path; char *path;
int s;
path = cmdargv[1]; path = cmdargv[1];
@ -55,7 +54,6 @@ int s;
int DOlmkdir() int DOlmkdir()
{ {
char *path; char *path;
int s;
path = cmdargv[1]; path = cmdargv[1];
@ -76,7 +74,6 @@ int s;
int DOlrmdir() int DOlrmdir()
{ {
char *path; char *path;
int s;
path = cmdargv[1]; path = cmdargv[1];

View file

@ -39,7 +39,7 @@ static int asciisend(fd, fdout)
int fd; int fd;
int fdout; int fdout;
{ {
int s, len; int s;
char c; char c;
char *p; char *p;
char *op, *ope; char *op, *ope;
@ -164,7 +164,7 @@ static int asciirecv(fd, fdin)
int fd; int fd;
int fdin; int fdin;
{ {
int s, len; int s;
int gotcr; int gotcr;
char c; char c;
char *p; char *p;
@ -235,7 +235,7 @@ unsigned short cnt;
return(0); return(0);
} }
static binaryrecv(fd, fdin) static int binaryrecv(fd, fdin)
int fd; int fd;
int fdin; int fdin;
{ {

View file

@ -125,6 +125,7 @@ static int tcpip_writeall( int fd, char *buf, unsigned siz );
int int
main(c, v) main(c, v)
int c;
char **v; char **v;
{ {
char *domain; char *domain;
@ -135,8 +136,8 @@ main(c, v)
#endif #endif
register struct hostent *hp; register struct hostent *hp;
register char *s, *p; register char *s, *p;
register inverse = 0; register int inverse = 0;
register waitmode = 0; register int waitmode = 0;
u8_t *oldcname; u8_t *oldcname;
int ncnames; int ncnames;
int isaddr; int isaddr;
@ -496,7 +497,6 @@ getinfo(name, domain, type)
u8_t *eom, *bp, *cp; u8_t *eom, *bp, *cp;
querybuf_t buf, answer; querybuf_t buf, answer;
int n, n1, i, j, nmx, ancount, nscount, arcount, qdcount, buflen; int n, n1, i, j, nmx, ancount, nscount, arcount, qdcount, buflen;
u_short pref, class;
char host[2*MAXDNAME+2]; char host[2*MAXDNAME+2];
if (domain == NULL) if (domain == NULL)
@ -532,8 +532,7 @@ printinfo(answer, eom, filter, isls)
{ {
HEADER *hp; HEADER *hp;
u8_t *bp, *cp; u8_t *bp, *cp;
int n, n1, i, j, nmx, ancount, nscount, arcount, qdcount, buflen; int nmx, ancount, nscount, arcount, qdcount, buflen;
u_short pref, class;
/* /*
* find first satisfactory answer * find first satisfactory answer
@ -702,8 +701,9 @@ pr_rr(cp, msg, file, filter)
if (verbose) if (verbose)
fprintf(file,"%s\t%d%s\t%s", fprintf(file,"%s\t%d%s\t%s",
name, ttl, pr_class(class), pr_type(type)); name, ttl, pr_class(class), pr_type(type));
else else {
fprintf(file,"%s%s %s",name, pr_class(class), pr_type(type)); fprintf(file,"%s%s %s",name, pr_class(class), pr_type(type));
}
if (verbose) if (verbose)
punc = '\t'; punc = '\t';
else else
@ -760,12 +760,12 @@ pr_rr(cp, msg, file, filter)
break; break;
case T_HINFO: case T_HINFO:
if (n = *cp++) { if ((n = *cp++)) {
if (doprint) if (doprint)
fprintf(file,"%c%.*s", punc, n, cp); fprintf(file,"%c%.*s", punc, n, cp);
cp += n; cp += n;
} }
if (n = *cp++) { if ((n = *cp++)) {
if (doprint) if (doprint)
fprintf(file,"%c%.*s", punc, n, cp); fprintf(file,"%c%.*s", punc, n, cp);
cp += n; cp += n;
@ -780,28 +780,29 @@ pr_rr(cp, msg, file, filter)
if (doprint) if (doprint)
fprintf(file," %s", name); fprintf(file," %s", name);
if (doprint) if (doprint)
fprintf(file,"(\n\t\t\t%ld\t;serial (version)", _getlong(cp)); fprintf(file,"(\n\t\t\t%d\t;serial (version)", _getlong(cp));
cp += sizeof(u_long); cp += sizeof(u_long);
if (doprint) if (doprint)
fprintf(file,"\n\t\t\t%ld\t;refresh period", _getlong(cp)); fprintf(file,"\n\t\t\t%d\t;refresh period", _getlong(cp));
cp += sizeof(u_long); cp += sizeof(u_long);
if (doprint) if (doprint)
fprintf(file,"\n\t\t\t%ld\t;retry refresh this often", _getlong(cp)); fprintf(file,"\n\t\t\t%d\t;retry refresh this often", _getlong(cp));
cp += sizeof(u_long); cp += sizeof(u_long);
if (doprint) if (doprint)
fprintf(file,"\n\t\t\t%ld\t;expiration period", _getlong(cp)); fprintf(file,"\n\t\t\t%d\t;expiration period", _getlong(cp));
cp += sizeof(u_long); cp += sizeof(u_long);
if (doprint) if (doprint)
fprintf(file,"\n\t\t\t%ld\t;minimum TTL\n\t\t\t)", _getlong(cp)); fprintf(file,"\n\t\t\t%d\t;minimum TTL\n\t\t\t)", _getlong(cp));
cp += sizeof(u_long); cp += sizeof(u_long);
break; break;
case T_MX: case T_MX:
if (doprint) if (doprint) {
if (verbose) if (verbose)
fprintf(file,"\t%d ",_getshort(cp)); fprintf(file,"\t%d ",_getshort(cp));
else else
fprintf(file," (pri=%d) by ",_getshort(cp)); fprintf(file," (pri=%d) by ",_getshort(cp));
}
cp += sizeof(u_short); cp += sizeof(u_short);
cp = pr_cdname(cp, msg, name, sizeof(name)); cp = pr_cdname(cp, msg, name, sizeof(name));
if (doprint) if (doprint)
@ -819,7 +820,7 @@ pr_rr(cp, msg, file, filter)
/* Roy start */ /* Roy start */
case T_TXT: case T_TXT:
if (n = *cp++) { if ((n = *cp++)) {
if (doprint) if (doprint)
fprintf(file,"%c%.*s", punc, n, cp); fprintf(file,"%c%.*s", punc, n, cp);
cp += n; cp += n;

View file

@ -34,8 +34,6 @@ char tmpX[] = "tmpXXXXXX";
void spoolerr(char *file) void spoolerr(char *file)
{ {
int e= errno;
unlink(jobX); unlink(jobX);
unlink(tmpX); unlink(tmpX);
fatal(file); fatal(file);
@ -172,7 +170,7 @@ int flush(void)
count = 0; count = 0;
} }
int put(int c) void put(int c)
/* Send characters to the output buffer to be printed and do so if the buffer /* Send characters to the output buffer to be printed and do so if the buffer
* is full. Track the position of the write-head in `column' and `line'. * is full. Track the position of the write-head in `column' and `line'.
*/ */

View file

@ -1002,7 +1002,7 @@ void listfiles(struct file *flist, enum depth depth, enum state state)
sort(&flist); sort(&flist);
if (depth == SUBMERGED && (field & (L_BLOCKS | L_LONG))) { if (depth == SUBMERGED && (field & (L_BLOCKS | L_LONG))) {
printf("total %ld\n", nblk2k(countblocks(flist))); printf("total %d\n", nblk2k(countblocks(flist)));
} }
if (state == SINKING || depth == SURFACE1) { if (state == SINKING || depth == SURFACE1) {

View file

@ -199,7 +199,7 @@ SCSI tape drive %s:\n\
(long) mtget.mt_fileno, (long) mtget.mt_fileno,
(long) mtget.mt_blkno, (long) mtget.mt_blkno,
(long) mtget.mt_resid); (long) mtget.mt_resid);
printf(mtget.mt_blksize == 0 ? "variable\n" : "%ld\n", printf(mtget.mt_blksize == 0 ? "variable\n" : "%d\n",
mtget.mt_blksize); mtget.mt_blksize);
} }
} }

View file

@ -334,7 +334,7 @@ void distribute(void)
{ {
struct part_entry *pe, *exp; struct part_entry *pe, *exp;
long count; long count;
unsigned long base, size, oldbase; unsigned long base, oldbase;
do { do {
exp= nil; exp= nil;

View file

@ -382,7 +382,7 @@ int pstat(struct pstat *ps, pid_t pid)
exit(1); exit(1);
} }
if (fscanf(fp, " %c %d %255s %c %d %*d %lu %lu %*u %*u", if (fscanf(fp, " %c %d %255s %c %d %*d %u %u %*u %*u",
&type, &ps->ps_endpt, name, &ps->ps_state, &type, &ps->ps_endpt, name, &ps->ps_state,
&ps->ps_recv, &ps->ps_utime, &ps->ps_stime) != 7) { &ps->ps_recv, &ps->ps_utime, &ps->ps_stime) != 7) {

View file

@ -38,7 +38,7 @@ main(int argc, char *argv[])
return 1; return 1;
} }
fprintf(stderr, "size on %s set to %dkB\n", d, size/KFACTOR); fprintf(stderr, "size on %s set to %ldkB\n", d, size/KFACTOR);
return 0; return 0;
} }

View file

@ -220,7 +220,7 @@ int main(int argc, char **argv)
if (nbytes > 0) { if (nbytes > 0) {
off_t kBpts; off_t kBpts;
fprintf(stderr, "%ld kB / %d.%d s = ", fprintf(stderr, "%d kB / %ld.%ld s = ",
(nbytes + 512) / 1024, (nbytes + 512) / 1024,
tenthsec / 10, tenthsec % 10); tenthsec / 10, tenthsec % 10);
if (tenthsec < 5) if (tenthsec < 5)
@ -230,11 +230,11 @@ int main(int argc, char **argv)
seconds = (tenthsec + 5) / 10; seconds = (tenthsec + 5) / 10;
kBpts= (nbytes + 512L * seconds) kBpts= (nbytes + 512L * seconds)
/ (1024L * seconds); / (1024L * seconds);
fprintf(stderr, "%ld kB/s\n", kBpts); fprintf(stderr, "%d kB/s\n", kBpts);
} else { } else {
kBpts= (100 * nbytes + 512L * tenthsec) kBpts= (100 * nbytes + 512L * tenthsec)
/ (1024L * tenthsec); / (1024L * tenthsec);
fprintf(stderr, "%ld.%ld kB/s\n", fprintf(stderr, "%d.%d kB/s\n",
kBpts/10, kBpts%10); kBpts/10, kBpts%10);
} }
} }
@ -246,7 +246,7 @@ int main(int argc, char **argv)
tenthms= (tenthsec * 1000 + nseeks/2) / nseeks; tenthms= (tenthsec * 1000 + nseeks/2) / nseeks;
fprintf(stderr, fprintf(stderr,
"%ld seeks / %d.%d s = %ld seeks/s = %ld.%ld ms/seek\n", "%d seeks / %ld.%ld s = %ld seeks/s = %d.%d ms/seek\n",
nseeks, tenthsec / 10, tenthsec % 10, nseeks, tenthsec / 10, tenthsec % 10,
(nseeks * 10 + tenthsec/2) / tenthsec, (nseeks * 10 + tenthsec/2) / tenthsec,
tenthms / 10, tenthms % 10); tenthms / 10, tenthms % 10);
@ -263,7 +263,7 @@ int main(int argc, char **argv)
} else { } else {
fprintf(stderr, ", "); fprintf(stderr, ", ");
} }
fprintf(stderr, "%ld.%ld ms (%d rpm)", fprintf(stderr, "%d.%d ms (%d rpm)",
(tenthms - rotms) / 10, (tenthms - rotms) % 10, (tenthms - rotms) / 10, (tenthms - rotms) % 10,
rpm); rpm);
} }

View file

@ -11,7 +11,9 @@ char copyright[] =
#endif /* not lint */ #endif /* not lint */
#ifndef lint #ifndef lint
#if 0
static char sccsid[] = "@(#)rcp.c 1.1 87/12/21 SMI"; /* from UCB 5.3 6/8/85"*/ static char sccsid[] = "@(#)rcp.c 1.1 87/12/21 SMI"; /* from UCB 5.3 6/8/85"*/
#endif
#endif /* not lint */ #endif /* not lint */
/* /*
@ -84,7 +86,7 @@ struct buffer {
#define ga() (void) write(rem, "", 1) #define ga() (void) write(rem, "", 1)
main(argc, argv) int main(argc, argv)
int argc; int argc;
char **argv; char **argv;
{ {
@ -462,7 +464,7 @@ notreg:
* Make it compatible with possible future * Make it compatible with possible future
* versions expecting microseconds. * versions expecting microseconds.
*/ */
(void) sprintf(buf, "T%ld 0 %ld 0\n", (void) sprintf(buf, "T%d 0 %d 0\n",
stb.st_mtime, stb.st_atime); stb.st_mtime, stb.st_atime);
(void) write(rem, buf, strlen(buf)); (void) write(rem, buf, strlen(buf));
if (response() < 0) { if (response() < 0) {
@ -470,7 +472,7 @@ notreg:
continue; continue;
} }
} }
(void) sprintf(buf, "C%04o %ld %s\n", (void) sprintf(buf, "C%04o %lld %s\n",
stb.st_mode&07777, stb.st_size, last); stb.st_mode&07777, stb.st_size, last);
(void) write(rem, buf, strlen(buf)); (void) write(rem, buf, strlen(buf));
if (response() < 0) { if (response() < 0) {
@ -521,7 +523,7 @@ rsource(name, statp)
else else
last++; last++;
if (pflag) { if (pflag) {
(void) sprintf(buf, "T%ld 0 %ld 0\n", (void) sprintf(buf, "T%d 0 %d 0\n",
statp->st_mtime, statp->st_atime); statp->st_mtime, statp->st_atime);
(void) write(rem, buf, strlen(buf)); (void) write(rem, buf, strlen(buf));
if (response() < 0) { if (response() < 0) {
@ -535,7 +537,7 @@ rsource(name, statp)
closedir(d); closedir(d);
return; return;
} }
while (dp = readdir(d)) { while ((dp = readdir(d))) {
if (dp->d_ino == 0) if (dp->d_ino == 0)
continue; continue;
if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, ".."))

View file

@ -801,7 +801,7 @@ entry_t *readstate(void)
static pathname_t path; static pathname_t path;
static size_t *trunc; static size_t *trunc;
static size_t trunc_len; static size_t trunc_len;
static base_indent; static int base_indent;
char *line; char *line;
char **argv; char **argv;
size_t argc; size_t argc;

View file

@ -143,7 +143,7 @@ struct winsize winsize;
#define get_window_size(fd, wp) ioctl(fd, TIOCGWINSZ, wp) #define get_window_size(fd, wp) ioctl(fd, TIOCGWINSZ, wp)
extern int main( int argc, char **argv ); extern int main( int argc, char **argv );
static void usage( void ); static void usage( void ) __attribute__((noreturn));
static u_char getescape( char *p ); static u_char getescape( char *p );
static char *speeds2str( speed_t speed ); static char *speeds2str( speed_t speed );
static void lostpeer( int sig ); static void lostpeer( int sig );
@ -201,7 +201,7 @@ int main(argc, argv)
one = 1; one = 1;
host = user = NULL; host = user = NULL;
if (p = rindex(argv[0], '/')) if ((p = rindex(argv[0], '/')))
++p; ++p;
else else
p = argv[0]; p = argv[0];
@ -582,7 +582,7 @@ catch_child(sig)
if (pid == 0) if (pid == 0)
return; return;
/* if the child (reader) dies, just quit */ /* if the child (reader) dies, just quit */
if (pid < 0 || pid == child && !WIFSTOPPED(status)) if (pid < 0 || ((pid == child) && (!WIFSTOPPED(status))))
done(WTERMSIG(status) | WEXITSTATUS(status)); done(WTERMSIG(status) | WEXITSTATUS(status));
} }
/* NOTREACHED */ /* NOTREACHED */
@ -778,7 +778,6 @@ char rcvbuf[8 * 1024];
static int static int
reader() reader()
{ {
int pid = -getpid();
int n, remaining; int n, remaining;
char *bufp = rcvbuf; char *bufp = rcvbuf;

View file

@ -38,7 +38,9 @@ char copyright[] =
#endif /* not lint */ #endif /* not lint */
#ifndef lint #ifndef lint
#if 0
static char sccsid[] = "@(#)rsh.c 5.24 (Berkeley) 7/1/91"; static char sccsid[] = "@(#)rsh.c 5.24 (Berkeley) 7/1/91";
#endif
#endif /* not lint */ #endif /* not lint */
/* /*
@ -126,7 +128,7 @@ main(argc, argv)
host = user = NULL; host = user = NULL;
/* if called as something other than "rsh", use it as the host name */ /* if called as something other than "rsh", use it as the host name */
if (p = rindex(argv[0], '/')) if ((p = rindex(argv[0], '/')))
++p; ++p;
else else
p = argv[0]; p = argv[0];
@ -359,7 +361,9 @@ talk(nflag, omask, pid, rem)
{ {
register int cc, wc; register int cc, wc;
register char *bp; register char *bp;
#if !_MINIX
int readfrom, ready, rembits; int readfrom, ready, rembits;
#endif
char buf[BUFSIZ]; char buf[BUFSIZ];
#if _MINIX #if _MINIX
int pid1; int pid1;

View file

@ -11,7 +11,7 @@ int main(argc, argv)
int argc; int argc;
char *argv[]; char *argv[];
{ {
register seconds; register int seconds;
register char c; register char c;
seconds = 0; seconds = 0;
@ -20,7 +20,7 @@ char *argv[];
std_err("Usage: sleep time\n"); std_err("Usage: sleep time\n");
exit(1); exit(1);
} }
while (c = *(argv[1])++) { while ((c = *(argv[1])++)) {
if (c < '0' || c > '9') { if (c < '0' || c > '9') {
std_err("sleep: bad arg\n"); std_err("sleep: bad arg\n");
exit(1); exit(1);

View file

@ -1355,7 +1355,7 @@ static void Usage()
exit(1); exit(1);
} }
main(argc, argv) int argc; char **argv; int main(argc, argv) int argc; char **argv;
{ {
char *s_mach, *s_dir; char *s_mach, *s_dir;
char *m_mach, *m_dir; char *m_mach, *m_dir;

View file

@ -275,7 +275,7 @@ void logmsg(int pri, char *msg, char *from, int flags)
{ {
struct filed *f; struct filed *f;
int fac, prilev; int fac, prilev;
int omask, msglen; int /*omask,*/ msglen;
char *timestamp; char *timestamp;
DEBUG(dprintf("logmsg: pri %o, flags %x, from %s, msg %s\n", pri, flags, from, msg);) DEBUG(dprintf("logmsg: pri %o, flags %x, from %s, msg %s\n", pri, flags, from, msg);)
@ -639,8 +639,6 @@ void printline(char *hname, char *msg)
void printkline(char *hname, char *msg) void printkline(char *hname, char *msg)
{ {
char line[MAXLINE + 1]; char line[MAXLINE + 1];
char *p = msg, *q = line;
int ch, pri = DEFUPRI;
/* Copies message to local buffer, adding source program tag */ /* Copies message to local buffer, adding source program tag */
snprintf(line, sizeof(line), "kernel: %s", msg); snprintf(line, sizeof(line), "kernel: %s", msg);
@ -656,7 +654,6 @@ void printkline(char *hname, char *msg)
*/ */
void init(int sig) void init(int sig)
{ {
int i;
FILE *cf; FILE *cf;
struct filed *fLog, *next, **nextp; struct filed *fLog, *next, **nextp;
char *p; char *p;
@ -926,7 +923,7 @@ int main(int argc, char **argv)
linebuf[len] = '\n'; linebuf[len] = '\n';
linebuf[len + 1] = '\0'; linebuf[len + 1] = '\0';
p = linebuf; p = linebuf;
while(eol = strchr(p, '\n')) { while((eol = strchr(p, '\n'))) {
*eol = '\0'; *eol = '\0';
printkline(LocalHostName, p); printkline(LocalHostName, p);
p = eol+1; p = eol+1;

View file

@ -70,7 +70,7 @@ int main(int argc, char **argv)
struct nwio_tcpopt tcpopt; struct nwio_tcpopt tcpopt;
char *tcp_device; char *tcp_device;
struct servent *servent; struct servent *servent;
int tcp_fd, client_fd, count, r; int tcp_fd, client_fd, r;
int pfd[2]; int pfd[2];
unsigned stall= 0; unsigned stall= 0;
struct sigaction sa; struct sigaction sa;

View file

@ -70,7 +70,7 @@ int main(int argc, char **argv)
struct nwio_tcpopt tcpopt; struct nwio_tcpopt tcpopt;
char *tcp_device; char *tcp_device;
struct servent *servent; struct servent *servent;
int tcp_fd, client_fd, count, r; int tcp_fd, client_fd, r;
int pfd[2]; int pfd[2];
unsigned stall= 0; unsigned stall= 0;
struct sigaction sa; struct sigaction sa;

View file

@ -48,7 +48,9 @@ int main(int argc, char*argv[])
int fd, i, r; int fd, i, r;
char *query, *pval; char *query, *pval;
size_t len; size_t len;
#ifdef __minix_vmd
struct timeval uptime; struct timeval uptime;
#endif
clock_t now; clock_t now;
int fl; int fl;
int a_flag, n_flag, v_flag; int a_flag, n_flag, v_flag;
@ -224,7 +226,7 @@ void print_conn(int i, clock_t now)
case TCS_CLOSED: printf("CLOSED"); case TCS_CLOSED: printf("CLOSED");
if (tcp_conn->tc_senddis >= now) if (tcp_conn->tc_senddis >= now)
{ {
printf("(time wait %ld s)", printf("(time wait %d s)",
(tcp_conn->tc_senddis-now)/system_hz); (tcp_conn->tc_senddis-now)/system_hz);
} }
no_verbose= 1; no_verbose= 1;
@ -250,7 +252,7 @@ void print_conn(int i, clock_t now)
tcp_conn->tc_state != TCS_LISTEN) tcp_conn->tc_state != TCS_LISTEN)
{ {
printf("\n\t"); printf("\n\t");
printf("RQ: %lu, SQ: %lu, RWnd: %u, SWnd: %lu, SWThresh: %lu", printf("RQ: %u, SQ: %u, RWnd: %u, SWnd: %u, SWThresh: %u",
tcp_conn->tc_RCV_NXT - tcp_conn->tc_RCV_LO, tcp_conn->tc_RCV_NXT - tcp_conn->tc_RCV_LO,
tcp_conn->tc_SND_NXT - tcp_conn->tc_SND_UNA, tcp_conn->tc_SND_NXT - tcp_conn->tc_SND_UNA,
tcp_conn->tc_rcv_wnd, tcp_conn->tc_rcv_wnd,

View file

@ -52,7 +52,7 @@ static void usage(void);
#endif #endif
static char *prog_name; static char *prog_name;
static tcp_fd; static int tcp_fd;
static char *term_env; static char *term_env;
static int esc_char= '~'; static int esc_char= '~';
static enum { LS_NORM, LS_BOL, LS_ESC } line_state= LS_BOL; static enum { LS_NORM, LS_BOL, LS_ESC } line_state= LS_BOL;

View file

@ -37,7 +37,9 @@
#include <net/gen/inet.h> #include <net/gen/inet.h>
#include "telnetd.h" #include "telnetd.h"
#if 0
static char *Version = "@(#) telnetd 1.00 (07/26/92)"; static char *Version = "@(#) telnetd 1.00 (07/26/92)";
#endif
int opt_d = 0; /* debugging output flag */ int opt_d = 0; /* debugging output flag */
@ -105,7 +107,7 @@ char *hostname;
lineno = 0; lineno = 0;
for (;;) { for (;;) {
if ((ttyp = getttyent()) == NULL) { if ((ttyp = getttyent()) == NULL) {
sprintf(buff, "Can't find %s in the tty table\r\n"); sprintf(buff, "Can't find the tty entry in the tty table\r\n");
(void) write(1, buff, strlen(buff)); (void) write(1, buff, strlen(buff));
} }
if (strcmp(ttyp->ty_name, tty_name+5) == 0) break; if (strcmp(ttyp->ty_name, tty_name+5) == 0) break;

View file

@ -96,7 +96,7 @@ int len;
(void) write(fdout, buf, len); (void) write(fdout, buf, len);
} }
int set_winsize(int fd, unsigned int cols, unsigned int rows) void set_winsize(int fd, unsigned int cols, unsigned int rows)
{ {
struct winsize w; struct winsize w;
memset(&w, 0, sizeof(w)); memset(&w, 0, sizeof(w));
@ -105,7 +105,7 @@ int set_winsize(int fd, unsigned int cols, unsigned int rows)
ioctl(fd, TIOCSWINSZ, (char *) &w); ioctl(fd, TIOCSWINSZ, (char *) &w);
} }
int tel_in(fdout, telout, buffer, len) void tel_in(fdout, telout, buffer, len)
int fdout; int fdout;
int telout; int telout;
char *buffer; char *buffer;
@ -227,7 +227,7 @@ int c;
write(fdout, buffer, size); write(fdout, buffer, size);
} }
int tel_out(fdout, buf, size) void tel_out(fdout, buf, size)
int fdout; int fdout;
char *buf; char *buf;
int size; int size;

View file

@ -16,5 +16,5 @@ void term_init(void);
void term_inout(int pty_fd); void term_inout(int pty_fd);
void tel_init(void); void tel_init(void);
void telopt(int fdout, int what, int option); void telopt(int fdout, int what, int option);
int tel_in(int fdout, int telout, char *buffer, int len); void tel_in(int fdout, int telout, char *buffer, int len);
int tel_out(int fdout, char *buf, int size); void tel_out(int fdout, char *buf, int size);

View file

@ -107,6 +107,6 @@ char *label;
{ {
char message[128]; char message[128];
sprintf(message, "telnetd: %s: %s\r\n", strerror(errno)); sprintf(message, "telnetd: %i: %s\r\n", errno, strerror(errno));
(void) write(1, message, strlen(message)); (void) write(1, message, strlen(message));
} }

View file

@ -53,7 +53,9 @@ int main(int argc, char*argv[])
int fd, i, r; int fd, i, r;
size_t psize; size_t psize;
char *pval, *param; char *pval, *param;
#ifdef __minix_vmd
struct timeval uptime; struct timeval uptime;
#endif
clock_t now; clock_t now;
int fl; int fl;
int a_flag, n_flag; int a_flag, n_flag;

View file

@ -259,7 +259,7 @@ again: if (fgets(buf, sizeof buf, in) == NULL) {
cpt--; cpt--;
} }
cpt = buf; cpt = buf;
while (c = *cpt) { while ((c = *cpt)) {
if (chtbl[c] != -1) { if (chtbl[c] != -1) {
format("uud: Duplicate char in translation table.\n"); format("uud: Duplicate char in translation table.\n");
Error(7); Error(7);
@ -300,7 +300,7 @@ void decode()
/* /*
* Get the binary line length. * Get the binary line length.
*/ */
n = trtbl[*buf]; n = trtbl[(unsigned char)*buf];
if (n >= 0) goto decod; if (n >= 0) goto decod;
/* /*
* end of uuencoded file ? * end of uuencoded file ?
@ -334,7 +334,7 @@ decod: rlen = cdlen[n];
*/ */
if (debug) { if (debug) {
for (len = 0, bp = buf; len < rlen; len++) { for (len = 0, bp = buf; len < rlen; len++) {
if (trtbl[*bp] < 0) { if (trtbl[(unsigned char)*bp] < 0) {
format( format(
"Non uuencoded char <%c>, line %d in file: %s\n", *bp, numl, ifname); "Non uuencoded char <%c>, line %d in file: %s\n", *bp, numl, ifname);
format("Bad line =%s\n",buf); format("Bad line =%s\n",buf);
@ -387,15 +387,15 @@ decod: rlen = cdlen[n];
len = n; len = n;
bp = &buf[1]; bp = &buf[1];
while (n > 0) { while (n > 0) {
*(ut++) = trtbl[*bp] << 2 | trtbl[bp[1]] >> 4; *(ut++) = trtbl[(unsigned char)*bp] << 2 | trtbl[(unsigned char)bp[1]] >> 4;
n--; n--;
if (n) { if (n) {
*(ut++) = (trtbl[bp[1]] << 4) | *(ut++) = (trtbl[(unsigned char)bp[1]] << 4) |
(trtbl[bp[2]] >> 2); (trtbl[(unsigned char)bp[2]] >> 2);
n--; n--;
} }
if (n) { if (n) {
*(ut++) = trtbl[bp[2]] << 6 | trtbl[bp[3]]; *(ut++) = trtbl[(unsigned char)bp[2]] << 6 | trtbl[(unsigned char)bp[3]];
n--; n--;
} }
bp += 4; bp += 4;

View file

@ -103,7 +103,7 @@ char *argv[];
if (lenofname > FILE_NAME) ofname[FILE_NAME] = '\0'; if (lenofname > FILE_NAME) ofname[FILE_NAME] = '\0';
strcat(ofname, ".uue"); strcat(ofname, ".uue");
lenofname = strlen(ofname); lenofname = strlen(ofname);
if (!split && (filter || (argc > 2) && (argv[2][0] == '-'))) { if (!split && (filter || ((argc > 2) && (argv[2][0] == '-')))) {
stdo = 1; stdo = 1;
outp = stdout; outp = stdout;
} else { } else {

View file

@ -27,7 +27,9 @@
#include <stdio.h> #include <stdio.h>
#include <paths.h> #include <paths.h>
#if 0
static char *Version = "@(#) WRITE 1.6 (10/24/92)"; static char *Version = "@(#) WRITE 1.6 (10/24/92)";
#endif
int otty; /* file desc of callee's terminal */ int otty; /* file desc of callee's terminal */
short int cbreak = 0; /* are we in CBREAK (-c) mode? */ short int cbreak = 0; /* are we in CBREAK (-c) mode? */
@ -129,7 +131,7 @@ void sayhello()
{ {
struct passwd *pw; struct passwd *pw;
char buff[128]; char buff[128];
long now; time_t now;
char *sp; char *sp;
time(&now); time(&now);

View file

@ -857,7 +857,7 @@ writebootimage(char *bootimage, int bootfd, int fd, int *currentsector,
exit(1); exit(1);
} }
fprintf(stderr, " * appended sector info: 0x%lx len 0x%x\n", fprintf(stderr, " * appended sector info: 0x%x len 0x%x\n",
bap[0].sector, bap[0].length); bap[0].sector, bap[0].length);
addr = buf; addr = buf;

View file

@ -41,7 +41,9 @@ char copyright[] =
#endif /* not lint */ #endif /* not lint */
#ifndef lint #ifndef lint
#if 0
static char sccsid[] = "@(#)xargs.c 5.11 (Berkeley) 6/19/91"; static char sccsid[] = "@(#)xargs.c 5.11 (Berkeley) 6/19/91";
#endif
#endif /* not lint */ #endif /* not lint */
#include <sys/types.h> #include <sys/types.h>

View file

@ -82,20 +82,20 @@ struct {
unsigned baudr; unsigned baudr;
int speedcode; int speedcode;
} speeds[] = { } speeds[] = {
110, B110, {110, B110, },
300, B300, {300, B300, },
#ifdef B600 #ifdef B600
600, B600, {600, B600, },
#endif #endif
1200, B1200, {1200, B1200, },
2400, B2400, {2400, B2400, },
4800, B4800, {4800, B4800, },
9600, B9600, {9600, B9600, },
#ifdef EXTA #ifdef EXTA
19200, EXTA, {19200, EXTA, },
38400, EXTB, {38400, EXTB, },
#endif #endif
0, {0},
}; };
int Twostop; /* Use two stop bits */ int Twostop; /* Use two stop bits */
@ -141,7 +141,7 @@ static unsigned
getspeed(code) getspeed(code)
int code; int code;
{ {
register n; register int n;
for (n=0; speeds[n].baudr; ++n) for (n=0; speeds[n].baudr; ++n)
if (speeds[n].speedcode == code) if (speeds[n].speedcode == code)
@ -174,7 +174,7 @@ int iofd = 0; /* File descriptor for ioctls & reads */
int mode(n) int mode(n)
int n; int n;
{ {
static did0 = FALSE; static int did0 = FALSE;
vfile("mode:%d", n); vfile("mode:%d", n);
switch(n) { switch(n) {

View file

@ -258,7 +258,7 @@ int argc;
char *argv[]; char *argv[];
{ {
register char *cp; register char *cp;
register npats; register int npats;
char *virgin, **patts; char *virgin, **patts;
int exitcode = 0; int exitcode = 0;
@ -419,13 +419,13 @@ int wcreceive(argc, argp)
int argc; int argc;
char **argp; char **argp;
{ {
register c; register int c;
if (Batch || argc==0) { if (Batch || argc==0) {
Crcflg=1; Crcflg=1;
if ( !Quiet) if ( !Quiet)
fprintf(stderr, rbmsg, Progname, Nozmodem?"sb":"sz"); fprintf(stderr, rbmsg, Progname, Nozmodem?"sb":"sz");
if (c=tryz()) { if ((c=tryz())) {
if (c == ZCOMPL) if (c == ZCOMPL)
return OK; return OK;
if (c == ERROR) if (c == ERROR)
@ -483,7 +483,7 @@ fubar:
int wcrxpn(rpn) int wcrxpn(rpn)
char *rpn; /* receive a pathname */ char *rpn; /* receive a pathname */
{ {
register c; register int c;
#ifdef NFGVMIN #ifdef NFGVMIN
readline(1); readline(1);
@ -571,7 +571,7 @@ int wcgetsec(rxbuf, maxtime)
char *rxbuf; char *rxbuf;
int maxtime; int maxtime;
{ {
register checksum, wcj, firstch; register int checksum, wcj, firstch;
register unsigned short oldcrc; register unsigned short oldcrc;
register char *p; register char *p;
int sectcurr; int sectcurr;
@ -671,7 +671,7 @@ humbug:
int readline(timeout) int readline(timeout)
int timeout; int timeout;
{ {
register n; register int n;
static char *cdq; /* pointer for removing chars from linbuf */ static char *cdq; /* pointer for removing chars from linbuf */
if (--Lleft >= 0) { if (--Lleft >= 0) {
@ -1133,8 +1133,8 @@ char *name;
*/ */
int tryz() int tryz()
{ {
register c, n; register int c, n;
register cmdzack1flg; register int cmdzack1flg;
if (Nozmodem) /* Check for "rb" program name */ if (Nozmodem) /* Check for "rb" program name */
return 0; return 0;
@ -1229,7 +1229,7 @@ again:
*/ */
int rzfiles() int rzfiles()
{ {
register c; register int c;
for (;;) { for (;;) {
switch (c = rzfile()) { switch (c = rzfile()) {
@ -1258,7 +1258,7 @@ int rzfiles()
*/ */
int rzfile() int rzfile()
{ {
register c, n; register int c, n;
long rxbytes; long rxbytes;
Eofseen=FALSE; Eofseen=FALSE;
@ -1439,7 +1439,7 @@ moredata:
void zmputs(s) void zmputs(s)
char *s; char *s;
{ {
register c; register int c;
while (*s) { while (*s) {
switch (c = *s++) { switch (c = *s++) {
@ -1489,7 +1489,7 @@ int closeit()
*/ */
void ackbibi() void ackbibi()
{ {
register n; register int n;
vfile("ackbibi:"); vfile("ackbibi:");
Readnum = 1; Readnum = 1;

View file

@ -284,7 +284,7 @@ int argc;
char *argv[]; char *argv[];
{ {
register char *cp; register char *cp;
register npats; register int npats;
int dm; int dm;
char **patts; char **patts;
static char xXbuf[BUFSIZ]; static char xXbuf[BUFSIZ];
@ -533,7 +533,7 @@ char *argp[];
int wcs(oname) int wcs(oname)
char *oname; char *oname;
{ {
register c; register int c;
register char *p; register char *p;
struct stat f; struct stat f;
char name[PATHLEN]; char name[PATHLEN];
@ -602,7 +602,7 @@ char *name;
if (Modem2) { if (Modem2) {
if ((in!=stdin) && *name && fstat(fileno(in), &f)!= -1) { if ((in!=stdin) && *name && fstat(fileno(in), &f)!= -1) {
fprintf(stderr, "Sending %s, %ld blocks: ", fprintf(stderr, "Sending %s, %lld blocks: ",
name, f.st_size>>7); name, f.st_size>>7);
} }
fprintf(stderr, "Give your local XMODEM receive command now.\r\n"); fprintf(stderr, "Give your local XMODEM receive command now.\r\n");
@ -637,7 +637,7 @@ char *name;
while (q < (txbuf + 1024)) while (q < (txbuf + 1024))
*q++ = 0; *q++ = 0;
if (!Ascii && (in!=stdin) && *name && fstat(fileno(in), &f)!= -1) if (!Ascii && (in!=stdin) && *name && fstat(fileno(in), &f)!= -1)
sprintf(p, "%lu %lo %o 0 %d %ld", f.st_size, f.st_mtime, sprintf(p, "%llu %o %o 0 %d %ld", f.st_size, f.st_mtime,
f.st_mode, Filesleft, Totalleft); f.st_mode, Filesleft, Totalleft);
Totalleft -= f.st_size; Totalleft -= f.st_size;
if (--Filesleft <= 0) if (--Filesleft <= 0)
@ -661,7 +661,7 @@ char *name;
int getnak() int getnak()
{ {
register firstch; register int firstch;
Lastrx = 0; Lastrx = 0;
for (;;) { for (;;) {
@ -748,7 +748,7 @@ char *buf;
int sectnum; int sectnum;
int cseclen; /* data length of this sector to send */ int cseclen; /* data length of this sector to send */
{ {
register checksum, wcj; register int checksum, wcj;
register char *cp; register char *cp;
unsigned oldcrc; unsigned oldcrc;
int firstch; int firstch;
@ -826,7 +826,7 @@ int filbuf(buf, count)
register char *buf; register char *buf;
int count; int count;
{ {
register c, m; register int c, m;
if ( !Ascii) { if ( !Ascii) {
m = read(fileno(in), buf, count); m = read(fileno(in), buf, count);
@ -1133,7 +1133,7 @@ int usage()
*/ */
int getzrxinit() int getzrxinit()
{ {
register n; register int n;
struct stat f; struct stat f;
for (n=10; --n>=0; ) { for (n=10; --n>=0; ) {
@ -1238,7 +1238,7 @@ int getzrxinit()
/* Send send-init information */ /* Send send-init information */
int sendzsinit() int sendzsinit()
{ {
register c; register int c;
if (Myattn[0] == '\0' && (!Zctlesc || (Rxflags & TESCCTL))) if (Myattn[0] == '\0' && (!Zctlesc || (Rxflags & TESCCTL)))
return OK; return OK;
@ -1270,7 +1270,7 @@ int zsendfile(buf, blen)
char *buf; char *buf;
int blen; int blen;
{ {
register c; register int c;
register UNSL long crc; register UNSL long crc;
for (;;) { for (;;) {
@ -1328,7 +1328,7 @@ again:
/* Send the data in the file */ /* Send the data in the file */
int zsendfdata() int zsendfdata()
{ {
register c, e, n; register int c, e, n;
register int newcnt; register int newcnt;
register long tcount = 0; register long tcount = 0;
int junkcount; /* Counts garbage chars received by TX */ int junkcount; /* Counts garbage chars received by TX */
@ -1611,7 +1611,7 @@ int zsendcmd(buf, blen)
char *buf; char *buf;
int blen; int blen;
{ {
register c; register int c;
long cmdnum; long cmdnum;
cmdnum = getpid(); cmdnum = getpid();
@ -1694,7 +1694,7 @@ void countem(argc, argv)
int argc; int argc;
register char **argv; register char **argv;
{ {
register c; register int c;
struct stat f; struct stat f;
for (Totalleft = 0, Filesleft = 0; --argc >=0; ++argv) { for (Totalleft = 0, Filesleft = 0; --argc >=0; ++argv) {
@ -1710,7 +1710,7 @@ register char **argv;
} }
} }
if (Verbose>2) if (Verbose>2)
fprintf(stderr, " %ld", f.st_size); fprintf(stderr, " %lld", f.st_size);
} }
if (Verbose>2) if (Verbose>2)
fprintf(stderr, "\ncountem: Total %d %ld\n", fprintf(stderr, "\ncountem: Total %d %ld\n",

View file

@ -37,8 +37,8 @@ int Crc32; /* Display flag indicating 32 bit CRC being received */
int Znulls; /* Number of nulls to send at beginning of ZDATA hdr */ int Znulls; /* Number of nulls to send at beginning of ZDATA hdr */
char Attn[ZATTNLEN+1]; /* Attention string rx sends to tx on err */ char Attn[ZATTNLEN+1]; /* Attention string rx sends to tx on err */
static lastsent; /* Last char we sent */ static int lastsent; /* Last char we sent */
static Not8bit; /* Seven bits seen on header */ static int Not8bit; /* Seven bits seen on header */
static char *frametypes[] = { static char *frametypes[] = {
"Carrier Lost", /* -3 */ "Carrier Lost", /* -3 */
@ -87,7 +87,7 @@ register char *hdr;
xsendline(ZPAD); xsendline(ZDLE); xsendline(ZPAD); xsendline(ZDLE);
if (Crc32t=Txfcs32) if ((Crc32t=Txfcs32))
zsbh32(hdr, type); zsbh32(hdr, type);
else { else {
xsendline(ZBIN); zsendline(type); crc = updcrc(type, 0); xsendline(ZBIN); zsendline(type); crc = updcrc(type, 0);
@ -240,7 +240,7 @@ crcfoo:
case GOTCRCG: case GOTCRCG:
case GOTCRCQ: case GOTCRCQ:
case GOTCRCW: case GOTCRCW:
crc = updcrc((d=c)&0377, crc); crc = updcrc((((d=c))&0377), crc);
if ((c = zdlread()) & ~0377) if ((c = zdlread()) & ~0377)
goto crcfoo; goto crcfoo;
crc = updcrc(c, crc); crc = updcrc(c, crc);

View file

@ -103,19 +103,19 @@
#define ZCACK1 1 /* Acknowledge, then do command */ #define ZCACK1 1 /* Acknowledge, then do command */
/* Globals used by ZMODEM functions */ /* Globals used by ZMODEM functions */
extern Rxframeind; /* ZBIN ZBIN32, or ZHEX type of frame received */ extern int Rxframeind; /* ZBIN ZBIN32, or ZHEX type of frame received */
extern Rxtype; /* Type of header received */ extern int Rxtype; /* Type of header received */
extern Rxcount; /* Count of data bytes received */ extern int Rxcount; /* Count of data bytes received */
extern Zrwindow; /* RX window size (controls garbage count) */ extern int Zrwindow; /* RX window size (controls garbage count) */
extern Rxtimeout; /* Tenths of seconds to wait for something */ extern int Rxtimeout; /* Tenths of seconds to wait for something */
extern char Rxhdr[4]; /* Received header */ extern char Rxhdr[4]; /* Received header */
extern char Txhdr[4]; /* Transmitted header */ extern char Txhdr[4]; /* Transmitted header */
extern long Rxpos; /* Received file position */ extern long Rxpos; /* Received file position */
extern long Txpos; /* Transmitted file position */ extern long Txpos; /* Transmitted file position */
extern Txfcs32; /* TURE means send binary frames with 32 bit FCS */ extern int Txfcs32; /* TURE means send binary frames with 32 bit FCS */
extern Crc32t; /* Display flag indicating 32 bit CRC being sent */ extern int Crc32t; /* Display flag indicating 32 bit CRC being sent */
extern Crc32; /* Display flag indicating 32 bit CRC being received */ extern int Crc32; /* Display flag indicating 32 bit CRC being received */
extern Znulls; /* Number of nulls to send at beginning of ZDATA hdr */ extern int Znulls; /* Number of nulls to send at beginning of ZDATA hdr */
extern char Attn[ZATTNLEN+1]; /* Attention string rx sends to tx on err */ extern char Attn[ZATTNLEN+1]; /* Attention string rx sends to tx on err */
/* crctab.c */ /* crctab.c */

View file

@ -8,8 +8,7 @@
__weak_alias(times, _times) __weak_alias(times, _times)
#endif #endif
clock_t times(buf) clock_t times(struct tms *buf)
struct tms *buf;
{ {
message m; message m;

View file

@ -20,8 +20,7 @@ __weak_alias(uname, _uname)
return -1; \ return -1; \
name->string[sizeof(name->string)-1]= 0; name->string[sizeof(name->string)-1]= 0;
int uname(name) int uname(struct utsname *name)
struct utsname *name;
{ {
int hf, n, err; int hf, n, err;
char *nl; char *nl;

View file

@ -8,8 +8,7 @@
__weak_alias(wait, _wait) __weak_alias(wait, _wait)
#endif #endif
pid_t wait(status) pid_t wait(int * status)
int * status;
{ {
message m; message m;

View file

@ -8,10 +8,7 @@
__weak_alias(waitpid, _waitpid) __weak_alias(waitpid, _waitpid)
#endif #endif
pid_t waitpid(pid, status, options) pid_t waitpid(pid_t pid, int *status, int options)
pid_t pid;
int *status;
int options;
{ {
message m; message m;

View file

@ -82,6 +82,7 @@ EXTERN char **env_argv;
#define PUFFS_MAX_ARGS 20 #define PUFFS_MAX_ARGS 20
int __real_main(int argc, char* argv[]); int __real_main(int argc, char* argv[]);
int __wrap_main(int argc, char* argv[]);
int __wrap_main(int argc, char *argv[]) int __wrap_main(int argc, char *argv[])
{ {

View file

@ -626,12 +626,13 @@ remdev(const char *path)
int int
rmtopen(const char *path, int oflag, ...) rmtopen(const char *path, int oflag, ...)
{ {
mode_t mode; /* LSC: MINIX This works only for int mode flags, so use the expected type. */
uint32_t mode;
int fd; int fd;
va_list ap; va_list ap;
va_start(ap, oflag); va_start(ap, oflag);
mode = va_arg(ap, mode_t); mode = va_arg(ap, uint32_t);
va_end(ap); va_end(ap);
_DIAGASSERT(path != NULL); _DIAGASSERT(path != NULL);

View file

@ -271,11 +271,11 @@ finddisk(const char *name)
const char *p; const char *p;
size_t len, dlen; size_t len, dlen;
struct diskentry *d; struct diskentry *d;
#ifndef __minix
char buf[MAXPATHLEN]; char buf[MAXPATHLEN];
struct dkwedge_info dkw; struct dkwedge_info dkw;
int fd; int fd;
#ifndef __minix
if ((fd = opendisk(name, O_RDONLY, buf, sizeof(buf), 0)) != -1) { if ((fd = opendisk(name, O_RDONLY, buf, sizeof(buf), 0)) != -1) {
if (ioctl(fd, DIOCGWEDGEINFO, &dkw) != -1) if (ioctl(fd, DIOCGWEDGEINFO, &dkw) != -1)
name = dkw.dkw_parent; name = dkw.dkw_parent;

View file

@ -183,7 +183,8 @@ void memstats(int *nodes, int *pages, int *largest)
static int findbit(int low, int startscan, int pages, int memflags, int *len) static int findbit(int low, int startscan, int pages, int memflags, int *len)
{ {
int run_length = 0, i, freerange_start; int run_length = 0, i;
int freerange_start = startscan;
for(i = startscan; i >= low; i--) { for(i = startscan; i >= low; i--) {
if(!page_isfree(i)) { if(!page_isfree(i)) {

View file

@ -278,7 +278,9 @@
#define __static_cast(x,y) (x)y #define __static_cast(x,y) (x)y
#endif #endif
#if __GNUC_PREREQ__(4, 0) /* LSC: Clang/llvm also defines GNUC_PREREQ, but it actually does not
* Support those pragma. Make sure it is not used then.*/
#if __GNUC_PREREQ__(4, 0) && !defined(__clang__)
# define __dso_public __attribute__((__visibility__("default"))) # define __dso_public __attribute__((__visibility__("default")))
# define __dso_hidden __attribute__((__visibility__("hidden"))) # define __dso_hidden __attribute__((__visibility__("hidden")))
# define __BEGIN_PUBLIC_DECLS \ # define __BEGIN_PUBLIC_DECLS \

View file

@ -66,7 +66,7 @@ __RCSID("$NetBSD: gzip.c,v 1.105 2011/08/30 23:06:00 joerg Exp $");
#include <time.h> #include <time.h>
#ifndef PRIdOFF #ifndef PRIdOFF
#define PRIdOFF PRId64 #define PRIdOFF PRId32
#endif #endif
/* what type of file are we dealing with */ /* what type of file are we dealing with */

View file

@ -84,7 +84,7 @@ struct proc {
struct proc *proc = NULL, *prev_proc = NULL; struct proc *proc = NULL, *prev_proc = NULL;
void parse_file(pid_t pid) static void parse_file(pid_t pid)
{ {
char path[PATH_MAX], name[256], type, state; char path[PATH_MAX], name[256], type, state;
int version, endpt, effuid; int version, endpt, effuid;
@ -132,7 +132,7 @@ void parse_file(pid_t pid)
p->p_endpoint = endpt; p->p_endpoint = endpt;
p->p_pid = pid; p->p_pid = pid;
if (fscanf(fp, " %255s %c %d %d %lu %*u %lu %lu", if (fscanf(fp, " %255s %c %d %d %u %*u %lu %lu",
name, &state, &p->p_blocked, &p->p_priority, name, &state, &p->p_blocked, &p->p_priority,
&p->p_user_time, &cycles_hi, &cycles_lo) != 7) { &p->p_user_time, &cycles_hi, &cycles_lo) != 7) {
@ -180,7 +180,7 @@ void parse_file(pid_t pid)
fclose(fp); fclose(fp);
} }
void parse_dir(void) static void parse_dir(void)
{ {
DIR *p_dir; DIR *p_dir;
struct dirent *p_ent; struct dirent *p_ent;
@ -202,7 +202,7 @@ void parse_dir(void)
closedir(p_dir); closedir(p_dir);
} }
void get_procs(void) static void get_procs(void)
{ {
struct proc *p; struct proc *p;
int i; int i;
@ -226,7 +226,7 @@ void get_procs(void)
parse_dir(); parse_dir();
} }
int print_memory(void) static int print_memory(void)
{ {
FILE *fp; FILE *fp;
unsigned int pagesize; unsigned int pagesize;
@ -251,7 +251,7 @@ int print_memory(void)
return 1; return 1;
} }
int print_load(double *loads, int nloads) static int print_load(double *loads, int nloads)
{ {
int i; int i;
printf("load averages: "); printf("load averages: ");
@ -261,7 +261,7 @@ int print_load(double *loads, int nloads)
return 1; return 1;
} }
int print_proc_summary(struct proc *proc) static int print_proc_summary(struct proc *proc)
{ {
int p, alive, running, sleeping; int p, alive, running, sleeping;
@ -288,7 +288,7 @@ struct tp {
u64_t ticks; u64_t ticks;
}; };
int cmp_procs(const void *v1, const void *v2) static int cmp_procs(const void *v1, const void *v2)
{ {
struct tp *p1 = (struct tp *) v1, *p2 = (struct tp *) v2; struct tp *p1 = (struct tp *) v1, *p2 = (struct tp *) v2;
int p1blocked, p2blocked; int p1blocked, p2blocked;
@ -324,7 +324,7 @@ int cmp_procs(const void *v1, const void *v2)
return (int) (p1->p - p2->p); return (int) (p1->p - p2->p);
} }
struct tp *lookup(endpoint_t who, struct tp *tptab, int np) static struct tp *lookup(endpoint_t who, struct tp *tptab, int np)
{ {
int t; int t;
@ -340,7 +340,7 @@ struct tp *lookup(endpoint_t who, struct tp *tptab, int np)
double ktotal = 0; double ktotal = 0;
void print_proc(struct tp *tp, u64_t total_ticks) static void print_proc(struct tp *tp, u64_t total_ticks)
{ {
int euid = 0; int euid = 0;
static struct passwd *who = NULL; static struct passwd *who = NULL;
@ -374,7 +374,7 @@ void print_proc(struct tp *tp, u64_t total_ticks)
printf("%6.2f%% %s", 100.0 * tp->ticks / total_ticks, name); printf("%6.2f%% %s", 100.0 * tp->ticks / total_ticks, name);
} }
char *cputimemodename(int cputimemode) static char *cputimemodename(int cputimemode)
{ {
static char name[100]; static char name[100];
int i; int i;
@ -393,7 +393,7 @@ char *cputimemodename(int cputimemode)
return name; return name;
} }
u64_t cputicks(struct proc *p1, struct proc *p2, int timemode) static u64_t cputicks(struct proc *p1, struct proc *p2, int timemode)
{ {
int i; int i;
u64_t t = 0; u64_t t = 0;
@ -410,7 +410,7 @@ u64_t cputicks(struct proc *p1, struct proc *p2, int timemode)
return t; return t;
} }
char *ordername(int orderno) static char *ordername(int orderno)
{ {
switch(orderno) { switch(orderno) {
case ORDER_CPU: return "cpu"; case ORDER_CPU: return "cpu";
@ -419,7 +419,7 @@ char *ordername(int orderno)
return "invalid order"; return "invalid order";
} }
void print_procs(int maxlines, static void print_procs(int maxlines,
struct proc *proc1, struct proc *proc2, int cputimemode) struct proc *proc1, struct proc *proc2, int cputimemode)
{ {
int p, nprocs; int p, nprocs;
@ -538,7 +538,7 @@ void print_procs(int maxlines,
} }
} }
void showtop(int cputimemode, int r) static void showtop(int cputimemode, int r)
{ {
#define NLOADS 3 #define NLOADS 3
double loads[NLOADS]; double loads[NLOADS];
@ -573,7 +573,7 @@ void showtop(int cputimemode, int r)
fflush(NULL); fflush(NULL);
} }
void init(int *rows) static void init(int *rows)
{ {
char *term; char *term;
static char buffer[TC_BUFFER], strings[TC_STRINGS]; static char buffer[TC_BUFFER], strings[TC_STRINGS];
@ -602,9 +602,9 @@ void init(int *rows)
if(*rows < 1) *rows = 24; if(*rows < 1) *rows = 24;
} }
void sigwinch(int sig) { } static void sigwinch(int sig) { }
void getkinfo(void) static void getkinfo(void)
{ {
FILE *fp; FILE *fp;

View file

@ -824,7 +824,9 @@ copy(int from_fd, char *from_name, int to_fd, char *to_name, off_t size)
{ {
ssize_t nr, nw; ssize_t nr, nw;
int serrno; int serrno;
#ifndef __minix
u_char *p; u_char *p;
#endif
u_char buf[MAXBSIZE]; u_char buf[MAXBSIZE];
MD5_CTX ctxMD5; MD5_CTX ctxMD5;
RMD160_CTX ctxRMD160; RMD160_CTX ctxRMD160;

View file

@ -37,7 +37,7 @@ extern char *optarg;
int main(int argc, char **argv); int main(int argc, char **argv);
void descend(char *dirname); void descend(char *dirname);
void display_attrib(char *name, struct stat *st); void display_attrib(const char *name, struct stat *st);
void usage(char *binname); void usage(char *binname);
void open_outfile(void); void open_outfile(void);
@ -45,7 +45,7 @@ int main(argc, argv)
int argc; int argc;
char *argv[]; char *argv[];
{ {
char *dir; char *dir = __UNCONST("");
struct stat st; struct stat st;
int op; int op;
@ -54,7 +54,7 @@ char *argv[];
prot = DEF_PROT; prot = DEF_PROT;
blocks = DEF_BLOCKS; blocks = DEF_BLOCKS;
inodes = DEF_INODES; inodes = DEF_INODES;
indentstr = DEF_INDENTSTR; indentstr = __UNCONST(DEF_INDENTSTR);
inode_given = 0; inode_given = 0;
block_given = 0; block_given = 0;
top = 0; top = 0;
@ -170,7 +170,7 @@ char *dirname;
fprintf(outfile, "\n"); fprintf(outfile, "\n");
descend(temp); descend(temp);
for (i = 0; i < tabs; i++) { for (i = 0; i < tabs; i++) {
fprintf(outfile, indentstr); fprintf(outfile, "%s", indentstr);
} }
fprintf(outfile, "$\n"); fprintf(outfile, "$\n");
continue; continue;
@ -209,7 +209,7 @@ char *dirname;
void display_attrib(name, st) void display_attrib(name, st)
char *name; const char *name;
struct stat *st; struct stat *st;
{ {
/* Output the specification for a single file */ /* Output the specification for a single file */
@ -220,7 +220,7 @@ struct stat *st;
if (same_gid) gid = st->st_gid; if (same_gid) gid = st->st_gid;
if (same_prot) if (same_prot)
prot = st->st_mode & 0777; /***** This one is a bit shady *****/ prot = st->st_mode & 0777; /***** This one is a bit shady *****/
for (i = 0; i < tabs; i++) fprintf(outfile, indentstr); for (i = 0; i < tabs; i++) fprintf(outfile, "%s", indentstr);
fprintf(outfile, "%s%s%c%c%c%3o %d %d", fprintf(outfile, "%s%s%c%c%c%3o %d %d",
name, name,
*name == '\0' ? "" : indentstr, /* stop the tab for a null name */ *name == '\0' ? "" : indentstr, /* stop the tab for a null name */

View file

@ -141,7 +141,7 @@ lchown(const char *path, uid_t owner, gid_t group)
} }
#endif #endif
int static int
utimes(const char *path, const struct timeval times[2]) utimes(const char *path, const struct timeval times[2])
{ {
return -1; return -1;
@ -151,7 +151,11 @@ utimes(const char *path, const struct timeval times[2])
int int
compare(NODE *s, FTSENT *p) compare(NODE *s, FTSENT *p)
{ {
#if defined(__minix)
u_int32_t len, val;
#else
u_int32_t len, val, flags; u_int32_t len, val, flags;
#endif /* defined(__minix) */
int fd, label; int fd, label;
const char *cp, *tab; const char *cp, *tab;
#if !defined(NO_MD5) || !defined(NO_RMD160) || !defined(NO_SHA1) || !defined(NO_SHA2) #if !defined(NO_MD5) || !defined(NO_RMD160) || !defined(NO_SHA1) || !defined(NO_SHA2)

View file

@ -317,7 +317,9 @@ statd(FTS *t, FTSENT *parent, uid_t *puid, gid_t *pgid, mode_t *pmode,
gid_t sgid; gid_t sgid;
uid_t suid; uid_t suid;
mode_t smode; mode_t smode;
#if !defined(__minix)
u_long sflags = 0; u_long sflags = 0;
#endif /* !defined(__minix) */
const char *name = NULL; const char *name = NULL;
gid_t savegid; gid_t savegid;
uid_t saveuid; uid_t saveuid;

View file

@ -168,7 +168,9 @@ miss(NODE *p, char *tail)
int create; int create;
char *tp; char *tp;
const char *type; const char *type;
#if !defined(__minix)
u_int32_t flags; u_int32_t flags;
#endif /* !defined(__minix) */
for (; p; p = p->next) { for (; p; p = p->next) {
if (p->flags & F_OPT && !(p->flags & F_VISIT)) if (p->flags & F_OPT && !(p->flags & F_VISIT))