aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-12-16 03:16:05 +0000
committerths <ths@c046a42c-6fe2-441c-8c8c-71466251a162>2007-12-16 03:16:05 +0000
commitffe8ab83da7a3c8cf19c0f8ebeb19db857707410 (patch)
tree90d9e83181498cd5376f5839ee630a1d15a4dc3c
parent60fe76f38605e0e2eedb436d0945af283029c4e0 (diff)
Fix char* signedness, by Andre Przywara.
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3816 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--block-vpc.c2
-rw-r--r--block-vvfat.c20
-rw-r--r--gdbstub.c4
-rw-r--r--hw/pc.c2
-rw-r--r--vl.c19
5 files changed, 24 insertions, 23 deletions
diff --git a/block-vpc.c b/block-vpc.c
index 87b9d69a64..f76c451123 100644
--- a/block-vpc.c
+++ b/block-vpc.c
@@ -81,7 +81,7 @@ typedef struct BDRVVPCState {
static int vpc_probe(const uint8_t *buf, int buf_size, const char *filename)
{
- if (buf_size >= 8 && !strncmp(buf, "conectix", 8))
+ if (buf_size >= 8 && !strncmp((char *)buf, "conectix", 8))
return 100;
return 0;
}
diff --git a/block-vvfat.c b/block-vvfat.c
index 4a3cd356e4..708f031fd8 100644
--- a/block-vvfat.c
+++ b/block-vvfat.c
@@ -565,7 +565,7 @@ static inline uint32_t fat_get(BDRVVVFATState* s,unsigned int cluster)
uint16_t* entry=array_get(&(s->fat),cluster);
return le16_to_cpu(*entry);
} else {
- const uint8_t* x=s->fat.pointer+cluster*3/2;
+ const uint8_t* x=(uint8_t*)(s->fat.pointer)+cluster*3/2;
return ((x[0]|(x[1]<<8))>>(cluster&1?4:0))&0x0fff;
}
}
@@ -626,7 +626,7 @@ static inline direntry_t* create_short_and_long_name(BDRVVVFATState* s,
entry=array_get_next(&(s->directory));
memset(entry->name,0x20,11);
- strncpy(entry->name,filename,i);
+ strncpy((char*)entry->name,filename,i);
if(j > 0)
for (i = 0; i < 3 && filename[j+1+i]; i++)
@@ -868,7 +868,7 @@ static int init_directories(BDRVVVFATState* s,
{
direntry_t* entry=array_get_next(&(s->directory));
entry->attributes=0x28; /* archive | volume label */
- snprintf(entry->name,11,"QEMU VVFAT");
+ snprintf((char*)entry->name,11,"QEMU VVFAT");
}
/* Now build FAT, and write back information into directory */
@@ -1187,7 +1187,7 @@ static inline int read_cluster(BDRVVVFATState *s,int cluster_num)
s->current_mapping = mapping;
read_cluster_directory:
offset = s->cluster_size*(cluster_num-s->current_mapping->begin);
- s->cluster = s->directory.pointer+offset
+ s->cluster = (unsigned char*)s->directory.pointer+offset
+ 0x20*s->current_mapping->info.dir.first_dir_index;
assert(((s->cluster-(unsigned char*)s->directory.pointer)%s->cluster_size)==0);
assert((char*)s->cluster+s->cluster_size <= s->directory.pointer+s->directory.next*s->directory.item_size);
@@ -1457,7 +1457,7 @@ static int parse_long_name(long_file_name* lfn,
}
if (pointer[0] & 0x40)
- lfn->len = offset + strlen(lfn->name + offset);
+ lfn->len = offset + strlen((char*)lfn->name + offset);
return 0;
}
@@ -1496,7 +1496,7 @@ static int parse_short_name(BDRVVVFATState* s,
} else
lfn->name[i + j + 1] = '\0';
- lfn->len = strlen(lfn->name);
+ lfn->len = strlen((char*)lfn->name);
return 0;
}
@@ -1792,8 +1792,8 @@ DLOG(fprintf(stderr, "check direntry %d: \n", i); print_direntry(direntries + i)
fprintf(stderr, "Error in short name (%d)\n", subret);
goto fail;
}
- if (subret > 0 || !strcmp(lfn.name, ".")
- || !strcmp(lfn.name, ".."))
+ if (subret > 0 || !strcmp((char*)lfn.name, ".")
+ || !strcmp((char*)lfn.name, ".."))
continue;
}
lfn.checksum = 0x100; /* cannot use long name twice */
@@ -1802,7 +1802,7 @@ DLOG(fprintf(stderr, "check direntry %d: \n", i); print_direntry(direntries + i)
fprintf(stderr, "Name too long: %s/%s\n", path, lfn.name);
goto fail;
}
- strcpy(path2 + path_len + 1, lfn.name);
+ strcpy(path2 + path_len + 1, (char*)lfn.name);
if (is_directory(direntries + i)) {
if (begin_of_direntry(direntries + i) == 0) {
@@ -2234,7 +2234,7 @@ static int commit_one_file(BDRVVVFATState* s,
assert(size >= 0);
ret = vvfat_read(s->bs, cluster2sector(s, c),
- cluster, (rest_size + 0x1ff) / 0x200);
+ (uint8_t*)cluster, (rest_size + 0x1ff) / 0x200);
if (ret < 0)
return ret;
diff --git a/gdbstub.c b/gdbstub.c
index 3ab89e9df4..64f4a9fffb 100644
--- a/gdbstub.c
+++ b/gdbstub.c
@@ -209,7 +209,7 @@ static int put_packet(GDBState *s, char *buf)
*(p++) = tohex((csum) & 0xf);
s->last_packet_len = p - s->last_packet;
- put_buffer(s, s->last_packet, s->last_packet_len);
+ put_buffer(s, (uint8_t *)s->last_packet, s->last_packet_len);
#ifdef CONFIG_USER_ONLY
i = get_char(s);
@@ -1189,7 +1189,7 @@ static void gdb_read_byte(GDBState *s, int ch)
#ifdef DEBUG_GDB
printf("Got NACK, retransmitting\n");
#endif
- put_buffer(s, s->last_packet, s->last_packet_len);
+ put_buffer(s, (uint8_t *)s->last_packet, s->last_packet_len);
}
#ifdef DEBUG_GDB
else if (ch == '+')
diff --git a/hw/pc.c b/hw/pc.c
index 5f79cda98f..b4f0db7f54 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -552,7 +552,7 @@ static void load_linux(const char *kernel_filename,
initrd_max = ram_size-ACPI_DATA_SIZE-1;
/* kernel command line */
- pstrcpy(cmdline_addr, 4096, kernel_cmdline);
+ pstrcpy((char*)cmdline_addr, 4096, kernel_cmdline);
if (protocol >= 0x202) {
stl_p(header+0x228, cmdline_addr-phys_ram_base);
diff --git a/vl.c b/vl.c
index 596979ab93..3c8ba25ed2 100644
--- a/vl.c
+++ b/vl.c
@@ -1610,7 +1610,7 @@ void qemu_chr_printf(CharDriverState *s, const char *fmt, ...)
va_list ap;
va_start(ap, fmt);
vsnprintf(buf, sizeof(buf), fmt, ap);
- qemu_chr_write(s, buf, strlen(buf));
+ qemu_chr_write(s, (uint8_t *)buf, strlen(buf));
va_end(ap);
}
@@ -1699,7 +1699,7 @@ static int mux_chr_write(CharDriverState *chr, const uint8_t *buf, int len)
(secs / 60) % 60,
secs % 60,
(int)((ti / 1000000) % 1000));
- d->drv->chr_write(d->drv, buf1, strlen(buf1));
+ d->drv->chr_write(d->drv, (uint8_t *)buf1, strlen(buf1));
}
}
}
@@ -1728,15 +1728,16 @@ static void mux_print_help(CharDriverState *chr)
sprintf(cbuf,"\n\r");
sprintf(ebuf,"C-%c", term_escape_char - 1 + 'a');
} else {
- sprintf(cbuf,"\n\rEscape-Char set to Ascii: 0x%02x\n\r\n\r", term_escape_char);
+ sprintf(cbuf,"\n\rEscape-Char set to Ascii: 0x%02x\n\r\n\r",
+ term_escape_char);
}
- chr->chr_write(chr, cbuf, strlen(cbuf));
+ chr->chr_write(chr, (uint8_t *)cbuf, strlen(cbuf));
for (i = 0; mux_help[i] != NULL; i++) {
for (j=0; mux_help[i][j] != '\0'; j++) {
if (mux_help[i][j] == '%')
- chr->chr_write(chr, ebuf, strlen(ebuf));
+ chr->chr_write(chr, (uint8_t *)ebuf, strlen(ebuf));
else
- chr->chr_write(chr, &mux_help[i][j], 1);
+ chr->chr_write(chr, (uint8_t *)&mux_help[i][j], 1);
}
}
}
@@ -1755,7 +1756,7 @@ static int mux_proc_byte(CharDriverState *chr, MuxDriver *d, int ch)
case 'x':
{
char *term = "QEMU: Terminated\n\r";
- chr->chr_write(chr,term,strlen(term));
+ chr->chr_write(chr,(uint8_t *)term,strlen(term));
exit(0);
break;
}
@@ -5778,7 +5779,7 @@ static int qemu_savevm_state(QEMUFile *f)
/* ID string */
len = strlen(se->idstr);
qemu_put_byte(f, len);
- qemu_put_buffer(f, se->idstr, len);
+ qemu_put_buffer(f, (uint8_t *)se->idstr, len);
qemu_put_be32(f, se->instance_id);
qemu_put_be32(f, se->version_id);
@@ -5839,7 +5840,7 @@ static int qemu_loadvm_state(QEMUFile *f)
if (qemu_ftell(f) >= end_pos)
break;
len = qemu_get_byte(f);
- qemu_get_buffer(f, idstr, len);
+ qemu_get_buffer(f, (uint8_t *)idstr, len);
idstr[len] = '\0';
instance_id = qemu_get_be32(f);
version_id = qemu_get_be32(f);