svn commit: trunk/busybox: editors loginutils miscutils networking/ etc...

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


Author: andersen
Date: 2006-01-30 14:48:39 -0800 (Mon, 30 Jan 2006)
New Revision: 13732

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


Modified:
   trunk/busybox/editors/vi.c
   trunk/busybox/loginutils/login.c
   trunk/busybox/miscutils/devfsd.c
   trunk/busybox/miscutils/hdparm.c
   trunk/busybox/networking/udhcp/dhcpc.c
   trunk/busybox/networking/udhcp/packet.c
   trunk/busybox/networking/udhcp/serverpacket.c
   trunk/busybox/procps/fuser.c
   trunk/busybox/procps/sysctl.c
   trunk/busybox/shell/ash.c
   trunk/busybox/shell/hush.c
   trunk/busybox/shell/lash.c
   trunk/busybox/shell/msh.c


Changeset:
Modified: trunk/busybox/editors/vi.c
===================================================================
--- trunk/busybox/editors/vi.c	2006-01-30 22:48:02 UTC (rev 13731)
+++ trunk/busybox/editors/vi.c	2006-01-30 22:48:39 UTC (rev 13732)
@@ -347,7 +347,7 @@
 	(void) srand((long) my_pid);
 #endif							/* CONFIG_FEATURE_VI_CRASHME */
 
-	status_buffer = STATUS_BUFFER;
+	status_buffer = (Byte *)STATUS_BUFFER;
 	last_status_cksum = 0;
 
 #ifdef CONFIG_FEATURE_VI_READONLY
@@ -729,7 +729,7 @@
 	while (isblnk(*buf))
 		buf++;
 	strcpy((char *) args, (char *) buf);
-	buf1 = last_char_is((char *)cmd, '!');
+	buf1 = (Byte*)last_char_is((char *)cmd, '!');
 	if (buf1) {
 		useforce = TRUE;
 		*buf1 = '\0';   // get rid of !
@@ -763,7 +763,7 @@
 		place_cursor(rows - 1, 0, FALSE);	// go to Status line
 		clear_to_eol();			// clear the line
 		cookmode();
-		system(orig_buf+1);		// run the cmd
+		system((char*)(orig_buf+1));		// run the cmd
 		rawmode();
 		Hit_Return();			// let user see results
 		(void) alarm(3);		// done waiting for input
@@ -787,10 +787,10 @@
 			psbs("No write since last change (:edit! overrides)");
 			goto vc1;
 		}
-		if (strlen(args) > 0) {
+		if (strlen((char*)args) > 0) {
 			// the user supplied a file name
 			fn= args;
-		} else if (cfn != 0 && strlen(cfn) > 0) {
+		} else if (cfn != 0 && strlen((char*)cfn) > 0) {
 			// no user supplied name- use the current filename
 			fn= cfn;
 			goto vc5;
@@ -2397,7 +2397,7 @@
 	last_status_cksum = 0;	// force status update
 	place_cursor(rows - 1, 0, FALSE);	// go to Status line, bottom of screen
 	clear_to_eol();		// clear the line
-	write1(prompt);      // write out the :, /, or ? prompt
+	write1((char *) prompt);      // write out the :, /, or ? prompt
 
 	for (i = strlen((char *) buf); i < BUFSIZ;) {
 		c = get_one_char();	// read user input
@@ -2430,7 +2430,7 @@
 	struct stat st_buf;
 	int cnt, sr;
 
-	if (fn == 0 || strlen(fn) <= 0)
+	if (fn == 0 || strlen((char *)fn) <= 0)
 		return (-1);
 	cnt = -1;
 	sr = stat((char *) fn, &st_buf);	// see if file exists
@@ -2586,7 +2586,7 @@
 	strcat(cm2, "\r");			// start at col 0
 	// just send out orignal source char to get to correct place
 	screenp = &screen[row * columns];	// start of screen line
-	strncat(cm2, screenp, col);
+	strncat(cm2, (char* )screenp, col);
 
 	//----- 3.  Try some other way of moving cursor
 	//---------------------------------------------
@@ -2657,10 +2657,10 @@
 	memset(screen, ' ', screensize);	// clear new screen
 }
 
-static int bufsum(char *buf, int count)
+static int bufsum(unsigned char *buf, int count)
 {
 	int sum = 0;
-	char *e = buf + count;
+	unsigned char *e = buf + count;
 	while (buf < e)
 		sum += *buf++;
 	return sum;
@@ -2680,10 +2680,10 @@
 	if (have_status_msg || ((cnt > 0 && last_status_cksum != cksum))) {
 		last_status_cksum= cksum;		// remember if we have seen this line
 		place_cursor(rows - 1, 0, FALSE);	// put cursor on status line
-		write1(status_buffer);
+		write1((char*)status_buffer);
 		clear_to_eol();
 		if (have_status_msg) {
-			if (((int)strlen(status_buffer) - (have_status_msg - 1)) >
+			if (((int)strlen((char*)status_buffer) - (have_status_msg - 1)) >
 					(columns - 1) ) {
 				have_status_msg = 0;
 				Hit_Return();
@@ -2937,7 +2937,7 @@
 			// write line out to terminal
 			{
 				int nic = ce-cs+1;
-				char *out = sp+cs;
+				char *out = (char*)sp+cs;
 
 				while(nic-- > 0) {
 					putchar(*out);

Modified: trunk/busybox/loginutils/login.c
===================================================================
--- trunk/busybox/loginutils/login.c	2006-01-30 22:48:02 UTC (rev 13731)
+++ trunk/busybox/loginutils/login.c	2006-01-30 22:48:39 UTC (rev 13732)
@@ -450,7 +450,7 @@
 		/* XXX - assumes /dev/tty?? */
 		strncpy(utent.ut_id, utent.ut_line + 3, sizeof utent.ut_id);
 		strncpy(utent.ut_user, "LOGIN", sizeof utent.ut_user);
-		time(&utent.ut_time);
+		time((time_t*)&utent.ut_time);
 	}
 }
 
@@ -465,7 +465,7 @@
 {
 	utent.ut_type = USER_PROCESS;
 	strncpy(utent.ut_user, name, sizeof utent.ut_user);
-	time(&utent.ut_time);
+	time((time_t*)&utent.ut_time);
 	/* other fields already filled in by checkutmp above */
 	setutent();
 	pututline(&utent);

Modified: trunk/busybox/miscutils/devfsd.c
===================================================================
--- trunk/busybox/miscutils/devfsd.c	2006-01-30 22:48:02 UTC (rev 13731)
+++ trunk/busybox/miscutils/devfsd.c	2006-01-30 22:48:39 UTC (rev 13732)
@@ -476,7 +476,8 @@
 	if (fcntl (fd, F_SETFD, FD_CLOEXEC) != 0)
 		devfsd_perror_msg_and_die("FD_CLOEXEC");
 
-	do_ioctl_and_die(fd, DEVFSDIOC_GET_PROTO_REV,(int )&proto_rev);
+	if (ioctl (fd, DEVFSDIOC_GET_PROTO_REV, &proto_rev) == -1)
+		msg_logger_and_die(LOG_ERR, "ioctl");
 
 	/*setup initial entries */
     for (curr = initial_symlinks; curr->dest != NULL; ++curr)

Modified: trunk/busybox/miscutils/hdparm.c
===================================================================
--- trunk/busybox/miscutils/hdparm.c	2006-01-30 22:48:02 UTC (rev 13731)
+++ trunk/busybox/miscutils/hdparm.c	2006-01-30 22:48:39 UTC (rev 13732)
@@ -1945,7 +1945,7 @@
 	{
 		no_scsi();
 		printf(" attempting to unregister hwif#%u\n", hwif);
-		bb_ioctl(fd, HDIO_UNREGISTER_HWIF,(int *)hwif,"HDIO_UNREGISTER_HWIF");
+		bb_ioctl(fd, HDIO_UNREGISTER_HWIF,(int *)(unsigned long)hwif,"HDIO_UNREGISTER_HWIF");
 	}
 #endif
 #ifdef CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF
@@ -1977,7 +1977,7 @@
 			else
 				printf("set UDMA mode to %d\n", (piomode-200));
 		}
-		bb_ioctl(fd, HDIO_SET_PIO_MODE, (int *)piomode, "HDIO_SET_PIO_MODE");
+		bb_ioctl(fd, HDIO_SET_PIO_MODE, (int *)(unsigned long)piomode, "HDIO_SET_PIO_MODE");
 	}
 	if (set_io32bit)
 	{
@@ -2435,7 +2435,7 @@
 			printf(" setting bus state to %d", busstate);
 			bus_state_value(busstate);
 		}
-		bb_ioctl(fd, HDIO_SET_BUSSTATE, (int *)busstate, "HDIO_SET_BUSSTATE");
+		bb_ioctl(fd, HDIO_SET_BUSSTATE, (int *)(unsigned long)busstate, "HDIO_SET_BUSSTATE");
 	}
 #endif
 #ifdef CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF

Modified: trunk/busybox/networking/udhcp/dhcpc.c
===================================================================
--- trunk/busybox/networking/udhcp/dhcpc.c	2006-01-30 22:48:02 UTC (rev 13731)
+++ trunk/busybox/networking/udhcp/dhcpc.c	2006-01-30 22:48:39 UTC (rev 13732)
@@ -220,7 +220,7 @@
 			client_config.clientid[OPT_CODE] = DHCP_CLIENT_ID;
 			client_config.clientid[OPT_LEN] = len;
 			client_config.clientid[OPT_DATA] = '\0';
-			strncpy(client_config.clientid + OPT_DATA, optarg, len);
+			strncpy((char*)client_config.clientid + OPT_DATA, optarg, len);
 			break;
 		case 'C':
 			if (client_config.clientid) show_usage();
@@ -232,7 +232,7 @@
 			client_config.vendorclass = xmalloc(len + 2);
 			client_config.vendorclass[OPT_CODE] = DHCP_VENDOR;
 			client_config.vendorclass[OPT_LEN] = len;
-			strncpy(client_config.vendorclass + OPT_DATA, optarg, len);
+			strncpy((char*)client_config.vendorclass + OPT_DATA, optarg, len);
 			break;
 		case 'f':
 			client_config.foreground = 1;
@@ -247,7 +247,7 @@
 			client_config.hostname = xmalloc(len + 2);
 			client_config.hostname[OPT_CODE] = DHCP_HOST_NAME;
 			client_config.hostname[OPT_LEN] = len;
-			strncpy(client_config.hostname + 2, optarg, len);
+			strncpy((char*)client_config.hostname + 2, optarg, len);
 			break;
 		case 'F':
 			len = strlen(optarg) > 255 ? 255 : strlen(optarg);
@@ -264,7 +264,7 @@
 			client_config.fqdn[OPT_LEN + 1] = 0x1;
 			client_config.fqdn[OPT_LEN + 2] = 0;
 			client_config.fqdn[OPT_LEN + 3] = 0;
-			strncpy(client_config.fqdn + 5, optarg, len);
+			strncpy((char*)client_config.fqdn + 5, optarg, len);
 			break;
 		case 'i':
 			client_config.interface =  optarg;

Modified: trunk/busybox/networking/udhcp/packet.c
===================================================================
--- trunk/busybox/networking/udhcp/packet.c	2006-01-30 22:48:02 UTC (rev 13731)
+++ trunk/busybox/networking/udhcp/packet.c	2006-01-30 22:48:39 UTC (rev 13732)
@@ -70,7 +70,7 @@
 	if (packet->op == BOOTREQUEST && (vendor = get_option(packet, DHCP_VENDOR))) {
 		for (i = 0; broken_vendors[i][0]; i++) {
 			if (vendor[OPT_LEN - 2] == (uint8_t) strlen(broken_vendors[i]) &&
-			    !strncmp(vendor, broken_vendors[i], vendor[OPT_LEN - 2])) {
+			    !strncmp((char*)vendor, broken_vendors[i], vendor[OPT_LEN - 2])) {
 				DEBUG(LOG_INFO, "broken client (%s), forcing broadcast",
 					broken_vendors[i]);
 				packet->flags |= htons(BROADCAST_FLAG);

Modified: trunk/busybox/networking/udhcp/serverpacket.c
===================================================================
--- trunk/busybox/networking/udhcp/serverpacket.c	2006-01-30 22:48:02 UTC (rev 13731)
+++ trunk/busybox/networking/udhcp/serverpacket.c	2006-01-30 22:48:39 UTC (rev 13732)
@@ -98,9 +98,9 @@
 {
 	packet->siaddr = server_config.siaddr;
 	if (server_config.sname)
-		strncpy(packet->sname, server_config.sname, sizeof(packet->sname) - 1);
+		strncpy((char*)packet->sname, server_config.sname, sizeof(packet->sname) - 1);
 	if (server_config.boot_file)
-		strncpy(packet->file, server_config.boot_file, sizeof(packet->file) - 1);
+		strncpy((char*)packet->file, server_config.boot_file, sizeof(packet->file) - 1);
 }
 
 

Modified: trunk/busybox/procps/fuser.c
===================================================================
--- trunk/busybox/procps/fuser.c	2006-01-30 22:48:02 UTC (rev 13731)
+++ trunk/busybox/procps/fuser.c	2006-01-30 22:48:39 UTC (rev 13732)
@@ -143,7 +143,7 @@
 	char addr[128];
 	ino_t tmp_inode;
 	dev_t tmp_dev;
-	uint64_t  uint64_inode;
+	long long  uint64_inode;
 	int tmp_port;
 	FILE *f;
 
@@ -194,7 +194,7 @@
 	char line[FUSER_MAX_LINE + 1];
 	int major, minor;
 	ino_t inode;
-	uint64_t uint64_inode;
+	long long uint64_inode;
 	dev_t dev;
 
 	if (!(file = fopen(fname, "r"))) return 0;

Modified: trunk/busybox/procps/sysctl.c
===================================================================
--- trunk/busybox/procps/sysctl.c	2006-01-30 22:48:02 UTC (rev 13731)
+++ trunk/busybox/procps/sysctl.c	2006-01-30 22:48:39 UTC (rev 13732)
@@ -209,7 +209,7 @@
 		return -2;
 	}
 
-	tmpname = bb_xasprintf("%s%.*s", PROC_PATH, (equals - name), name);
+	tmpname = bb_xasprintf("%s%.*s", PROC_PATH, (int)(equals - name), name);
 	outname = bb_xstrdup(tmpname + strlen(PROC_PATH));
 
 	while ((cptr = strchr(tmpname, '.')) != NULL)

Modified: trunk/busybox/shell/ash.c
===================================================================
--- trunk/busybox/shell/ash.c	2006-01-30 22:48:02 UTC (rev 13731)
+++ trunk/busybox/shell/ash.c	2006-01-30 22:48:39 UTC (rev 13732)
@@ -1402,8 +1402,10 @@
 
 #ifdef CONFIG_ASH_MATH_SUPPORT_64
 typedef int64_t arith_t;
+#define arith_t_type (long long)
 #else
 typedef long arith_t;
+#define arith_t_type (long)
 #endif
 
 #ifdef CONFIG_ASH_MATH_SUPPORT
@@ -10132,15 +10134,15 @@
 	char *out;
 	int len;
 	char line[EOFMARKLEN + 1];
-	struct nodelist *bqlist;
-	int quotef;
-	int dblquote;
-	int varnest;    /* levels of variables expansion */
-	int arinest;    /* levels of arithmetic expansion */
-	int parenlevel; /* levels of parens in arithmetic */
-	int dqvarnest;  /* levels of variables expansion within double quotes */
-	int oldstyle;
-	int prevsyntax; /* syntax before arithmetic */
+	struct nodelist *bqlist = 0;
+	int quotef = 0;
+	int dblquote = 0;
+	int varnest = 0;    /* levels of variables expansion */
+	int arinest = 0;    /* levels of arithmetic expansion */
+	int parenlevel = 0; /* levels of parens in arithmetic */
+	int dqvarnest = 0;  /* levels of variables expansion within double quotes */
+	int oldstyle = 0;
+	int prevsyntax = 0; /* syntax before arithmetic */
 #if __GNUC__
 	/* Avoid longjmp clobbering */
 	(void) &out;
@@ -10563,7 +10565,7 @@
 	struct jmploc jmploc;
 	struct jmploc *volatile savehandler;
 	size_t savelen;
-	int saveprompt;
+	int saveprompt = 0;
 #ifdef __GNUC__
 	(void) &saveprompt;
 #endif
@@ -13380,9 +13382,9 @@
 		}
 		/* save to shell variable */
 #ifdef CONFIG_ASH_MATH_SUPPORT_64
-		snprintf(buf, sizeof(buf), "%lld", rez);
+		snprintf(buf, sizeof(buf), "%lld", arith_t_type rez);
 #else
-		snprintf(buf, sizeof(buf), "%ld", rez);
+		snprintf(buf, sizeof(buf), "%ld", arith_t_type rez);
 #endif
 		setvar(numptr_m1->var, buf, 0);
 		/* after saving, make previous value for v++ or v-- */

Modified: trunk/busybox/shell/hush.c
===================================================================
--- trunk/busybox/shell/hush.c	2006-01-30 22:48:02 UTC (rev 13731)
+++ trunk/busybox/shell/hush.c	2006-01-30 22:48:39 UTC (rev 13732)
@@ -2614,10 +2614,10 @@
 	return 0;
 }
 
-static void mapset(const unsigned char *set, int code)
+static void mapset(const char *set, int code)
 {
-	const unsigned char *s;
-	for (s=set; *s; s++) map[*s] = code;
+	const char *s;
+	for (s=set; *s; s++) map[(int)*s] = code;
 }
 
 static void update_ifs_map(void)

Modified: trunk/busybox/shell/lash.c
===================================================================
--- trunk/busybox/shell/lash.c	2006-01-30 22:48:02 UTC (rev 13731)
+++ trunk/busybox/shell/lash.c	2006-01-30 22:48:39 UTC (rev 13732)
@@ -1440,7 +1440,7 @@
 	char *next_command = NULL;
 	struct job newjob;
 	int i;
-	int inbg;
+	int inbg = 0;
 	int status;
 #ifdef CONFIG_LASH_JOB_CONTROL
 	pid_t  parent_pgrp;

Modified: trunk/busybox/shell/msh.c
===================================================================
--- trunk/busybox/shell/msh.c	2006-01-30 22:48:02 UTC (rev 13731)
+++ trunk/busybox/shell/msh.c	2006-01-30 22:48:39 UTC (rev 13732)
@@ -1622,7 +1622,7 @@
 	brkaddr = malloc(AREASIZE);
 	brktop = brkaddr + AREASIZE;
 
-	while ((int) sbrk(0) & ALIGN)
+	while ((long) sbrk(0) & ALIGN)
 		sbrk(1);
 	areabot = (struct region *) sbrk(REGSIZE);
 




More information about the busybox-cvs mailing list