From: Ben Gras Date: Tue, 6 Jul 2010 12:10:23 +0000 (+0000) Subject: commands: fixes for clang errors. X-Git-Tag: v3.1.8~275 X-Git-Url: http://zhaoyanbai.com/repos/doc/mandoc_char.7.html?a=commitdiff_plain;h=e698d818c66311adc5959371358d11cc643c7e8f;p=minix.git commands: fixes for clang errors. --- diff --git a/commands/cp/cp.c b/commands/cp/cp.c index 71e191c19..1db5f61cc 100644 --- a/commands/cp/cp.c +++ b/commands/cp/cp.c @@ -1196,7 +1196,7 @@ void usage(void) exit(1); } -void main(int argc, char **argv) +int main(int argc, char **argv) { int i; char *flags; @@ -1377,4 +1377,5 @@ void main(int argc, char **argv) } #endif exit(ex_code); + return ex_code; } diff --git a/commands/de/de.c b/commands/de/de.c index 3c6f98abe..96e1708dd 100644 --- a/commands/de/de.c +++ b/commands/de/de.c @@ -55,7 +55,7 @@ _PROTOTYPE(void Sigint , (int)); /****************************************************************/ -void main( argc, argv ) +int main( argc, argv ) int argc; char *argv[]; diff --git a/commands/de/de.h b/commands/de/de.h index 7a0245da9..ceec8b8b8 100644 --- a/commands/de/de.h +++ b/commands/de/de.h @@ -276,7 +276,7 @@ typedef struct de_state /* State of disk ed. */ /* de.c */ -_PROTOTYPE(void main , (int argc , char *argv [])); +_PROTOTYPE(int main , (int argc , char *argv [])); _PROTOTYPE(int Process , (de_state *s , int c )); #if __STDC__ diff --git a/commands/dis88/dis.h b/commands/dis88/dis.h index d8fc245f1..48e008948 100644 --- a/commands/dis88/dis.h +++ b/commands/dis88/dis.h @@ -157,7 +157,7 @@ _PROTOTYPE(void mahand, (int j )); _PROTOTYPE(void mjhand, (int j )); /* dismain.c */ -_PROTOTYPE(void main, (int argc, char **argv )); +_PROTOTYPE(int main, (int argc, char **argv )); /* distabs.c */ _PROTOTYPE(char *getnam, (int k )); diff --git a/commands/dis88/dismain.c b/commands/dis88/dismain.c index d317f0062..7770dc801 100644 --- a/commands/dis88/dismain.c +++ b/commands/dis88/dismain.c @@ -495,11 +495,11 @@ static void disbss() * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ -void +int main(argc,argv) int argc; /* Command-line args from OS */ - register char **argv; + char **argv; {/* * * * * * * * * * * START OF main() * * * * * * * * * * */ diff --git a/commands/eject/eject.c b/commands/eject/eject.c index 7bce8cd55..f0821296c 100644 --- a/commands/eject/eject.c +++ b/commands/eject/eject.c @@ -16,7 +16,7 @@ void fatal(char *label) exit(1); } -void main(int argc, char **argv) +int main(int argc, char **argv) { char *device; int fd; diff --git a/commands/elle/eediag.c b/commands/elle/eediag.c index 1b7b3da64..64ecca159 100644 --- a/commands/elle/eediag.c +++ b/commands/elle/eediag.c @@ -38,11 +38,10 @@ vfy_data(flag) /* Flag = 0 for quiet check */ int flag; { register char *res, *mess; - char *sbe_mvfy(), *sbe_sbvfy(), *sbe_svfy(); - if(res = sbe_mvfy(0)) mess = "Mem mgt"; - else if(res = sbe_sbvfy(cur_buf,0)) mess = "SBBUF"; - else if(res = sbe_svfy(0)) mess = "SD list"; + if(res = sbe_mvfy()) mess = "Mem mgt"; + else if(res = sbe_sbvfy(cur_buf)) mess = "SBBUF"; + else if(res = sbe_svfy()) mess = "SD list"; else return(0); /* Success */ if(flag) diff --git a/commands/elvis/curses.c b/commands/elvis/curses.c index e4b305bed..fcfc7d8c5 100644 --- a/commands/elvis/curses.c +++ b/commands/elvis/curses.c @@ -442,6 +442,7 @@ static void pair(T, U, sT, sU) } +void getsize(int signo); /* Read everything from termcap */ static void starttcap(term) diff --git a/commands/elvis/main.c b/commands/elvis/main.c index 68ed2e672..269d35196 100644 --- a/commands/elvis/main.c +++ b/commands/elvis/main.c @@ -38,7 +38,7 @@ main (argc, argv) # include "vmswild.c" main (argc, argv) # else -void main(argc, argv) +int main(argc, argv) # endif #endif int argc; diff --git a/commands/hostaddr/hostaddr.c b/commands/hostaddr/hostaddr.c index 989f36603..f463a1628 100644 --- a/commands/hostaddr/hostaddr.c +++ b/commands/hostaddr/hostaddr.c @@ -36,10 +36,10 @@ char *prog_name; char DHCPCACHE[]=_PATH_DHCPCACHE; -void main _ARGS(( int argc, char *argv[] )); +int main _ARGS(( int argc, char *argv[] )); void usage _ARGS(( void )); -void main(argc, argv) +int main(argc, argv) int argc; char *argv[]; { diff --git a/commands/indent/indent.c b/commands/indent/indent.c index b7b4a3e4e..2c36d5775 100644 --- a/commands/indent/indent.c +++ b/commands/indent/indent.c @@ -42,7 +42,7 @@ char *out_name = "Standard Output"; /* will always point to name of output file */ char bakfile[60]; -void main(argc, argv) +int main(argc, argv) int argc; char **argv; { diff --git a/commands/indent/proto.h b/commands/indent/proto.h index 4aaa2d1a4..75c450999 100644 --- a/commands/indent/proto.h +++ b/commands/indent/proto.h @@ -7,7 +7,7 @@ _PROTOTYPE( int eqin, (char *s1,char *s2) ); _PROTOTYPE( void set_defaults, (void ) ); _PROTOTYPE( void set_option, (char *arg) ); _PROTOTYPE( void pr_comment, (void ) ); -_PROTOTYPE( void main, (int argc,char * *argv) ); +_PROTOTYPE( int main, (int argc,char * *argv) ); _PROTOTYPE( void bakcopy, (void ) ); _PROTOTYPE( void dump_line, (void ) ); _PROTOTYPE( int code_target, (void ) ); diff --git a/commands/install/install.c b/commands/install/install.c index ab9ac2d1a..45483485c 100644 --- a/commands/install/install.c +++ b/commands/install/install.c @@ -432,7 +432,7 @@ Usage:\n\ exit(1); } -void main(int argc, char **argv) +int main(int argc, char **argv) { int i= 1; int mode= -1; /* Mode of target. */ diff --git a/commands/join/join.c b/commands/join/join.c index 0efbefc0e..49a01482a 100644 --- a/commands/join/join.c +++ b/commands/join/join.c @@ -11,7 +11,7 @@ #define MAXFLD 200 /* maximum # of fields to accept */ -_PROTOTYPE(void main, (int argc, char **argv)); +_PROTOTYPE(int main, (int argc, char **argv)); _PROTOTYPE(void error, (char *s, char *t)); _PROTOTYPE(void usage, (void)); _PROTOTYPE(void match, (void)); @@ -58,7 +58,7 @@ char *es; /* s for '-e s' */ char sep; /* c for -tc: filed separator */ char *cmd; /* name of this program */ -void main(argc, argv) +int main(argc, argv) int argc; char **argv; { diff --git a/commands/mdb/mdb.c b/commands/mdb/mdb.c index 47006109a..3a0f58e2d 100644 --- a/commands/mdb/mdb.c +++ b/commands/mdb/mdb.c @@ -73,7 +73,7 @@ struct b_pnt { char cmd[1]; } *b_head, *curpnt; -_PROTOTYPE( void main , (int argc, char *argv[])); +_PROTOTYPE( int main , (int argc, char *argv[])); FORWARD _PROTOTYPE( void cleanup , (void)); FORWARD _PROTOTYPE( void freepnt , (struct b_pnt *pnt )); @@ -863,7 +863,7 @@ char *s; longjmp(mainlp, 0); } -PUBLIC void main(argc, argv) +PUBLIC int main(argc, argv) int argc; char *argv[]; { diff --git a/commands/mined/mined.h b/commands/mined/mined.h index 5d076fe8f..9defcd9c4 100644 --- a/commands/mined/mined.h +++ b/commands/mined/mined.h @@ -280,7 +280,7 @@ _PROTOTYPE(char *basename, (char *path )); _PROTOTYPE(void load_file, (char *file )); _PROTOTYPE(int get_line, (int fd, char *buffer )); _PROTOTYPE(LINE *install_line, (char *buffer, int length )); -_PROTOTYPE(void main, (int argc, char *argv [])); +_PROTOTYPE(int main, (int argc, char *argv [])); _PROTOTYPE(void RD, (void)); _PROTOTYPE(void I, (void)); _PROTOTYPE(void XT, (void)); diff --git a/commands/mined/mined1.c b/commands/mined/mined1.c index b72e70e37..b4ed0ac49 100644 --- a/commands/mined/mined1.c +++ b/commands/mined/mined1.c @@ -1421,7 +1421,7 @@ int length; return new_line; } -void main(argc, argv) +int main(argc, argv) int argc; char *argv[]; { diff --git a/commands/playwave/playwave.c b/commands/playwave/playwave.c index 13c81e2c8..4d073e77e 100644 --- a/commands/playwave/playwave.c +++ b/commands/playwave/playwave.c @@ -17,7 +17,7 @@ #include #include -_PROTOTYPE( void main, (int argc, char **argv)); +_PROTOTYPE( int main, (int argc, char **argv)); _PROTOTYPE( void usage, (void)); /******* Wave format definitions *********/ @@ -67,7 +67,7 @@ void usage() } -void main ( int argc, char *argv[] ) +int main ( int argc, char *argv[] ) { int i, r, audio, file; char *buffer, *file_name; diff --git a/commands/recwave/recwave.c b/commands/recwave/recwave.c index c143dad47..d93690a04 100644 --- a/commands/recwave/recwave.c +++ b/commands/recwave/recwave.c @@ -19,7 +19,7 @@ #include #include -_PROTOTYPE (void main, (int argc, char **argv)); +_PROTOTYPE (int main, (int argc, char **argv)); _PROTOTYPE (void usage, (void)); _PROTOTYPE ( void write_wave_header, (void)); _PROTOTYPE ( void terminate, (int s)); @@ -124,7 +124,7 @@ void write_wave_header() } -void main(argc, argv) +int main(argc, argv) int argc; char **argv; { diff --git a/commands/rsh/rsh.c b/commands/rsh/rsh.c index ccb5b1d3e..d4bf6f44e 100644 --- a/commands/rsh/rsh.c +++ b/commands/rsh/rsh.c @@ -59,7 +59,7 @@ static char sccsid[] = "@(#)rsh.c 5.24 (Berkeley) 7/1/91"; #include #include -void main _ARGS(( int argc, char *argv[] )); +int main _ARGS(( int argc, char *argv[] )); void usage _ARGS(( void )); char *copyargs _ARGS(( char **argv )); void sendsig _ARGS(( int signo )); @@ -103,7 +103,7 @@ extern char *krb_realmofhost(); extern int errno; int rfd2; -void +int main(argc, argv) int argc; char **argv; diff --git a/commands/screendump/screendump.c b/commands/screendump/screendump.c index 96cc2ae52..a9c34373c 100644 --- a/commands/screendump/screendump.c +++ b/commands/screendump/screendump.c @@ -63,7 +63,7 @@ long video_base(void) return bios_crtbase == CRTBASE_MONO ? MONO_BASE : COLOR_BASE; } -void main(void) +int main(void) { static unsigned char screen[MAX_COLS * MAX_ROWS * 2]; unsigned char *ps; diff --git a/commands/stty/stty.c b/commands/stty/stty.c index c8dda55d3..95135eaa4 100644 --- a/commands/stty/stty.c +++ b/commands/stty/stty.c @@ -95,7 +95,7 @@ struct winsize winsize; #define PROTO(a) () #endif -void main PROTO(( int argc, char **argv )); +int main PROTO(( int argc, char **argv )); void report PROTO(( int flags )); int option PROTO(( char *opt, char *next )); int match PROTO(( char *s1, char *s2 )); @@ -114,7 +114,7 @@ void set_min_tim PROTO(( int option, char *value )); #define print_char(c,d,n,a) (do_print_char((unsigned)(c),(unsigned)(d),(n),(a))) #define print_num(m,d,n,a) (do_print_num((unsigned)(m),(unsigned)(d),(n),(a))) -void main(argc, argv) +int main(argc, argv) int argc; char *argv[]; { diff --git a/commands/tget/tget.c b/commands/tget/tget.c index b98fc28a8..e09009b20 100644 --- a/commands/tget/tget.c +++ b/commands/tget/tget.c @@ -20,7 +20,7 @@ void usage(void) exit(-1); } -void main(int argc, char **argv) +int main(int argc, char **argv) { char termbuf[1024]; char string[256], *pstr; diff --git a/commands/top/top.c b/commands/top/top.c index fa19dc665..b4db5bce8 100644 --- a/commands/top/top.c +++ b/commands/top/top.c @@ -200,7 +200,7 @@ void print_proc(struct tp *tp, struct mproc *mpr, u32_t tcyc) pr->p_memmap[D].mem_len) << CLICK_SHIFT)/1024); printf("%6s", pr->p_rts_flags ? "" : "RUN"); ticks = pr->p_user_time; - printf(" %3d:%02d ", (ticks/system_hz/60), (ticks/system_hz)%60); + printf(" %3ld:%02ld ", (ticks/system_hz/60), (ticks/system_hz)%60); pcyc = div64u(tp->ticks, SCALE);