reduce signedness warning

This commit is contained in:
"Vladimir N. Oleynik" 2005-12-02 10:06:04 +00:00
parent 27d42a08c8
commit a972c870a8

View File

@ -106,7 +106,7 @@ struct hd_geometry {
struct systypes {
const unsigned char *name;
const char *name;
};
static uint sector_size = DEFAULT_SECTOR_SIZE,
@ -309,7 +309,8 @@ str_units(int n) { /* n==1: use singular */
}
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 @@ static void create_sunlabel(void)
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 @@ static const char *partition_type(unsigned char type)
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 @@ void list_types(const struct systypes *sys)
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 @@ get_kernel_geometry(void) {
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;