From: Nathan Neulinger Date: Sat, 14 Apr 2001 18:49:51 +0000 (+0000) Subject: warning-cleanup-20010414 X-Git-Tag: openafs-stable-1_1_0~205 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=1e9fc5888fba84db985ca4263a668653c8496a7e;p=packages%2Fo%2Fopenafs.git warning-cleanup-20010414 cleanup based on complaints for gcc -Wall --- diff --git a/src/cmd/cmd.c b/src/cmd/cmd.c index 253586972..934bba8e8 100644 --- a/src/cmd/cmd.c +++ b/src/cmd/cmd.c @@ -223,7 +223,7 @@ register struct cmd_syndesc *as; { } } -static AproposProc(as, arock) +static int AproposProc(as, arock) char *arock; register struct cmd_syndesc *as; { register struct cmd_syndesc *ts; @@ -249,7 +249,7 @@ register struct cmd_syndesc *as; { return 0; } -static HelpProc(as, arock) +static int HelpProc(as, arock) char *arock; register struct cmd_syndesc *as; { register struct cmd_syndesc *ts; @@ -294,7 +294,7 @@ register struct cmd_syndesc *as; { return(code); } -cmd_SetBeforeProc(aproc, arock) +int cmd_SetBeforeProc(aproc, arock) int (*aproc)(); char *arock; { beforeProc = aproc; @@ -302,7 +302,7 @@ char *arock; { return 0; } -cmd_SetAfterProc(aproc, arock) +int cmd_SetAfterProc(aproc, arock) int (*aproc)(); char *arock; { afterProc = aproc; @@ -311,7 +311,7 @@ char *arock; { } /* thread on list in alphabetical order */ -static SortSyntax(as) +static int SortSyntax(as) struct cmd_syndesc *as; { register struct cmd_syndesc **ld, *ud; @@ -440,7 +440,7 @@ afs_int32 aflags;{ } /* add a text item to the end of the parameter list */ -static AddItem(aparm, aval) +static int AddItem(aparm, aval) register struct cmd_parmdesc *aparm; register char *aval; { register struct cmd_item *ti, *ni; @@ -450,7 +450,7 @@ register char *aval; { assert(ti->data); strcpy(ti->data, aval); /* now put ti at the *end* of the list */ - if (ni=aparm->items) { + if ((ni=aparm->items)) { for(;ni;ni=ni->next) if (ni->next == 0) break; /* skip to last one */ ni->next = ti; } @@ -459,7 +459,7 @@ register char *aval; { } /* skip to next non-flag item, if any */ -static AdvanceType(as, aval) +static int AdvanceType(as, aval) register afs_int32 aval; register struct cmd_syndesc *as; { register afs_int32 next; @@ -504,7 +504,7 @@ register struct cmd_syndesc *as; { } /* move the expands flag to the last one in the list */ -static SetupExpandsFlag(as) +static int SetupExpandsFlag(as) register struct cmd_syndesc *as; { register struct cmd_parmdesc *tp; register int last, i; @@ -563,7 +563,7 @@ char **aargv; } /*InsertInitOpcode*/ -static NoParmsOK(as) +static int NoParmsOK(as) register struct cmd_syndesc *as; { register int i; register struct cmd_parmdesc *td; @@ -580,7 +580,7 @@ register struct cmd_syndesc *as; { } /* Call the appropriate function, or return syntax error code. Note: if no opcode is specified, an initialization routine exists, and it has NOT been called before, we invoke the special initialization opcode*/ -cmd_Dispatch(argc, argv) +int cmd_Dispatch(argc, argv) int argc; char **argv; { @@ -831,7 +831,7 @@ char **argv; } /* free token list returned by parseLine */ -static FreeTokens(alist) +static int FreeTokens(alist) register struct cmd_token *alist; { register struct cmd_token *nlist; for(; alist; alist = nlist) { @@ -843,7 +843,7 @@ static FreeTokens(alist) } /* free an argv list returned by parseline */ -cmd_FreeArgv(argv) +int cmd_FreeArgv(argv) register char **argv; { register char *tp; for(tp = *argv; tp; argv++, tp = *argv) @@ -855,7 +855,7 @@ register char **argv; { data is still malloc'd, and will be freed when the caller calls cmd_FreeArgv later on */ #define INITSTR "" -static CopyBackArgs(alist, argv, an, amaxn) +static int CopyBackArgs(alist, argv, an, amaxn) register struct cmd_token *alist; register char **argv; afs_int32 amaxn; @@ -887,25 +887,25 @@ afs_int32 *an; { return 0; } -static quote(x) +static int quote(x) register int x; { if (x == '"' || x == 39 /* single quote */) return 1; else return 0; } -static space(x) +static int space(x) register int x; { if (x == 0 || x == ' ' || x == '\t' || x== '\n') return 1; else return 0; } -cmd_ParseLine(aline, argv, an, amaxn) +int cmd_ParseLine(aline, argv, an, amaxn) char **argv; afs_int32 *an; afs_int32 amaxn; char *aline; { char tbuffer[256]; - register char *tptr; + register char *tptr = 0; int inToken, inQuote; struct cmd_token *first, *last; register struct cmd_token *ttok; @@ -920,7 +920,10 @@ char *aline; { if (tc == 0 || (!inQuote && space(tc))) { /* terminating null gets us in here, too */ if (inToken) { inToken = 0; /* end of this token */ - *tptr++ = 0; + if ( !tptr ) + return -1; /* should never get here */ + else + *tptr++ = 0; ttok = (struct cmd_token *) malloc(sizeof(struct cmd_token)); assert(ttok); ttok->next = (struct cmd_token *) 0; diff --git a/src/cmd/cmd.p.h b/src/cmd/cmd.p.h index a4a77bff2..8595d8e67 100644 --- a/src/cmd/cmd.p.h +++ b/src/cmd/cmd.p.h @@ -66,12 +66,12 @@ extern struct cmd_syndesc *cmd_CreateSyntax( char *helpp ); -extern cmd_SetBeforeProc( +extern int cmd_SetBeforeProc( int (*aproc)(), char *arock ); -extern cmd_SetAfterProc( +extern int cmd_SetAfterProc( int (*aproc)(), char *arock ); @@ -94,16 +94,16 @@ extern int cmd_AddParm( char *ahelp ); -extern cmd_Dispatch( +extern int cmd_Dispatch( int argc, char **argv ); -extern cmd_FreeArgv( +extern int cmd_FreeArgv( char **argv ); -extern cmd_ParseLine( +extern int cmd_ParseLine( char *aline, char **argv, afs_int32 *an, diff --git a/src/config/config.c b/src/config/config.c index c29bd71bf..46f4610a1 100644 --- a/src/config/config.c +++ b/src/config/config.c @@ -16,9 +16,10 @@ #include "AFS_component_version_number.c" -main(argc, argv) -int argc; -char **argv; { +/* prototypes */ +int mc_copy(FILE *, FILE *, char **); + +int main(int argc, char **argv) { register FILE *infile; register FILE *outfile; char *alist[3]; diff --git a/src/config/mc.c b/src/config/mc.c index 4df628338..ac1dba55f 100644 --- a/src/config/mc.c +++ b/src/config/mc.c @@ -13,10 +13,7 @@ #include #include #include - -#if defined(__alpha) -extern void *malloc(int size); -#endif +#include #define TOK_DONTUSE 1 /* Don't copy if match and this flag is set. */ struct token { @@ -26,7 +23,7 @@ struct token { }; /* free token list returned by parseLine */ -static FreeTokens(alist) +static int FreeTokens(alist) register struct token *alist; { register struct token *nlist; for(; alist; alist = nlist) { @@ -38,11 +35,11 @@ static FreeTokens(alist) } #define space(x) ((x) == ' ' || (x) == '\t' || (x) == '<' || (x) == '>') -static ParseLine(aline, alist) +static int ParseLine(aline, alist) char *aline; struct token **alist; { char tbuffer[MAXTOKLEN+1]; - register char *tptr; + register char *tptr = NULL; int inToken; struct token *first, *last; register struct token *ttok; @@ -57,7 +54,10 @@ static ParseLine(aline, alist) if (tc == 0 || space(tc)) { /* terminating null gets us in here, too */ if (inToken) { inToken = 0; /* end of this token */ - *tptr++ = 0; + if ( !tptr ) + return -1; /* should never get here */ + else + *tptr++ = 0; ttok = (struct token *) malloc(sizeof(struct token)); ttok->next = (struct token *) 0; if (dontUse) { @@ -101,7 +101,7 @@ static ParseLine(aline, alist) } /* read a line into a buffer, putting in null termination and stopping on appropriate end of line char. Returns 0 at eof, > 0 at normal line end, and < 0 on error */ -static GetLine(afile, abuffer, amax) +static int GetLine(afile, abuffer, amax) FILE *afile; int amax; register char *abuffer; { @@ -124,7 +124,8 @@ static GetLine(afile, abuffer, amax) } } } -mc_copy(ain, aout, alist) + +int mc_copy(ain, aout, alist) register FILE *ain; register FILE *aout; char *alist[]; { diff --git a/src/des/cbc_encrypt.c b/src/des/cbc_encrypt.c index e6bbe41ba..7b52e5144 100644 --- a/src/des/cbc_encrypt.c +++ b/src/des/cbc_encrypt.c @@ -26,6 +26,7 @@ extern int des_debug; extern int des_debug_print(); +extern int des_ecb_encrypt(); /* * This routine performs DES cipher-block-chaining operation, either diff --git a/src/des/cksum.c b/src/des/cksum.c index fd8045212..e85add710 100644 --- a/src/des/cksum.c +++ b/src/des/cksum.c @@ -33,6 +33,7 @@ extern int des_debug; extern int des_debug_print(); +extern int des_ecb_encrypt(); /* * This routine performs DES cipher-block-chaining checksum operation, diff --git a/src/des/des.c b/src/des/des.c index e8e443856..0e2b020c6 100644 --- a/src/des/des.c +++ b/src/des/des.c @@ -58,8 +58,9 @@ #endif extern int des_debug; -extern des_cblock_print_file (); -extern des_debug_print (); +extern int des_cblock_print_file (); +extern int des_debug_print (); +extern int swap_long_bytes_bit_number(int); #ifdef AFS_PTHREAD_ENV pthread_mutex_t rxkad_stats_mutex; diff --git a/src/des/key_sched.c b/src/des/key_sched.c index 65fd76ea0..47717cafd 100644 --- a/src/des/key_sched.c +++ b/src/des/key_sched.c @@ -36,12 +36,15 @@ #include "stats.h" extern int des_debug; -extern rev_swap_bit_pos_0(); +extern int rev_swap_bit_pos_0(); +extern int des_check_key_parity(des_cblock); +extern int des_is_weak_key(des_cblock); typedef char key[64]; /* the following are really void but cc86 doesnt allow it */ static int make_key_sched(); + #ifdef AFS_DUX40_ENV #pragma weak des_key_sched = afs_des_key_sched int afs_des_key_sched(k,schedule) @@ -246,4 +249,6 @@ make_key_sched(Key,Schedule) fprintf(stderr,"\n"); } #endif + + return(0); } diff --git a/src/des/make_fp.c b/src/des/make_fp.c index 336bdb429..c11e55687 100644 --- a/src/des/make_fp.c +++ b/src/des/make_fp.c @@ -11,10 +11,13 @@ #include #include #include "des_internal.h" + +#define WANT_FP_TABLE #include "tables.h" extern unsigned int swap_bit_pos_0_to_ansi PROTOTYPE((unsigned int)); extern afs_int32 swap_long_bytes(); +extern afs_int32 swap_long_bytes_bit_number(); extern void test_set PROTOTYPE((FILE *, char const *, int, char const *, int)); diff --git a/src/des/make_ip.c b/src/des/make_ip.c index 2a8b6bc91..3c5de48de 100644 --- a/src/des/make_ip.c +++ b/src/des/make_ip.c @@ -11,10 +11,16 @@ #include #include #include "des_internal.h" + +#define WANT_IP_TABLE #include "tables.h" extern afs_int32 swap_bit_pos_0(); extern afs_int32 rev_swap_bit_pos_0(); +extern void test_set PROTOTYPE((FILE *, char const *, int, + char const *, int)); +extern int swap_long_bytes_bit_number(int); +extern int swap_bit_pos_0_to_ansi(int); #define SWAP(x) swap_long_bytes_bit_number(swap_bit_pos_0_to_ansi(x)) diff --git a/src/des/make_keyperm.c b/src/des/make_keyperm.c index cf25d38cb..60791fced 100644 --- a/src/des/make_keyperm.c +++ b/src/des/make_keyperm.c @@ -186,9 +186,10 @@ void gen(stream) } /* now output the resulting key permutation */ - fprintf(stream, " /* ks permutation iteration = %2d */", + fprintf(stream, "\n /* ks permutation iteration = %2d */", iter); for (i = 1; i <= 6; i++) { + if ( i == 1 ) fprintf(stream, "\n {"); fprintf(stream, "\n "); for (j = 1; j <= 8; j++) { /* @@ -197,11 +198,16 @@ void gen(stream) */ fprintf(stream, "%d", ks_perm[iter][(i-1)*8+j]-1); /* omit last comma */ - if ((j != 8) || (i != 6) || (iter != 16)) { + if ((j != 8) || (i != 6)) { fprintf(stream,", "); } } } + if ( iter != 16) { + fprintf(stream, "\n }, "); + } else { + fprintf(stream, "\n }"); + } } fprintf(stream,"\n};\n"); } diff --git a/src/des/make_p_table.c b/src/des/make_p_table.c index 9e40687b2..d2248ffd3 100644 --- a/src/des/make_p_table.c +++ b/src/des/make_p_table.c @@ -9,6 +9,8 @@ #include #include #include "des_internal.h" + +#define WANT_P_TABLE #include "tables.h" extern afs_uint32 swap_byte_bits(); @@ -25,7 +27,7 @@ void gen(stream) #ifdef BIG /* flip p into p_temp */ for (i = 0; i<32; i++) - P_temp[P[rev_swap_bit_pos_0(i)]] = rev_swap_bit_pos_0(i); + P_temp[(int) P[rev_swap_bit_pos_0(i)]] = rev_swap_bit_pos_0(i); /* * now for each byte of input, figure out all possible combinations @@ -47,11 +49,13 @@ void gen(stream) fprintf(stream, "\n\tstatic afs_uint32 const P_prime[4][256] = {\n\t"); for (i = 0; i < 4; i++) { - fprintf(stream,"\n"); + fprintf(stream,"\n{ "); for (j = 0; j < 64; j++) { fprintf(stream,"\n"); for (k = 0; k < 4; k++) { fprintf(stream,"0x%08X",P_prime[i][j*4+k]); + if ((j == 63) && (k == 3)) + fprintf(stream, "}"); if ((i == 3) && (j == 63) && (k == 3)) fprintf(stream,"\n};"); else diff --git a/src/des/make_s_table.c b/src/des/make_s_table.c index e28f859e3..3dfe74b49 100644 --- a/src/des/make_s_table.c +++ b/src/des/make_s_table.c @@ -8,6 +8,8 @@ #include #include #include "des_internal.h" + +#define WANT_S_TABLE #include "tables.h" extern afs_uint32 swap_bit_pos_0(); @@ -51,12 +53,16 @@ void gen(stream) } for (i = 0; i<=7; i++) { - fprintf(stream,"\n"); + fprintf(stream,"\n{ "); k =0; for (j = 0; j<= 3; j++) { fprintf(stream,"\n"); for (m = 0; m <= 15; m++) { fprintf(stream,"%2d",temp[i][k]); + if (k==63) + { + fprintf(stream,"\n}"); + } if ((k++ != 63) || (i !=7)) { fprintf(stream,", "); } diff --git a/src/des/misc.c b/src/des/misc.c index d3ab60e61..10f2d82b7 100644 --- a/src/des/misc.c +++ b/src/des/misc.c @@ -238,7 +238,7 @@ afs_uint32 swap_byte_bits(x) #endif /* LSBFIRST */ } -swap_long_bytes_bit_number(x) +int swap_long_bytes_bit_number(x) afs_uint32 x; { /* @@ -290,7 +290,7 @@ char const *whoami; #include "AFS_component_version_number.c" -main(argc, argv) +int main(argc, argv) int argc; char *argv[]; { diff --git a/src/des/new_rnd_key.c b/src/des/new_rnd_key.c index 88536e21b..b4206267b 100644 --- a/src/des/new_rnd_key.c +++ b/src/des/new_rnd_key.c @@ -19,12 +19,15 @@ #ifdef AFS_PTHREAD_ENV #include #endif +#include #include #include "des_internal.h" #include "stats.h" extern void des_fixup_key_parity(); extern int des_is_weak_key(); +extern int des_ecb_encrypt(); +extern int des_key_sched(); void des_set_random_generator_seed(); static afs_int32 des_set_sequence_number(des_cblock new_sequence_number); @@ -103,6 +106,7 @@ des_random_key(key) #include #else #include +#include #endif void des_init_random_number_generator(key) diff --git a/src/des/pcbc_encrypt.c b/src/des/pcbc_encrypt.c index 32cec6b27..79b0eceec 100644 --- a/src/des/pcbc_encrypt.c +++ b/src/des/pcbc_encrypt.c @@ -30,6 +30,7 @@ extern int des_debug; extern int des_debug_print(); +extern int des_ecb_encrypt(); /* * pcbc_encrypt is an "error propagation chaining" encrypt operation diff --git a/src/des/read_pssword.c b/src/des/read_pssword.c index ef619446b..4fd9e8175 100644 --- a/src/des/read_pssword.c +++ b/src/des/read_pssword.c @@ -38,6 +38,7 @@ #if defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) || defined(AFS_FBSD_ENV) #include +#include #endif #ifdef AFS_HPUX_ENV @@ -76,9 +77,11 @@ typedef int sigtype; #endif static sigtype sig_restore(); static push_signals(), pop_signals(); -int des_read_pw_string(); #endif +int des_read_pw_string(char *, int, char *, int); +int des_string_to_key(char *, des_cblock *); + /*** Routines ****************************************************** */ int des_read_password(k,prompt,verify) @@ -100,7 +103,9 @@ des_read_password(k,prompt,verify) if (ok == 0) des_string_to_key(key_string, k); +#ifdef BSDUNIX lose: +#endif bzero(key_string, sizeof (key_string)); return ok; } @@ -297,7 +302,9 @@ des_read_pw_string(s,maxa,prompt,verify) ok = 1; } +#ifdef BSDUNIX lose: +#endif if (!ok) bzero(s, maxa); printf("\n"); diff --git a/src/des/strng_to_key.c b/src/des/strng_to_key.c index 253cb9679..d821e1696 100644 --- a/src/des/strng_to_key.c +++ b/src/des/strng_to_key.c @@ -22,6 +22,7 @@ #include #include +#include #include #include #include "des_internal.h" @@ -31,10 +32,13 @@ extern int des_debug_print(); extern void des_fixup_key_parity(); extern afs_uint32 des_cbc_cksum(); +/* prototypes */ +int des_key_sched(register des_cblock *k, des_key_schedule schedule); + /* * convert an arbitrary length string to a DES key */ -int +void des_string_to_key(str,key) char *str; register des_cblock *key; diff --git a/src/des/tables.h b/src/des/tables.h index b3c01398e..dac5ff7cd 100644 --- a/src/des/tables.h +++ b/src/des/tables.h @@ -12,6 +12,7 @@ /* * Initial permutation, adjust to zero based subscript */ +#ifdef WANT_IP_TABLE static char IP[] = { 58-1, 50-1, 42-1, 34-1, 26-1, 18-1, 10-1, 2-1, 60-1, 52-1, 44-1, 36-1, 28-1, 20-1, 12-1, 4-1, @@ -22,10 +23,12 @@ static char IP[] = { 61-1, 53-1, 45-1, 37-1, 29-1, 21-1, 13-1, 5-1, 63-1, 55-1, 47-1, 39-1, 31-1, 23-1, 15-1, 7-1, }; +#endif /* * Final permutation, FP = IP^(-1) adjust to zero based subscript */ +#ifdef WANT_FP_TABLE static char FP[] = { 40-1, 8-1, 48-1, 16-1, 56-1, 24-1, 64-1, 32-1, 39-1, 7-1, 47-1, 15-1, 55-1, 23-1, 63-1, 31-1, @@ -36,8 +39,10 @@ static char FP[] = { 34-1, 2-1, 42-1, 10-1, 50-1, 18-1, 58-1, 26-1, 33-1, 1-1, 41-1, 9-1, 49-1, 17-1, 57-1, 25-1, }; +#endif /* the E selection function, adjusted to zero based subscripts */ +#ifdef WANT_E_TABLE static char E[] = { 32-1, 1-1, 2-1, 3-1, 4-1, 5-1, 4-1, 5-1, 6-1, 7-1, 8-1, 9-1, @@ -48,8 +53,10 @@ static char E[] = { 24-1, 25-1, 26-1, 27-1, 28-1, 29-1, 28-1, 29-1, 30-1, 31-1, 32-1, 1-1, }; +#endif /* the P permutation, adjusted to zero based subscripts */ +#ifdef WANT_P_TABLE static char P[] = { 16-1, 7-1, 20-1, 21-1, 29-1, 12-1, 28-1, 17-1, @@ -60,46 +67,49 @@ static char P[] = { 19-1, 13-1, 30-1, 6-1, 22-1, 11-1, 4-1, 25-1, }; +#endif /* S tables, original form */ +#ifdef WANT_S_TABLE static char S[8][64] = { - 14, 4,13, 1, 2,15,11, 8, 3,10, 6,12, 5, 9, 0, 7, +{ 14, 4,13, 1, 2,15,11, 8, 3,10, 6,12, 5, 9, 0, 7, 0,15, 7, 4,14, 2,13, 1,10, 6,12,11, 9, 5, 3, 8, 4, 1,14, 8,13, 6, 2,11,15,12, 9, 7, 3,10, 5, 0, - 15,12, 8, 2, 4, 9, 1, 7, 5,11, 3,14,10, 0, 6,13, + 15,12, 8, 2, 4, 9, 1, 7, 5,11, 3,14,10, 0, 6,13, }, - 15, 1, 8,14, 6,11, 3, 4, 9, 7, 2,13,12, 0, 5,10, +{ 15, 1, 8,14, 6,11, 3, 4, 9, 7, 2,13,12, 0, 5,10, 3,13, 4, 7,15, 2, 8,14,12, 0, 1,10, 6, 9,11, 5, 0,14, 7,11,10, 4,13, 1, 5, 8,12, 6, 9, 3, 2,15, - 13, 8,10, 1, 3,15, 4, 2,11, 6, 7,12, 0, 5,14, 9, + 13, 8,10, 1, 3,15, 4, 2,11, 6, 7,12, 0, 5,14, 9, }, - 10, 0, 9,14, 6, 3,15, 5, 1,13,12, 7,11, 4, 2, 8, +{ 10, 0, 9,14, 6, 3,15, 5, 1,13,12, 7,11, 4, 2, 8, 13, 7, 0, 9, 3, 4, 6,10, 2, 8, 5,14,12,11,15, 1, 13, 6, 4, 9, 8,15, 3, 0,11, 1, 2,12, 5,10,14, 7, - 1,10,13, 0, 6, 9, 8, 7, 4,15,14, 3,11, 5, 2,12, + 1,10,13, 0, 6, 9, 8, 7, 4,15,14, 3,11, 5, 2,12, }, - 7,13,14, 3, 0, 6, 9,10, 1, 2, 8, 5,11,12, 4,15, +{ 7,13,14, 3, 0, 6, 9,10, 1, 2, 8, 5,11,12, 4,15, 13, 8,11, 5, 6,15, 0, 3, 4, 7, 2,12, 1,10,14, 9, 10, 6, 9, 0,12,11, 7,13,15, 1, 3,14, 5, 2, 8, 4, - 3,15, 0, 6,10, 1,13, 8, 9, 4, 5,11,12, 7, 2,14, + 3,15, 0, 6,10, 1,13, 8, 9, 4, 5,11,12, 7, 2,14, }, - 2,12, 4, 1, 7,10,11, 6, 8, 5, 3,15,13, 0,14, 9, +{ 2,12, 4, 1, 7,10,11, 6, 8, 5, 3,15,13, 0,14, 9, 14,11, 2,12, 4, 7,13, 1, 5, 0,15,10, 3, 9, 8, 6, 4, 2, 1,11,10,13, 7, 8,15, 9,12, 5, 6, 3, 0,14, - 11, 8,12, 7, 1,14, 2,13, 6,15, 0, 9,10, 4, 5, 3, + 11, 8,12, 7, 1,14, 2,13, 6,15, 0, 9,10, 4, 5, 3, }, - 12, 1,10,15, 9, 2, 6, 8, 0,13, 3, 4,14, 7, 5,11, +{ 12, 1,10,15, 9, 2, 6, 8, 0,13, 3, 4,14, 7, 5,11, 10,15, 4, 2, 7,12, 9, 5, 6, 1,13,14, 0,11, 3, 8, 9,14,15, 5, 2, 8,12, 3, 7, 0, 4,10, 1,13,11, 6, - 4, 3, 2,12, 9, 5,15,10,11,14, 1, 7, 6, 0, 8,13, + 4, 3, 2,12, 9, 5,15,10,11,14, 1, 7, 6, 0, 8,13, }, - 4,11, 2,14,15, 0, 8,13, 3,12, 9, 7, 5,10, 6, 1, +{ 4,11, 2,14,15, 0, 8,13, 3,12, 9, 7, 5,10, 6, 1, 13, 0,11, 7, 4, 9, 1,10,14, 3, 5,12, 2,15, 8, 6, 1, 4,11,13,12, 3, 7,14,10,15, 6, 8, 0, 5, 9, 2, - 6,11,13, 8, 1, 4,10, 7, 9, 5, 0,15,14, 2, 3,12, + 6,11,13, 8, 1, 4,10, 7, 9, 5, 0,15,14, 2, 3,12, }, - 13, 2, 8, 4, 6,15,11, 1,10, 9, 3,14, 5, 0,12, 7, +{ 13, 2, 8, 4, 6,15,11, 1,10, 9, 3,14, 5, 0,12, 7, 1,15,13, 8,10, 3, 7, 4,12, 5, 6,11, 0,14, 9, 2, 7,11, 4, 1, 9,12,14, 2, 0, 6,10,13,15, 3, 5, 8, - 2, 1,14, 7, 4,10, 8,13,15,12, 9, 0, 3, 5, 6,11, + 2, 1,14, 7, 4,10, 8,13,15,12, 9, 0, 3, 5, 6,11 } }; +#endif diff --git a/src/des/util.c b/src/des/util.c index f0d683dee..9be7e5d9d 100644 --- a/src/des/util.c +++ b/src/des/util.c @@ -12,7 +12,7 @@ #include #include -des_cblock_print_file(x, fp) +int des_cblock_print_file(x, fp) des_cblock *x; FILE *fp; { @@ -26,6 +26,8 @@ des_cblock_print_file(x, fp) fprintf(fp,", "); } fprintf(fp," }"); + + return(0); } #ifdef DEBUG diff --git a/src/des/weak_key.c b/src/des/weak_key.c index 491fdcb14..0ebe45aaa 100644 --- a/src/des/weak_key.c +++ b/src/des/weak_key.c @@ -12,6 +12,7 @@ * Originally written 8/85 by Steve Miller, MIT Project Athena. */ +#include #include #include "des_internal.h" diff --git a/src/pinstall/install.c b/src/pinstall/install.c index 53e4ed88a..e3066f4de 100644 --- a/src/pinstall/install.c +++ b/src/pinstall/install.c @@ -77,6 +77,9 @@ Generic install command. Options are: #ifdef AFS_HPUX_ENV #include #endif +#include +#include +#include struct stat istat, ostat; @@ -115,9 +118,9 @@ static char *strrpbrk (s, set) int i; bzero (sets, sizeof(sets)); - while (*set) sets[*set++] = 1; + while (*set) sets[(int) *set++] = 1; i = strlen (s); - while (i > 0) if (sets[s[--i]]) return &s[i]; + while (i > 0) if (sets[(int)s[--i]]) return &s[i]; return 0; } @@ -126,23 +129,26 @@ char *ErrorString(aerrno) static char tbuffer[100]; if (aerrno < 0 || aerrno >= sys_nerr) { sprintf(tbuffer, "undefined error code %d", aerrno); - return tbuffer; + } else { + strcpy(tbuffer, sys_errlist[aerrno]); } - return sys_errlist[aerrno]; + return tbuffer; } +int stripName(aname) char *aname; {if (rindex(aname, '.') == 0) return 1; else return 0; } +int atoo(astr) register char *astr; {register afs_int32 value; register char tc; value = 0; - while (tc = *astr++) + while ((tc = *astr++)) {value <<= 3; value += tc-'0'; } @@ -154,7 +160,7 @@ atoo(astr) * Implementation lifted from that for AIX 3.1, since there didn't seem to be any * reason why it wouldn't work. */ -static +static int quickStrip (iname, oname, ignored, copy_only) char *iname, *oname; { int pid, status; @@ -248,6 +254,7 @@ char *iname, *oname; { * Since /bin/strip will make that call for us, we will lie so that * it has a chance. */ +int AIXobject(ignored) { return !0; @@ -451,16 +458,17 @@ static int quickStrip (afd, asize) #include "AFS_component_version_number.c" +int main (argc, argv) int argc; char **argv; { int setOwner, setMode, setGroup, ifd, ofd; - afs_int32 mode, owner, group; + afs_int32 mode=0, owner, group; struct passwd *tpw; struct group *tgp; char *fnames[MAXFILES], *newNames[MAXFILES]; - afs_int32 rcode, code, newcode; + afs_int32 rcode, code; char *dname; char pname[1024]; #if defined (AFS_HPUX_ENV) @@ -468,7 +476,10 @@ main (argc, argv) #endif /* AFS_HPUX_ENV */ char pnametmp[1024]; int pnamelen; +#if defined (AFS_AIX_ENV) + afs_int32 newcode; static char diskBuffer[BUFSIZE]; /* must be static to avoid compiler bugs for large stuff */ +#endif char myHostName[100]; struct timeval tvp[2]; int isDir; @@ -679,7 +690,7 @@ main (argc, argv) #if defined(AFS_AIX_ENV) || defined(AFS_HPUX_ENV) || defined(AFS_SUN5_ENV) || defined(AFS_DECOSF_ENV) || defined(AFS_SGI_ENV) || defined(AFS_LINUX20_ENV) || defined(AFS_DARWIN_ENV) stripcalled = 0; if (strip == 1 || - (strip == -1 && ((istat.st_mode & 0111) == 0111) && stripName(newNames[i])) && AIXobject(fnames[i])) + ((strip == -1 && ((istat.st_mode & 0111) == 0111) && stripName(newNames[i])) && AIXobject(fnames[i]))) stripcalled = 1; if (!stripcalled) { /* Simply copy target to dest */