fix up annoying signed/unsigned and mixed type errors
authorEric Andersen <andersen@codepoet.org>
Mon, 30 Jan 2006 22:30:41 +0000 (22:30 -0000)
committerEric Andersen <andersen@codepoet.org>
Mon, 30 Jan 2006 22:30:41 +0000 (22:30 -0000)
networking/arping.c
networking/httpd.c
networking/interface.c
networking/route.c
networking/telnet.c
networking/telnetd.c
networking/traceroute.c
networking/wget.c
networking/zcip.c

index 95ca1ed2e400a4dc72b7e1295294d748621c064d..b66dbff1edbc6bafedba7bbd7e5560f70e6b815b 100644 (file)
@@ -404,7 +404,7 @@ int arping_main(int argc, char **argv)
                        }
                } else if (!dad) {
                        int on = 1;
-                       int alen = sizeof(saddr);
+                       socklen_t alen = sizeof(saddr);
 
                        saddr.sin_port = htons(1025);
                        saddr.sin_addr = dst;
@@ -437,7 +437,7 @@ int arping_main(int argc, char **argv)
        }
 
        {
-               int alen = sizeof(me);
+               socklen_t alen = sizeof(me);
 
                if (getsockname(s, (struct sockaddr *) &me, &alen) == -1) {
                        bb_error_msg("getsockname");
@@ -479,9 +479,9 @@ int arping_main(int argc, char **argv)
 
        while (1) {
                sigset_t sset, osset;
-               char packet[4096];
+               unsigned char packet[4096];
                struct sockaddr_ll from;
-               int alen = sizeof(from);
+               socklen_t alen = sizeof(from);
                int cc;
 
                if ((cc = recvfrom(s, packet, sizeof(packet), 0,
index c00f3e46d10cc158b6f97e5b388ece9ac2109958..b44adf730389f56799cf93938cd04c29aa00dfc3 100644 (file)
@@ -123,8 +123,10 @@ static const char home[] = "./";
 
 #ifdef CONFIG_LFS
 # define cont_l_fmt "%lld"
+# define cont_l_type (long long)
 #else
 # define cont_l_fmt "%ld"
+# define cont_l_type (long)
 #endif
 
 #define TIMEOUT 60
@@ -1028,7 +1030,7 @@ static int sendHeaders(HttpResponseNum responseNum)
   if (config->ContentLength != -1) {    /* file */
     strftime(timeStr, sizeof(timeStr), RFC1123FMT, gmtime(&config->last_mod));
     len += sprintf(buf+len, "Last-Modified: %s\r\n%s " cont_l_fmt "\r\n",
-                             timeStr, Content_length, config->ContentLength);
+                             timeStr, Content_length, cont_l_type config->ContentLength);
   }
   strcat(buf, "\r\n");
   len += 2;
index ad6c40fc110e6249e6be612c76f08d504ad2a15d..b2c746be9ef5317f568049b048d47686ea6e3911 100644 (file)
@@ -501,7 +501,7 @@ static char *UNSPEC_sprint(struct sockaddr *sap, int numeric)
 
        if (sap->sa_family == 0xFFFF || sap->sa_family == 0)
                return safe_strncpy(buf, _("[NONE SET]"), sizeof(buf));
-       return (UNSPEC_print(sap->sa_data));
+       return (UNSPEC_print((unsigned char *)sap->sa_data));
 }
 
 static struct aftype unspec_aftype = {
@@ -1833,7 +1833,7 @@ static void ife_print(struct interface *ptr)
           hardware address if it's null.  */
        if (hw->print != NULL && (!(hw_null_address(hw, ptr->hwaddr) &&
                                                                hw->suppress_null_addr)))
-               printf(_("HWaddr %s  "), hw->print(ptr->hwaddr));
+               printf(_("HWaddr %s  "), hw->print((unsigned char *)ptr->hwaddr));
 #ifdef IFF_PORTSEL
        if (ptr->flags & IFF_PORTSEL) {
                printf(_("Media:%s"), if_port_text[ptr->map.port] /* [0] */);
index 59c7564082be127fdd27aa2c2e12d76e75b22bcf..8ae0da1826aef4637a0027a78aaa4d50bad08e37 100644 (file)
@@ -166,7 +166,7 @@ static int kw_lookup(const char *kwtbl, char ***pargs)
 static void INET_setroute(int action, char **args)
 {
        struct rtentry rt;
-       const char *netmask;
+       const char *netmask = NULL;
        int skfd, isnet, xflag;
 
        assert((action == RTACTION_ADD) || (action == RTACTION_DEL));
index d9e66e5d352ce0bca4b4241dee4855de087e1aa3..05c7786ab335e4485cdf3c05f32d874a430e623f 100644 (file)
@@ -204,7 +204,7 @@ static void handlenetoutput(int len)
         */
 
        int i, j;
-       byte * p = G.buf;
+       byte * p = (byte*)G.buf;
        byte outbuf[4*DATABUFSIZE];
 
        for (i = len, j = 0; i > 0; i--, p++)
index 73303a20a4dbf4131b4c9f980ada5a5ee3083777..8943b2e3b181c7e44080d199a17e56556d530a85 100644 (file)
@@ -131,7 +131,7 @@ static struct tsession *sessions;
   */
 static char *
 remove_iacs(struct tsession *ts, int *pnum_totty) {
-       unsigned char *ptr0 = ts->buf1 + ts->wridx1;
+       unsigned char *ptr0 = (unsigned char *)ts->buf1 + ts->wridx1;
        unsigned char *ptr = ptr0;
        unsigned char *totty = ptr;
        unsigned char *end = ptr + MIN(BUFSIZE - ts->wridx1, ts->size1);
index b6252ad3e828ab52ec8a430c730762b3c7619886..95aa290a1f864fdf35fa33c319cb4dfba365be35 100644 (file)
@@ -293,7 +293,7 @@ struct IFADDRLIST {
 static const char route[] = "/proc/net/route";
 
 /* last inbound (icmp) packet */
-static u_char  packet[512] __attribute__((align (32)));
+static u_char  packet[512] __attribute__((aligned (32)));
 
 static struct ip *outip;               /* last output (udp) packet */
 static struct udphdr *outudp;          /* last output (udp) packet */
@@ -371,7 +371,7 @@ ifaddrlist(struct IFADDRLIST **ipaddrp)
                if (errno == EINVAL)
                        bb_error_msg_and_die(
                            "SIOCGIFCONF: ifreq struct too small (%d bytes)",
-                           sizeof(ibuf));
+                           (int)sizeof(ibuf));
                else
                        bb_perror_msg_and_die("SIOCGIFCONF");
        }
index 9c7ed9f1de299aa265c9bf350a13e031cc224caa..6c6a8a7cfee298614c053ac96e99d7356b3f25ca 100644 (file)
@@ -332,11 +332,11 @@ int wget_main(int argc, char **argv)
 #ifdef CONFIG_FEATURE_WGET_AUTHENTICATION
                        if (target.user) {
                                fprintf(sfp, "Authorization: Basic %s\r\n",
-                                       base64enc(target.user, buf, sizeof(buf)));
+                                       base64enc((unsigned char*)target.user, buf, sizeof(buf)));
                        }
                        if (use_proxy && server.user) {
                                fprintf(sfp, "Proxy-Authorization: Basic %s\r\n",
-                                       base64enc(server.user, buf, sizeof(buf)));
+                                       base64enc((unsigned char*)server.user, buf, sizeof(buf)));
                        }
 #endif
 
index b64e37c5848f103d07964155d48cab24d8dd5cc1..11b2db526fb12ded520a3c44c15d6869329f9a30 100644 (file)
@@ -314,7 +314,7 @@ fail:
                goto fail;
        } else {
                struct ifreq ifr;
-               short seed[3];
+               unsigned short seed[3];
 
                // get the interface's ethernet address
                memset(&ifr, 0, sizeof (ifr));