svn commit: trunk/busybox/networking

andersen at busybox.net andersen at busybox.net
Mon Jan 30 22:30:47 UTC 2006


Author: andersen
Date: 2006-01-30 14:30:41 -0800 (Mon, 30 Jan 2006)
New Revision: 13729

Log:
fix up annoying signed/unsigned and mixed type errors


Modified:
   trunk/busybox/networking/arping.c
   trunk/busybox/networking/httpd.c
   trunk/busybox/networking/interface.c
   trunk/busybox/networking/route.c
   trunk/busybox/networking/telnet.c
   trunk/busybox/networking/telnetd.c
   trunk/busybox/networking/traceroute.c
   trunk/busybox/networking/wget.c
   trunk/busybox/networking/zcip.c


Changeset:
Modified: trunk/busybox/networking/arping.c
===================================================================
--- trunk/busybox/networking/arping.c	2006-01-30 21:35:42 UTC (rev 13728)
+++ trunk/busybox/networking/arping.c	2006-01-30 22:30:41 UTC (rev 13729)
@@ -404,7 +404,7 @@
 			}
 		} 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 alen = sizeof(me);
+		socklen_t alen = sizeof(me);
 
 		if (getsockname(s, (struct sockaddr *) &me, &alen) == -1) {
 			bb_error_msg("getsockname");
@@ -479,9 +479,9 @@
 
 	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,

Modified: trunk/busybox/networking/httpd.c
===================================================================
--- trunk/busybox/networking/httpd.c	2006-01-30 21:35:42 UTC (rev 13728)
+++ trunk/busybox/networking/httpd.c	2006-01-30 22:30:41 UTC (rev 13729)
@@ -123,8 +123,10 @@
 
 #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 @@
   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;

Modified: trunk/busybox/networking/interface.c
===================================================================
--- trunk/busybox/networking/interface.c	2006-01-30 21:35:42 UTC (rev 13728)
+++ trunk/busybox/networking/interface.c	2006-01-30 22:30:41 UTC (rev 13729)
@@ -501,7 +501,7 @@
 
 	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 @@
 	   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] */);

Modified: trunk/busybox/networking/route.c
===================================================================
--- trunk/busybox/networking/route.c	2006-01-30 21:35:42 UTC (rev 13728)
+++ trunk/busybox/networking/route.c	2006-01-30 22:30:41 UTC (rev 13729)
@@ -166,7 +166,7 @@
 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));

Modified: trunk/busybox/networking/telnet.c
===================================================================
--- trunk/busybox/networking/telnet.c	2006-01-30 21:35:42 UTC (rev 13728)
+++ trunk/busybox/networking/telnet.c	2006-01-30 22:30:41 UTC (rev 13729)
@@ -204,7 +204,7 @@
 	 */
 
 	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++)

Modified: trunk/busybox/networking/telnetd.c
===================================================================
--- trunk/busybox/networking/telnetd.c	2006-01-30 21:35:42 UTC (rev 13728)
+++ trunk/busybox/networking/telnetd.c	2006-01-30 22:30:41 UTC (rev 13729)
@@ -131,7 +131,7 @@
   */
 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);

Modified: trunk/busybox/networking/traceroute.c
===================================================================
--- trunk/busybox/networking/traceroute.c	2006-01-30 21:35:42 UTC (rev 13728)
+++ trunk/busybox/networking/traceroute.c	2006-01-30 22:30:41 UTC (rev 13729)
@@ -293,7 +293,7 @@
 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 @@
 		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");
 	}

Modified: trunk/busybox/networking/wget.c
===================================================================
--- trunk/busybox/networking/wget.c	2006-01-30 21:35:42 UTC (rev 13728)
+++ trunk/busybox/networking/wget.c	2006-01-30 22:30:41 UTC (rev 13729)
@@ -332,11 +332,11 @@
 #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
 

Modified: trunk/busybox/networking/zcip.c
===================================================================
--- trunk/busybox/networking/zcip.c	2006-01-30 21:35:42 UTC (rev 13728)
+++ trunk/busybox/networking/zcip.c	2006-01-30 22:30:41 UTC (rev 13729)
@@ -314,7 +314,7 @@
 		goto fail;
 	} else {
 		struct ifreq ifr;
-		short seed[3];
+		unsigned short seed[3];
 
 		// get the interface's ethernet address
 		memset(&ifr, 0, sizeof (ifr));




More information about the busybox-cvs mailing list