svn commit: trunk/busybox/util-linux

vodz at busybox.net vodz at busybox.net
Fri Dec 2 10:06:18 UTC 2005


Author: vodz
Date: 2005-12-02 02:06:04 -0800 (Fri, 02 Dec 2005)
New Revision: 12640

Log:
reduce signedness warning

Modified:
   trunk/busybox/util-linux/fdisk.c


Changeset:
Modified: trunk/busybox/util-linux/fdisk.c
===================================================================
--- trunk/busybox/util-linux/fdisk.c	2005-12-02 09:46:04 UTC (rev 12639)
+++ trunk/busybox/util-linux/fdisk.c	2005-12-02 10:06:04 UTC (rev 12640)
@@ -106,7 +106,7 @@
 
 
 struct systypes {
-	const unsigned char *name;
+	const char *name;
 };
 
 static uint    sector_size = DEFAULT_SECTOR_SIZE,
@@ -122,7 +122,7 @@
 #else
 # define MBRbuffer bb_common_bufsiz1
 #endif
-        
+
 #ifdef CONFIG_FEATURE_SUN_LABEL
 static int     sun_label;                  /* looking at sun disklabel */
 #else
@@ -309,7 +309,8 @@
 }
 
 static int
-valid_part_table_flag(const unsigned char *b) {
+valid_part_table_flag(const char *mbuffer) {
+	const unsigned char *b = (const unsigned char *)mbuffer;
 	return (b[510] == 0x55 && b[511] == 0xaa);
 }
 
@@ -2777,7 +2778,7 @@
 	    puts(_("You may change all the disk params from the x menu"));
 	}
 
-	snprintf(sunlabel->info, sizeof(sunlabel->info),
+	snprintf((char *)(sunlabel->info), sizeof(sunlabel->info),
 		 "%s%s%s cyl %d alt %d hd %d sec %d",
 		 p ? p->vendor : "", (p && *p->vendor) ? " " : "",
 		 p ? p->model
@@ -3630,7 +3631,7 @@
 	const struct systypes *types = get_sys_types();
 
 	for (i=0; types[i].name; i++)
-		if (types[i].name[0] == type)
+		if ((unsigned char )types[i].name[0] == type)
 			return types[i].name + 1;
 
 	return _("Unknown");
@@ -3664,7 +3665,8 @@
 
 	do {
 		printf("%c%2x  %-15.15s", i ? ' ' : '\n',
-			sys[next].name[0], partition_type(sys[next].name[0]));
+			(unsigned char)sys[next].name[0],
+			partition_type((unsigned char)sys[next].name[0]));
 		next = last[i++] + done;
 		if (i > 3 || next >= last[i]) {
 			i = 0;
@@ -3932,7 +3934,7 @@
 
 static void
 get_partition_table_geometry(void) {
-	const unsigned char *bufp = MBRbuffer;
+	const unsigned char *bufp = (const unsigned char *)MBRbuffer;
 	struct partition *p;
 	int i, h, s, hh, ss;
 	int first = 1;




More information about the busybox-cvs mailing list