From: Paul Mackerras Date: Mon, 15 Nov 1999 01:51:54 +0000 (+0000) Subject: get rid of a few compile warnings X-Git-Tag: ppp-2.4.7~602 X-Git-Url: https://git.ozlabs.org/?p=ppp.git;a=commitdiff_plain;h=db6112a8290cd07569d1c34237a50a17668c68f3;hp=929f3cc45107cbd755c2e8df3d8dff6348e1df95 get rid of a few compile warnings --- diff --git a/pppd/chap.c b/pppd/chap.c index b8a5d0f..2a43c05 100644 --- a/pppd/chap.c +++ b/pppd/chap.c @@ -33,7 +33,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: chap.c,v 1.23 1999/08/13 06:46:11 paulus Exp $" +#define RCSID "$Id: chap.c,v 1.24 1999/11/15 01:51:50 paulus Exp $" /* * TODO: @@ -741,7 +741,7 @@ ChapGenChallenge(cstate) { int chal_len; u_char *ptr = cstate->challenge; - unsigned int i; + int i; /* pick a random challenge length between MIN_CHALLENGE_LENGTH and MAX_CHALLENGE_LENGTH */ @@ -753,7 +753,7 @@ ChapGenChallenge(cstate) cstate->chal_transmits = 0; /* generate a random string */ - for (i = 0; i < chal_len; i++ ) + for (i = 0; i < chal_len; i++) *ptr++ = (char) (drand48() * 0xff); } diff --git a/pppd/fsm.h b/pppd/fsm.h index 1916342..78f8c8d 100644 --- a/pppd/fsm.h +++ b/pppd/fsm.h @@ -16,13 +16,13 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: fsm.h,v 1.7 1997/04/30 05:52:37 paulus Exp $ + * $Id: fsm.h,v 1.8 1999/11/15 01:51:50 paulus Exp $ */ /* * Packet header = Code, id, length. */ -#define HEADERLEN (sizeof (u_char) + sizeof (u_char) + sizeof (u_short)) +#define HEADERLEN 4 /* diff --git a/pppd/ipcp.c b/pppd/ipcp.c index a652cbb..d273f50 100644 --- a/pppd/ipcp.c +++ b/pppd/ipcp.c @@ -17,7 +17,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: ipcp.c,v 1.50 1999/08/24 05:31:09 paulus Exp $" +#define RCSID "$Id: ipcp.c,v 1.51 1999/11/15 01:51:51 paulus Exp $" /* * TODO: @@ -264,7 +264,7 @@ setdnsaddr(argv) struct hostent *hp; dns = inet_addr(*argv); - if (dns == -1) { + if (dns == (u_int32_t) -1) { if ((hp = gethostbyname(*argv)) == NULL) { option_error("invalid address parameter '%s' for ms-dns option", *argv); @@ -296,7 +296,7 @@ setwinsaddr(argv) struct hostent *hp; wins = inet_addr(*argv); - if (wins == -1) { + if (wins == (u_int32_t) -1) { if ((hp = gethostbyname(*argv)) == NULL) { option_error("invalid address parameter '%s' for ms-wins option", *argv); diff --git a/pppd/lcp.c b/pppd/lcp.c index 7f643b2..0a19292 100644 --- a/pppd/lcp.c +++ b/pppd/lcp.c @@ -17,7 +17,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: lcp.c,v 1.45 1999/09/11 12:08:56 paulus Exp $"; +#define RCSID "$Id: lcp.c,v 1.46 1999/11/15 01:51:51 paulus Exp $"; /* * TODO: @@ -118,9 +118,9 @@ lcp_options lcp_allowoptions[NUM_PPP]; /* Options we allow peer to request */ lcp_options lcp_hisoptions[NUM_PPP]; /* Options that we ack'd */ u_int32_t xmit_accm[NUM_PPP][8]; /* extended transmit ACCM */ -static u_int32_t lcp_echos_pending = 0; /* Number of outstanding echo msgs */ -static u_int32_t lcp_echo_number = 0; /* ID number of next echo frame */ -static u_int32_t lcp_echo_timer_running = 0; /* set if a timer is running */ +static int lcp_echos_pending = 0; /* Number of outstanding echo msgs */ +static int lcp_echo_number = 0; /* ID number of next echo frame */ +static int lcp_echo_timer_running = 0; /* set if a timer is running */ static u_char nak_buffer[PPP_MRU]; /* where we construct a nak packet */ @@ -457,7 +457,7 @@ lcp_rprotrej(f, inp, len) struct protent *protp; u_short prot; - if (len < sizeof (u_short)) { + if (len < 2) { LCPDEBUG(("lcp_rprotrej: Rcvd short Protocol-Reject packet!")); return; } @@ -1852,7 +1852,9 @@ LcpEchoTimeout (arg) static void lcp_received_echo_reply (f, id, inp, len) fsm *f; - int id; u_char *inp; int len; + int id; + u_char *inp; + int len; { u_int32_t magic; diff --git a/pppd/options.c b/pppd/options.c index edee078..6fd750f 100644 --- a/pppd/options.c +++ b/pppd/options.c @@ -17,7 +17,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: options.c,v 1.66 1999/09/11 12:08:58 paulus Exp $" +#define RCSID "$Id: options.c,v 1.67 1999/11/15 01:51:52 paulus Exp $" #include #include @@ -1413,7 +1413,7 @@ setipaddr(arg) */ if (colon != arg) { *colon = '\0'; - if ((local = inet_addr(arg)) == -1) { + if ((local = inet_addr(arg)) == (u_int32_t) -1) { if ((hp = gethostbyname(arg)) == NULL) { option_error("unknown host: %s", arg); return -1; @@ -1434,7 +1434,7 @@ setipaddr(arg) * If colon last character, then no remote addr. */ if (*++colon != '\0') { - if ((remote = inet_addr(colon)) == -1) { + if ((remote = inet_addr(colon)) == (u_int32_t) -1) { if ((hp = gethostbyname(colon)) == NULL) { option_error("unknown host: %s", colon); return -1; @@ -1478,7 +1478,7 @@ setnetmask(argv) b = strtoul(p, &endp, 0); if (endp == p) break; - if (b < 0 || b > 255) { + if (b > 255) { if (n == 3) { /* accept e.g. 0xffffff00 */ p = endp; diff --git a/pppd/upap.c b/pppd/upap.c index 5cf9c68..4e5c045 100644 --- a/pppd/upap.c +++ b/pppd/upap.c @@ -17,7 +17,7 @@ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. */ -#define RCSID "$Id: upap.c,v 1.21 1999/09/11 12:09:00 paulus Exp $" +#define RCSID "$Id: upap.c,v 1.22 1999/11/15 01:51:53 paulus Exp $" /* * TODO: @@ -372,7 +372,7 @@ upap_rauthreq(u, inp, id, len) /* * Parse user/passwd. */ - if (len < sizeof (u_char)) { + if (len < 1) { UPAPDEBUG(("pap_rauth: rcvd short packet.")); return; } @@ -435,7 +435,7 @@ upap_rauthack(u, inp, id, len) /* * Parse message. */ - if (len < sizeof (u_char)) { + if (len < 1) { UPAPDEBUG(("pap_rauthack: ignoring missing msg-length.")); } else { GETCHAR(msglen, inp); @@ -475,7 +475,7 @@ upap_rauthnak(u, inp, id, len) /* * Parse message. */ - if (len < sizeof (u_char)) { + if (len < 1) { UPAPDEBUG(("pap_rauthnak: ignoring missing msg-length.")); } else { GETCHAR(msglen, inp); diff --git a/pppd/upap.h b/pppd/upap.h index ba4e153..0d38f3b 100644 --- a/pppd/upap.h +++ b/pppd/upap.h @@ -16,13 +16,13 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: upap.h,v 1.6 1996/07/01 01:21:45 paulus Exp $ + * $Id: upap.h,v 1.7 1999/11/15 01:51:54 paulus Exp $ */ /* * Packet header = Code, id, length. */ -#define UPAP_HEADERLEN (sizeof (u_char) + sizeof (u_char) + sizeof (u_short)) +#define UPAP_HEADERLEN 4 /*