Suppress gcc 4.x -Wpointer-sign (included in -Wall) warnings

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5275 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
blueswir1
2008-09-20 08:07:15 +00:00
parent 67d8cec34b
commit b55266b5a2
25 changed files with 57 additions and 50 deletions
+1 -1
View File
@@ -1418,7 +1418,7 @@ void cpu_set_log(int log_flags)
#if !defined(CONFIG_SOFTMMU)
/* must avoid mmap() usage of glibc by setting a buffer "by hand" */
{
static uint8_t logfile_buf[4096];
static char logfile_buf[4096];
setvbuf(logfile, logfile_buf, _IOLBF, sizeof(logfile_buf));
}
#else
+1 -1
View File
@@ -4987,7 +4987,7 @@ float128 float128_rem( float128 a, float128 b STATUS_PARAM )
sub128( aSig0, aSig1, bSig0, bSig1, &aSig0, &aSig1 );
} while ( 0 <= (sbits64) aSig0 );
add128(
aSig0, aSig1, alternateASig0, alternateASig1, &sigMean0, &sigMean1 );
aSig0, aSig1, alternateASig0, alternateASig1, (bits64 *)&sigMean0, &sigMean1 );
if ( ( sigMean0 < 0 )
|| ( ( ( sigMean0 | sigMean1 ) == 0 ) && ( q & 1 ) ) ) {
aSig0 = alternateASig0;
+2 -1
View File
@@ -701,7 +701,8 @@ static int64_t load_kernel (CPUState *env)
ram_addr_t initrd_offset;
if (load_elf(loaderparams.kernel_filename, VIRT_TO_PHYS_ADDEND,
&kernel_entry, &kernel_low, &kernel_high) < 0) {
(uint64_t *)&kernel_entry, (uint64_t *)&kernel_low,
(uint64_t *)&kernel_high) < 0) {
fprintf(stderr, "qemu: could not load kernel '%s'\n",
loaderparams.kernel_filename);
exit(1);
+2 -1
View File
@@ -61,7 +61,8 @@ static void load_kernel (CPUState *env)
ram_addr_t initrd_offset;
kernel_size = load_elf(loaderparams.kernel_filename, VIRT_TO_PHYS_ADDEND,
&entry, &kernel_low, &kernel_high);
(uint64_t *)&entry, (uint64_t *)&kernel_low,
(uint64_t *)&kernel_high);
if (kernel_size >= 0) {
if ((entry & ~0x7fffffffULL) == 0x80000000)
entry = (int32_t)entry;
+5 -4
View File
@@ -83,7 +83,8 @@ static void load_kernel (CPUState *env)
ram_addr_t initrd_offset;
kernel_size = load_elf(loaderparams.kernel_filename, VIRT_TO_PHYS_ADDEND,
&entry, &kernel_low, &kernel_high);
(uint64_t *)&entry, (uint64_t *)&kernel_low,
(uint64_t *)&kernel_high);
if (kernel_size >= 0) {
if ((entry & ~0x7fffffffULL) == 0x80000000)
entry = (int32_t)entry;
@@ -120,15 +121,15 @@ static void load_kernel (CPUState *env)
/* Store command line. */
if (initrd_size > 0) {
int ret;
ret = sprintf(phys_ram_base + (16 << 20) - 256,
ret = sprintf((char *)(phys_ram_base + (16 << 20) - 256),
"rd_start=0x" TARGET_FMT_lx " rd_size=%li ",
PHYS_TO_VIRT((uint32_t)initrd_offset),
initrd_size);
strcpy (phys_ram_base + (16 << 20) - 256 + ret,
strcpy ((char *)(phys_ram_base + (16 << 20) - 256 + ret),
loaderparams.kernel_cmdline);
}
else {
strcpy (phys_ram_base + (16 << 20) - 256,
strcpy ((char *)(phys_ram_base + (16 << 20) - 256),
loaderparams.kernel_cmdline);
}
+2 -2
View File
@@ -17,12 +17,12 @@ uint16_t NVRAM_get_word (nvram_t *nvram, uint32_t addr);
void NVRAM_set_lword (nvram_t *nvram, uint32_t addr, uint32_t value);
uint32_t NVRAM_get_lword (nvram_t *nvram, uint32_t addr);
void NVRAM_set_string (nvram_t *nvram, uint32_t addr,
const unsigned char *str, uint32_t max);
const char *str, uint32_t max);
int NVRAM_get_string (nvram_t *nvram, uint8_t *dst, uint16_t addr, int max);
void NVRAM_set_crc (nvram_t *nvram, uint32_t addr,
uint32_t start, uint32_t count);
int PPC_NVRAM_set_params (nvram_t *nvram, uint16_t NVRAM_size,
const unsigned char *arch,
const char *arch,
uint32_t RAM_size, int boot_device,
uint32_t kernel_image, uint32_t kernel_size,
const char *cmdline,
+1 -1
View File
@@ -80,7 +80,7 @@ static void pl080_run(pl080_state *s)
int src_id;
int dest_id;
int size;
char buff[4];
uint8_t buff[4];
uint32_t req;
s->tc_mask = 0;
+3 -3
View File
@@ -1305,7 +1305,7 @@ uint32_t NVRAM_get_lword (nvram_t *nvram, uint32_t addr)
}
void NVRAM_set_string (nvram_t *nvram, uint32_t addr,
const unsigned char *str, uint32_t max)
const char *str, uint32_t max)
{
int i;
@@ -1366,7 +1366,7 @@ uint16_t NVRAM_compute_crc (nvram_t *nvram, uint32_t start, uint32_t count)
#define CMDLINE_ADDR 0x017ff000
int PPC_NVRAM_set_params (nvram_t *nvram, uint16_t NVRAM_size,
const unsigned char *arch,
const char *arch,
uint32_t RAM_size, int boot_device,
uint32_t kernel_image, uint32_t kernel_size,
const char *cmdline,
@@ -1387,7 +1387,7 @@ int PPC_NVRAM_set_params (nvram_t *nvram, uint16_t NVRAM_size,
NVRAM_set_lword(nvram, 0x3C, kernel_size);
if (cmdline) {
/* XXX: put the cmdline in NVRAM too ? */
strcpy(phys_ram_base + CMDLINE_ADDR, cmdline);
strcpy((char *)(phys_ram_base + CMDLINE_ADDR), cmdline);
NVRAM_set_lword(nvram, 0x40, CMDLINE_ADDR);
NVRAM_set_lword(nvram, 0x44, strlen(cmdline));
} else {
+1 -1
View File
@@ -26,7 +26,7 @@
#define PPC_4XX_H
/* PowerPC 4xx core initialization */
CPUState *ppc4xx_init (const unsigned char *cpu_model,
CPUState *ppc4xx_init (const char *cpu_model,
clk_setup_t *cpu_clk, clk_setup_t *tb_clk,
uint32_t sysclk);
+1 -1
View File
@@ -35,7 +35,7 @@ extern FILE *logfile;
/*****************************************************************************/
/* Generic PowerPC 4xx processor instanciation */
CPUState *ppc4xx_init (const unsigned char *cpu_model,
CPUState *ppc4xx_init (const char *cpu_model,
clk_setup_t *cpu_clk, clk_setup_t *tb_clk,
uint32_t sysclk)
{
+1 -1
View File
@@ -177,7 +177,7 @@ static void pxa2xx_dma_run(struct pxa2xx_dma_state_s *s)
uint32_t n, size;
uint32_t width;
uint32_t length;
char buffer[32];
uint8_t buffer[32];
struct pxa2xx_dma_channel_s *ch;
if (s->running ++)
+2 -2
View File
@@ -681,8 +681,8 @@ static int ndis_query(USBNetState *s, uint32_t oid,
/* mandatory */
case OID_GEN_VENDOR_DESCRIPTION:
pstrcpy(outbuf, outlen, "QEMU USB RNDIS Net");
return strlen(outbuf) + 1;
pstrcpy((char *)outbuf, outlen, "QEMU USB RNDIS Net");
return strlen((char *)outbuf) + 1;
case OID_GEN_VENDOR_DRIVER_VERSION:
*((le32 *) outbuf) = cpu_to_le32(1);
+1 -1
View File
@@ -1240,7 +1240,7 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs,
}
if (interp_elf_ex.e_ident[0] != 0x7f ||
strncmp(&interp_elf_ex.e_ident[1], "ELF",3) != 0) {
strncmp((char *)&interp_elf_ex.e_ident[1], "ELF",3) != 0) {
interpreter_type &= ~INTERPRETER_ELF;
}
+2 -1
View File
@@ -947,7 +947,8 @@ static abi_long do_getsockopt(int sockfd, int level, int optname,
abi_ulong optval_addr, abi_ulong optlen)
{
abi_long ret;
int len, lv, val;
int len, val;
socklen_t lv;
switch(level) {
case TARGET_SOL_SOCKET:
+1 -1
View File
@@ -62,7 +62,7 @@ abi_long target_strlen(abi_ulong guest_addr1)
ptr = lock_user(VERIFY_READ, guest_addr, max_len, 1);
if (!ptr)
return -TARGET_EFAULT;
len = qemu_strnlen(ptr, max_len);
len = qemu_strnlen((const char *)ptr, max_len);
unlock_user(ptr, guest_addr, 0);
guest_addr += len;
/* we don't allow wrapping or integer overflow */
+2 -1
View File
@@ -172,7 +172,8 @@ static void bootp_reply(struct bootp_t *bp)
}
if (bootp_filename)
snprintf(rbp->bp_file, sizeof(rbp->bp_file), "%s", bootp_filename);
snprintf((char *)rbp->bp_file, sizeof(rbp->bp_file), "%s",
bootp_filename);
dprintf("offered addr=%08x\n", ntohl(daddr.sin_addr.s_addr));
+2 -2
View File
@@ -447,7 +447,7 @@ tcp_connect(inso)
{
struct socket *so;
struct sockaddr_in addr;
int addrlen = sizeof(struct sockaddr_in);
socklen_t addrlen = sizeof(struct sockaddr_in);
struct tcpcb *tp;
int s, opt;
@@ -649,7 +649,7 @@ tcp_emu(so, m)
{
struct socket *tmpso;
struct sockaddr_in addr;
int addrlen = sizeof(struct sockaddr_in);
socklen_t addrlen = sizeof(struct sockaddr_in);
struct sbuf *so_rcv = &so->so_rcv;
memcpy(so_rcv->sb_wptr, m->m_data, m->m_len);
+9 -7
View File
@@ -149,8 +149,10 @@ static int tftp_send_oack(struct tftp_session *spt,
m->m_data += sizeof(struct udpiphdr);
tp->tp_op = htons(TFTP_OACK);
n += snprintf(tp->x.tp_buf + n, sizeof(tp->x.tp_buf) - n, "%s", key) + 1;
n += snprintf(tp->x.tp_buf + n, sizeof(tp->x.tp_buf) - n, "%u", value) + 1;
n += snprintf((char *)tp->x.tp_buf + n, sizeof(tp->x.tp_buf) - n, "%s",
key) + 1;
n += snprintf((char *)tp->x.tp_buf + n, sizeof(tp->x.tp_buf) - n, "%u",
value) + 1;
saddr.sin_addr = recv_tp->ip.ip_dst;
saddr.sin_port = recv_tp->udp.uh_dport;
@@ -190,7 +192,7 @@ static int tftp_send_error(struct tftp_session *spt,
tp->tp_op = htons(TFTP_ERROR);
tp->x.tp_error.tp_error_code = htons(errorcode);
pstrcpy(tp->x.tp_error.tp_msg, sizeof(tp->x.tp_error.tp_msg), msg);
pstrcpy((char *)tp->x.tp_error.tp_msg, sizeof(tp->x.tp_error.tp_msg), msg);
saddr.sin_addr = recv_tp->ip.ip_dst;
saddr.sin_port = recv_tp->udp.uh_dport;
@@ -325,8 +327,8 @@ static void tftp_handle_rrq(struct tftp_t *tp, int pktlen)
/* do sanity checks on the filename */
if ((spt->filename[0] != '/')
|| (spt->filename[strlen(spt->filename) - 1] == '/')
|| strstr(spt->filename, "/../")) {
|| (spt->filename[strlen((char *)spt->filename) - 1] == '/')
|| strstr((char *)spt->filename, "/../")) {
tftp_send_error(spt, 2, "Access violation", tp);
return;
}
@@ -353,7 +355,7 @@ static void tftp_handle_rrq(struct tftp_t *tp, int pktlen)
while (k < n) {
const char *key, *value;
key = src + k;
key = (char *)src + k;
k += strlen(key) + 1;
if (k >= n) {
@@ -361,7 +363,7 @@ static void tftp_handle_rrq(struct tftp_t *tp, int pktlen)
return;
}
value = src + k;
value = (char *)src + k;
k += strlen(value) + 1;
if (strcmp(key, "tsize") == 0) {
+1 -1
View File
@@ -37,7 +37,7 @@ static inline void softmmu_tput32(CPUState *env, uint32_t addr, uint32_t val)
static void *softmmu_lock_user(CPUState *env, uint32_t addr, uint32_t len,
int copy)
{
char *p;
uint8_t *p;
/* TODO: Make this something that isn't fixed size. */
p = malloc(len);
if (copy)
+1 -1
View File
@@ -411,7 +411,7 @@ void cpu_dump_state (CPUState *env, FILE *f,
int (*cpu_fprintf)(FILE *f, const char *fmt, ...),
int flags)
{
static const unsigned char *linux_reg_names[] = {
static const char *linux_reg_names[] = {
"v0 ", "t0 ", "t1 ", "t2 ", "t3 ", "t4 ", "t5 ", "t6 ",
"t7 ", "s0 ", "s1 ", "s2 ", "s3 ", "s4 ", "s5 ", "fp ",
"a0 ", "a1 ", "a2 ", "a3 ", "a4 ", "a5 ", "t8 ", "t9 ",

Some files were not shown because too many files have changed in this diff Show More