]> git.ozlabs.org Git - ppp.git/commitdiff
get rid of a few compile warnings
authorPaul Mackerras <paulus@samba.org>
Mon, 15 Nov 1999 01:51:54 +0000 (01:51 +0000)
committerPaul Mackerras <paulus@samba.org>
Mon, 15 Nov 1999 01:51:54 +0000 (01:51 +0000)
pppd/chap.c
pppd/fsm.h
pppd/ipcp.c
pppd/lcp.c
pppd/options.c
pppd/upap.c
pppd/upap.h

index b8a5d0f726ffe9f723d1eaf344a52d45b1591ef9..2a43c050cdadcf4f06c966521e2618199012c8aa 100644 (file)
@@ -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);
 }
 
index 1916342b638721a0439937290e29c64bfff55a6c..78f8c8dabacffa039744660ea3fcabcd8997f948 100644 (file)
  * 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
 
 
 /*
index a652cbb641b51374129a4d447c99d98a13134ef2..d273f50d5534bf670e18beff9599c4f7066dc152 100644 (file)
@@ -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);
index 7f643b2ca7d21230b51437f7eda08cead334f43b..0a192924c6a34e911fa7c9728e89a1de1e461b45 100644 (file)
@@ -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;
 
index edee078245a2d43b1699befbb2b25468c698bf4a..6fd750f3ebfd489eb9a2664b015c02a32920ec46 100644 (file)
@@ -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 <ctype.h>
 #include <stdio.h>
@@ -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;
index 5cf9c683098894f2acca9567472835bfa5986b83..4e5c045a71ce344a465d0804586e24164c4469ae 100644 (file)
@@ -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);
index ba4e153cb330169d76bedbe0b1aa33cf450d529f..0d38f3bf6e66a7a3be821291a3af550ebd15753b 100644 (file)
  * 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
 
 
 /*