Commit b55266b5a235afe7b0aa946e2a6d49010f35e71c
1 parent
67d8cec3
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
Showing
25 changed files
with
57 additions
and
50 deletions
exec.c
| @@ -1418,7 +1418,7 @@ void cpu_set_log(int log_flags) | @@ -1418,7 +1418,7 @@ void cpu_set_log(int log_flags) | ||
| 1418 | #if !defined(CONFIG_SOFTMMU) | 1418 | #if !defined(CONFIG_SOFTMMU) |
| 1419 | /* must avoid mmap() usage of glibc by setting a buffer "by hand" */ | 1419 | /* must avoid mmap() usage of glibc by setting a buffer "by hand" */ |
| 1420 | { | 1420 | { |
| 1421 | - static uint8_t logfile_buf[4096]; | 1421 | + static char logfile_buf[4096]; |
| 1422 | setvbuf(logfile, logfile_buf, _IOLBF, sizeof(logfile_buf)); | 1422 | setvbuf(logfile, logfile_buf, _IOLBF, sizeof(logfile_buf)); |
| 1423 | } | 1423 | } |
| 1424 | #else | 1424 | #else |
fpu/softfloat.c
| @@ -4987,7 +4987,7 @@ float128 float128_rem( float128 a, float128 b STATUS_PARAM ) | @@ -4987,7 +4987,7 @@ float128 float128_rem( float128 a, float128 b STATUS_PARAM ) | ||
| 4987 | sub128( aSig0, aSig1, bSig0, bSig1, &aSig0, &aSig1 ); | 4987 | sub128( aSig0, aSig1, bSig0, bSig1, &aSig0, &aSig1 ); |
| 4988 | } while ( 0 <= (sbits64) aSig0 ); | 4988 | } while ( 0 <= (sbits64) aSig0 ); |
| 4989 | add128( | 4989 | add128( |
| 4990 | - aSig0, aSig1, alternateASig0, alternateASig1, &sigMean0, &sigMean1 ); | 4990 | + aSig0, aSig1, alternateASig0, alternateASig1, (bits64 *)&sigMean0, &sigMean1 ); |
| 4991 | if ( ( sigMean0 < 0 ) | 4991 | if ( ( sigMean0 < 0 ) |
| 4992 | || ( ( ( sigMean0 | sigMean1 ) == 0 ) && ( q & 1 ) ) ) { | 4992 | || ( ( ( sigMean0 | sigMean1 ) == 0 ) && ( q & 1 ) ) ) { |
| 4993 | aSig0 = alternateASig0; | 4993 | aSig0 = alternateASig0; |
hw/mips_malta.c
| @@ -701,7 +701,8 @@ static int64_t load_kernel (CPUState *env) | @@ -701,7 +701,8 @@ static int64_t load_kernel (CPUState *env) | ||
| 701 | ram_addr_t initrd_offset; | 701 | ram_addr_t initrd_offset; |
| 702 | 702 | ||
| 703 | if (load_elf(loaderparams.kernel_filename, VIRT_TO_PHYS_ADDEND, | 703 | if (load_elf(loaderparams.kernel_filename, VIRT_TO_PHYS_ADDEND, |
| 704 | - &kernel_entry, &kernel_low, &kernel_high) < 0) { | 704 | + (uint64_t *)&kernel_entry, (uint64_t *)&kernel_low, |
| 705 | + (uint64_t *)&kernel_high) < 0) { | ||
| 705 | fprintf(stderr, "qemu: could not load kernel '%s'\n", | 706 | fprintf(stderr, "qemu: could not load kernel '%s'\n", |
| 706 | loaderparams.kernel_filename); | 707 | loaderparams.kernel_filename); |
| 707 | exit(1); | 708 | exit(1); |
hw/mips_mipssim.c
| @@ -61,7 +61,8 @@ static void load_kernel (CPUState *env) | @@ -61,7 +61,8 @@ static void load_kernel (CPUState *env) | ||
| 61 | ram_addr_t initrd_offset; | 61 | ram_addr_t initrd_offset; |
| 62 | 62 | ||
| 63 | kernel_size = load_elf(loaderparams.kernel_filename, VIRT_TO_PHYS_ADDEND, | 63 | kernel_size = load_elf(loaderparams.kernel_filename, VIRT_TO_PHYS_ADDEND, |
| 64 | - &entry, &kernel_low, &kernel_high); | 64 | + (uint64_t *)&entry, (uint64_t *)&kernel_low, |
| 65 | + (uint64_t *)&kernel_high); | ||
| 65 | if (kernel_size >= 0) { | 66 | if (kernel_size >= 0) { |
| 66 | if ((entry & ~0x7fffffffULL) == 0x80000000) | 67 | if ((entry & ~0x7fffffffULL) == 0x80000000) |
| 67 | entry = (int32_t)entry; | 68 | entry = (int32_t)entry; |
hw/mips_r4k.c
| @@ -83,7 +83,8 @@ static void load_kernel (CPUState *env) | @@ -83,7 +83,8 @@ static void load_kernel (CPUState *env) | ||
| 83 | ram_addr_t initrd_offset; | 83 | ram_addr_t initrd_offset; |
| 84 | 84 | ||
| 85 | kernel_size = load_elf(loaderparams.kernel_filename, VIRT_TO_PHYS_ADDEND, | 85 | kernel_size = load_elf(loaderparams.kernel_filename, VIRT_TO_PHYS_ADDEND, |
| 86 | - &entry, &kernel_low, &kernel_high); | 86 | + (uint64_t *)&entry, (uint64_t *)&kernel_low, |
| 87 | + (uint64_t *)&kernel_high); | ||
| 87 | if (kernel_size >= 0) { | 88 | if (kernel_size >= 0) { |
| 88 | if ((entry & ~0x7fffffffULL) == 0x80000000) | 89 | if ((entry & ~0x7fffffffULL) == 0x80000000) |
| 89 | entry = (int32_t)entry; | 90 | entry = (int32_t)entry; |
| @@ -120,15 +121,15 @@ static void load_kernel (CPUState *env) | @@ -120,15 +121,15 @@ static void load_kernel (CPUState *env) | ||
| 120 | /* Store command line. */ | 121 | /* Store command line. */ |
| 121 | if (initrd_size > 0) { | 122 | if (initrd_size > 0) { |
| 122 | int ret; | 123 | int ret; |
| 123 | - ret = sprintf(phys_ram_base + (16 << 20) - 256, | 124 | + ret = sprintf((char *)(phys_ram_base + (16 << 20) - 256), |
| 124 | "rd_start=0x" TARGET_FMT_lx " rd_size=%li ", | 125 | "rd_start=0x" TARGET_FMT_lx " rd_size=%li ", |
| 125 | PHYS_TO_VIRT((uint32_t)initrd_offset), | 126 | PHYS_TO_VIRT((uint32_t)initrd_offset), |
| 126 | initrd_size); | 127 | initrd_size); |
| 127 | - strcpy (phys_ram_base + (16 << 20) - 256 + ret, | 128 | + strcpy ((char *)(phys_ram_base + (16 << 20) - 256 + ret), |
| 128 | loaderparams.kernel_cmdline); | 129 | loaderparams.kernel_cmdline); |
| 129 | } | 130 | } |
| 130 | else { | 131 | else { |
| 131 | - strcpy (phys_ram_base + (16 << 20) - 256, | 132 | + strcpy ((char *)(phys_ram_base + (16 << 20) - 256), |
| 132 | loaderparams.kernel_cmdline); | 133 | loaderparams.kernel_cmdline); |
| 133 | } | 134 | } |
| 134 | 135 |
hw/nvram.h
| @@ -17,12 +17,12 @@ uint16_t NVRAM_get_word (nvram_t *nvram, uint32_t addr); | @@ -17,12 +17,12 @@ uint16_t NVRAM_get_word (nvram_t *nvram, uint32_t addr); | ||
| 17 | void NVRAM_set_lword (nvram_t *nvram, uint32_t addr, uint32_t value); | 17 | void NVRAM_set_lword (nvram_t *nvram, uint32_t addr, uint32_t value); |
| 18 | uint32_t NVRAM_get_lword (nvram_t *nvram, uint32_t addr); | 18 | uint32_t NVRAM_get_lword (nvram_t *nvram, uint32_t addr); |
| 19 | void NVRAM_set_string (nvram_t *nvram, uint32_t addr, | 19 | void NVRAM_set_string (nvram_t *nvram, uint32_t addr, |
| 20 | - const unsigned char *str, uint32_t max); | 20 | + const char *str, uint32_t max); |
| 21 | int NVRAM_get_string (nvram_t *nvram, uint8_t *dst, uint16_t addr, int max); | 21 | int NVRAM_get_string (nvram_t *nvram, uint8_t *dst, uint16_t addr, int max); |
| 22 | void NVRAM_set_crc (nvram_t *nvram, uint32_t addr, | 22 | void NVRAM_set_crc (nvram_t *nvram, uint32_t addr, |
| 23 | uint32_t start, uint32_t count); | 23 | uint32_t start, uint32_t count); |
| 24 | int PPC_NVRAM_set_params (nvram_t *nvram, uint16_t NVRAM_size, | 24 | int PPC_NVRAM_set_params (nvram_t *nvram, uint16_t NVRAM_size, |
| 25 | - const unsigned char *arch, | 25 | + const char *arch, |
| 26 | uint32_t RAM_size, int boot_device, | 26 | uint32_t RAM_size, int boot_device, |
| 27 | uint32_t kernel_image, uint32_t kernel_size, | 27 | uint32_t kernel_image, uint32_t kernel_size, |
| 28 | const char *cmdline, | 28 | const char *cmdline, |
hw/pl080.c
| @@ -80,7 +80,7 @@ static void pl080_run(pl080_state *s) | @@ -80,7 +80,7 @@ static void pl080_run(pl080_state *s) | ||
| 80 | int src_id; | 80 | int src_id; |
| 81 | int dest_id; | 81 | int dest_id; |
| 82 | int size; | 82 | int size; |
| 83 | - char buff[4]; | 83 | + uint8_t buff[4]; |
| 84 | uint32_t req; | 84 | uint32_t req; |
| 85 | 85 | ||
| 86 | s->tc_mask = 0; | 86 | s->tc_mask = 0; |
hw/ppc.c
| @@ -1305,7 +1305,7 @@ uint32_t NVRAM_get_lword (nvram_t *nvram, uint32_t addr) | @@ -1305,7 +1305,7 @@ uint32_t NVRAM_get_lword (nvram_t *nvram, uint32_t addr) | ||
| 1305 | } | 1305 | } |
| 1306 | 1306 | ||
| 1307 | void NVRAM_set_string (nvram_t *nvram, uint32_t addr, | 1307 | void NVRAM_set_string (nvram_t *nvram, uint32_t addr, |
| 1308 | - const unsigned char *str, uint32_t max) | 1308 | + const char *str, uint32_t max) |
| 1309 | { | 1309 | { |
| 1310 | int i; | 1310 | int i; |
| 1311 | 1311 | ||
| @@ -1366,7 +1366,7 @@ uint16_t NVRAM_compute_crc (nvram_t *nvram, uint32_t start, uint32_t count) | @@ -1366,7 +1366,7 @@ uint16_t NVRAM_compute_crc (nvram_t *nvram, uint32_t start, uint32_t count) | ||
| 1366 | #define CMDLINE_ADDR 0x017ff000 | 1366 | #define CMDLINE_ADDR 0x017ff000 |
| 1367 | 1367 | ||
| 1368 | int PPC_NVRAM_set_params (nvram_t *nvram, uint16_t NVRAM_size, | 1368 | int PPC_NVRAM_set_params (nvram_t *nvram, uint16_t NVRAM_size, |
| 1369 | - const unsigned char *arch, | 1369 | + const char *arch, |
| 1370 | uint32_t RAM_size, int boot_device, | 1370 | uint32_t RAM_size, int boot_device, |
| 1371 | uint32_t kernel_image, uint32_t kernel_size, | 1371 | uint32_t kernel_image, uint32_t kernel_size, |
| 1372 | const char *cmdline, | 1372 | const char *cmdline, |
| @@ -1387,7 +1387,7 @@ int PPC_NVRAM_set_params (nvram_t *nvram, uint16_t NVRAM_size, | @@ -1387,7 +1387,7 @@ int PPC_NVRAM_set_params (nvram_t *nvram, uint16_t NVRAM_size, | ||
| 1387 | NVRAM_set_lword(nvram, 0x3C, kernel_size); | 1387 | NVRAM_set_lword(nvram, 0x3C, kernel_size); |
| 1388 | if (cmdline) { | 1388 | if (cmdline) { |
| 1389 | /* XXX: put the cmdline in NVRAM too ? */ | 1389 | /* XXX: put the cmdline in NVRAM too ? */ |
| 1390 | - strcpy(phys_ram_base + CMDLINE_ADDR, cmdline); | 1390 | + strcpy((char *)(phys_ram_base + CMDLINE_ADDR), cmdline); |
| 1391 | NVRAM_set_lword(nvram, 0x40, CMDLINE_ADDR); | 1391 | NVRAM_set_lword(nvram, 0x40, CMDLINE_ADDR); |
| 1392 | NVRAM_set_lword(nvram, 0x44, strlen(cmdline)); | 1392 | NVRAM_set_lword(nvram, 0x44, strlen(cmdline)); |
| 1393 | } else { | 1393 | } else { |
hw/ppc4xx.h
| @@ -26,7 +26,7 @@ | @@ -26,7 +26,7 @@ | ||
| 26 | #define PPC_4XX_H | 26 | #define PPC_4XX_H |
| 27 | 27 | ||
| 28 | /* PowerPC 4xx core initialization */ | 28 | /* PowerPC 4xx core initialization */ |
| 29 | -CPUState *ppc4xx_init (const unsigned char *cpu_model, | 29 | +CPUState *ppc4xx_init (const char *cpu_model, |
| 30 | clk_setup_t *cpu_clk, clk_setup_t *tb_clk, | 30 | clk_setup_t *cpu_clk, clk_setup_t *tb_clk, |
| 31 | uint32_t sysclk); | 31 | uint32_t sysclk); |
| 32 | 32 |
hw/ppc4xx_devs.c
| @@ -35,7 +35,7 @@ extern FILE *logfile; | @@ -35,7 +35,7 @@ extern FILE *logfile; | ||
| 35 | 35 | ||
| 36 | /*****************************************************************************/ | 36 | /*****************************************************************************/ |
| 37 | /* Generic PowerPC 4xx processor instanciation */ | 37 | /* Generic PowerPC 4xx processor instanciation */ |
| 38 | -CPUState *ppc4xx_init (const unsigned char *cpu_model, | 38 | +CPUState *ppc4xx_init (const char *cpu_model, |
| 39 | clk_setup_t *cpu_clk, clk_setup_t *tb_clk, | 39 | clk_setup_t *cpu_clk, clk_setup_t *tb_clk, |
| 40 | uint32_t sysclk) | 40 | uint32_t sysclk) |
| 41 | { | 41 | { |
hw/pxa2xx_dma.c
| @@ -177,7 +177,7 @@ static void pxa2xx_dma_run(struct pxa2xx_dma_state_s *s) | @@ -177,7 +177,7 @@ static void pxa2xx_dma_run(struct pxa2xx_dma_state_s *s) | ||
| 177 | uint32_t n, size; | 177 | uint32_t n, size; |
| 178 | uint32_t width; | 178 | uint32_t width; |
| 179 | uint32_t length; | 179 | uint32_t length; |
| 180 | - char buffer[32]; | 180 | + uint8_t buffer[32]; |
| 181 | struct pxa2xx_dma_channel_s *ch; | 181 | struct pxa2xx_dma_channel_s *ch; |
| 182 | 182 | ||
| 183 | if (s->running ++) | 183 | if (s->running ++) |
hw/usb-net.c
| @@ -681,8 +681,8 @@ static int ndis_query(USBNetState *s, uint32_t oid, | @@ -681,8 +681,8 @@ static int ndis_query(USBNetState *s, uint32_t oid, | ||
| 681 | 681 | ||
| 682 | /* mandatory */ | 682 | /* mandatory */ |
| 683 | case OID_GEN_VENDOR_DESCRIPTION: | 683 | case OID_GEN_VENDOR_DESCRIPTION: |
| 684 | - pstrcpy(outbuf, outlen, "QEMU USB RNDIS Net"); | ||
| 685 | - return strlen(outbuf) + 1; | 684 | + pstrcpy((char *)outbuf, outlen, "QEMU USB RNDIS Net"); |
| 685 | + return strlen((char *)outbuf) + 1; | ||
| 686 | 686 | ||
| 687 | case OID_GEN_VENDOR_DRIVER_VERSION: | 687 | case OID_GEN_VENDOR_DRIVER_VERSION: |
| 688 | *((le32 *) outbuf) = cpu_to_le32(1); | 688 | *((le32 *) outbuf) = cpu_to_le32(1); |
linux-user/elfload.c
| @@ -1240,7 +1240,7 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, | @@ -1240,7 +1240,7 @@ int load_elf_binary(struct linux_binprm * bprm, struct target_pt_regs * regs, | ||
| 1240 | } | 1240 | } |
| 1241 | 1241 | ||
| 1242 | if (interp_elf_ex.e_ident[0] != 0x7f || | 1242 | if (interp_elf_ex.e_ident[0] != 0x7f || |
| 1243 | - strncmp(&interp_elf_ex.e_ident[1], "ELF",3) != 0) { | 1243 | + strncmp((char *)&interp_elf_ex.e_ident[1], "ELF",3) != 0) { |
| 1244 | interpreter_type &= ~INTERPRETER_ELF; | 1244 | interpreter_type &= ~INTERPRETER_ELF; |
| 1245 | } | 1245 | } |
| 1246 | 1246 |
linux-user/syscall.c
| @@ -947,7 +947,8 @@ static abi_long do_getsockopt(int sockfd, int level, int optname, | @@ -947,7 +947,8 @@ static abi_long do_getsockopt(int sockfd, int level, int optname, | ||
| 947 | abi_ulong optval_addr, abi_ulong optlen) | 947 | abi_ulong optval_addr, abi_ulong optlen) |
| 948 | { | 948 | { |
| 949 | abi_long ret; | 949 | abi_long ret; |
| 950 | - int len, lv, val; | 950 | + int len, val; |
| 951 | + socklen_t lv; | ||
| 951 | 952 | ||
| 952 | switch(level) { | 953 | switch(level) { |
| 953 | case TARGET_SOL_SOCKET: | 954 | case TARGET_SOL_SOCKET: |
linux-user/uaccess.c
| @@ -62,7 +62,7 @@ abi_long target_strlen(abi_ulong guest_addr1) | @@ -62,7 +62,7 @@ abi_long target_strlen(abi_ulong guest_addr1) | ||
| 62 | ptr = lock_user(VERIFY_READ, guest_addr, max_len, 1); | 62 | ptr = lock_user(VERIFY_READ, guest_addr, max_len, 1); |
| 63 | if (!ptr) | 63 | if (!ptr) |
| 64 | return -TARGET_EFAULT; | 64 | return -TARGET_EFAULT; |
| 65 | - len = qemu_strnlen(ptr, max_len); | 65 | + len = qemu_strnlen((const char *)ptr, max_len); |
| 66 | unlock_user(ptr, guest_addr, 0); | 66 | unlock_user(ptr, guest_addr, 0); |
| 67 | guest_addr += len; | 67 | guest_addr += len; |
| 68 | /* we don't allow wrapping or integer overflow */ | 68 | /* we don't allow wrapping or integer overflow */ |
slirp/bootp.c
| @@ -172,7 +172,8 @@ static void bootp_reply(struct bootp_t *bp) | @@ -172,7 +172,8 @@ static void bootp_reply(struct bootp_t *bp) | ||
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | if (bootp_filename) | 174 | if (bootp_filename) |
| 175 | - snprintf(rbp->bp_file, sizeof(rbp->bp_file), "%s", bootp_filename); | 175 | + snprintf((char *)rbp->bp_file, sizeof(rbp->bp_file), "%s", |
| 176 | + bootp_filename); | ||
| 176 | 177 | ||
| 177 | dprintf("offered addr=%08x\n", ntohl(daddr.sin_addr.s_addr)); | 178 | dprintf("offered addr=%08x\n", ntohl(daddr.sin_addr.s_addr)); |
| 178 | 179 |
slirp/tcp_subr.c
| @@ -447,7 +447,7 @@ tcp_connect(inso) | @@ -447,7 +447,7 @@ tcp_connect(inso) | ||
| 447 | { | 447 | { |
| 448 | struct socket *so; | 448 | struct socket *so; |
| 449 | struct sockaddr_in addr; | 449 | struct sockaddr_in addr; |
| 450 | - int addrlen = sizeof(struct sockaddr_in); | 450 | + socklen_t addrlen = sizeof(struct sockaddr_in); |
| 451 | struct tcpcb *tp; | 451 | struct tcpcb *tp; |
| 452 | int s, opt; | 452 | int s, opt; |
| 453 | 453 | ||
| @@ -649,7 +649,7 @@ tcp_emu(so, m) | @@ -649,7 +649,7 @@ tcp_emu(so, m) | ||
| 649 | { | 649 | { |
| 650 | struct socket *tmpso; | 650 | struct socket *tmpso; |
| 651 | struct sockaddr_in addr; | 651 | struct sockaddr_in addr; |
| 652 | - int addrlen = sizeof(struct sockaddr_in); | 652 | + socklen_t addrlen = sizeof(struct sockaddr_in); |
| 653 | struct sbuf *so_rcv = &so->so_rcv; | 653 | struct sbuf *so_rcv = &so->so_rcv; |
| 654 | 654 | ||
| 655 | memcpy(so_rcv->sb_wptr, m->m_data, m->m_len); | 655 | memcpy(so_rcv->sb_wptr, m->m_data, m->m_len); |
slirp/tftp.c
| @@ -149,8 +149,10 @@ static int tftp_send_oack(struct tftp_session *spt, | @@ -149,8 +149,10 @@ static int tftp_send_oack(struct tftp_session *spt, | ||
| 149 | m->m_data += sizeof(struct udpiphdr); | 149 | m->m_data += sizeof(struct udpiphdr); |
| 150 | 150 | ||
| 151 | tp->tp_op = htons(TFTP_OACK); | 151 | tp->tp_op = htons(TFTP_OACK); |
| 152 | - n += snprintf(tp->x.tp_buf + n, sizeof(tp->x.tp_buf) - n, "%s", key) + 1; | ||
| 153 | - n += snprintf(tp->x.tp_buf + n, sizeof(tp->x.tp_buf) - n, "%u", value) + 1; | 152 | + n += snprintf((char *)tp->x.tp_buf + n, sizeof(tp->x.tp_buf) - n, "%s", |
| 153 | + key) + 1; | ||
| 154 | + n += snprintf((char *)tp->x.tp_buf + n, sizeof(tp->x.tp_buf) - n, "%u", | ||
| 155 | + value) + 1; | ||
| 154 | 156 | ||
| 155 | saddr.sin_addr = recv_tp->ip.ip_dst; | 157 | saddr.sin_addr = recv_tp->ip.ip_dst; |
| 156 | saddr.sin_port = recv_tp->udp.uh_dport; | 158 | saddr.sin_port = recv_tp->udp.uh_dport; |
| @@ -190,7 +192,7 @@ static int tftp_send_error(struct tftp_session *spt, | @@ -190,7 +192,7 @@ static int tftp_send_error(struct tftp_session *spt, | ||
| 190 | 192 | ||
| 191 | tp->tp_op = htons(TFTP_ERROR); | 193 | tp->tp_op = htons(TFTP_ERROR); |
| 192 | tp->x.tp_error.tp_error_code = htons(errorcode); | 194 | tp->x.tp_error.tp_error_code = htons(errorcode); |
| 193 | - pstrcpy(tp->x.tp_error.tp_msg, sizeof(tp->x.tp_error.tp_msg), msg); | 195 | + pstrcpy((char *)tp->x.tp_error.tp_msg, sizeof(tp->x.tp_error.tp_msg), msg); |
| 194 | 196 | ||
| 195 | saddr.sin_addr = recv_tp->ip.ip_dst; | 197 | saddr.sin_addr = recv_tp->ip.ip_dst; |
| 196 | saddr.sin_port = recv_tp->udp.uh_dport; | 198 | saddr.sin_port = recv_tp->udp.uh_dport; |
| @@ -325,8 +327,8 @@ static void tftp_handle_rrq(struct tftp_t *tp, int pktlen) | @@ -325,8 +327,8 @@ static void tftp_handle_rrq(struct tftp_t *tp, int pktlen) | ||
| 325 | /* do sanity checks on the filename */ | 327 | /* do sanity checks on the filename */ |
| 326 | 328 | ||
| 327 | if ((spt->filename[0] != '/') | 329 | if ((spt->filename[0] != '/') |
| 328 | - || (spt->filename[strlen(spt->filename) - 1] == '/') | ||
| 329 | - || strstr(spt->filename, "/../")) { | 330 | + || (spt->filename[strlen((char *)spt->filename) - 1] == '/') |
| 331 | + || strstr((char *)spt->filename, "/../")) { | ||
| 330 | tftp_send_error(spt, 2, "Access violation", tp); | 332 | tftp_send_error(spt, 2, "Access violation", tp); |
| 331 | return; | 333 | return; |
| 332 | } | 334 | } |
| @@ -353,7 +355,7 @@ static void tftp_handle_rrq(struct tftp_t *tp, int pktlen) | @@ -353,7 +355,7 @@ static void tftp_handle_rrq(struct tftp_t *tp, int pktlen) | ||
| 353 | while (k < n) { | 355 | while (k < n) { |
| 354 | const char *key, *value; | 356 | const char *key, *value; |
| 355 | 357 | ||
| 356 | - key = src + k; | 358 | + key = (char *)src + k; |
| 357 | k += strlen(key) + 1; | 359 | k += strlen(key) + 1; |
| 358 | 360 | ||
| 359 | if (k >= n) { | 361 | if (k >= n) { |
| @@ -361,7 +363,7 @@ static void tftp_handle_rrq(struct tftp_t *tp, int pktlen) | @@ -361,7 +363,7 @@ static void tftp_handle_rrq(struct tftp_t *tp, int pktlen) | ||
| 361 | return; | 363 | return; |
| 362 | } | 364 | } |
| 363 | 365 | ||
| 364 | - value = src + k; | 366 | + value = (char *)src + k; |
| 365 | k += strlen(value) + 1; | 367 | k += strlen(value) + 1; |
| 366 | 368 | ||
| 367 | if (strcmp(key, "tsize") == 0) { | 369 | if (strcmp(key, "tsize") == 0) { |
softmmu-semi.h
| @@ -37,7 +37,7 @@ static inline void softmmu_tput32(CPUState *env, uint32_t addr, uint32_t val) | @@ -37,7 +37,7 @@ static inline void softmmu_tput32(CPUState *env, uint32_t addr, uint32_t val) | ||
| 37 | static void *softmmu_lock_user(CPUState *env, uint32_t addr, uint32_t len, | 37 | static void *softmmu_lock_user(CPUState *env, uint32_t addr, uint32_t len, |
| 38 | int copy) | 38 | int copy) |
| 39 | { | 39 | { |
| 40 | - char *p; | 40 | + uint8_t *p; |
| 41 | /* TODO: Make this something that isn't fixed size. */ | 41 | /* TODO: Make this something that isn't fixed size. */ |
| 42 | p = malloc(len); | 42 | p = malloc(len); |
| 43 | if (copy) | 43 | if (copy) |
target-alpha/helper.c
| @@ -411,7 +411,7 @@ void cpu_dump_state (CPUState *env, FILE *f, | @@ -411,7 +411,7 @@ void cpu_dump_state (CPUState *env, FILE *f, | ||
| 411 | int (*cpu_fprintf)(FILE *f, const char *fmt, ...), | 411 | int (*cpu_fprintf)(FILE *f, const char *fmt, ...), |
| 412 | int flags) | 412 | int flags) |
| 413 | { | 413 | { |
| 414 | - static const unsigned char *linux_reg_names[] = { | 414 | + static const char *linux_reg_names[] = { |
| 415 | "v0 ", "t0 ", "t1 ", "t2 ", "t3 ", "t4 ", "t5 ", "t6 ", | 415 | "v0 ", "t0 ", "t1 ", "t2 ", "t3 ", "t4 ", "t5 ", "t6 ", |
| 416 | "t7 ", "s0 ", "s1 ", "s2 ", "s3 ", "s4 ", "s5 ", "fp ", | 416 | "t7 ", "s0 ", "s1 ", "s2 ", "s3 ", "s4 ", "s5 ", "fp ", |
| 417 | "a0 ", "a1 ", "a2 ", "a3 ", "a4 ", "a5 ", "t8 ", "t9 ", | 417 | "a0 ", "a1 ", "a2 ", "a3 ", "a4 ", "a5 ", "t8 ", "t9 ", |
target-ppc/cpu.h
| @@ -303,7 +303,7 @@ struct ppc_spr_t { | @@ -303,7 +303,7 @@ struct ppc_spr_t { | ||
| 303 | void (*hea_read)(void *opaque, int spr_num); | 303 | void (*hea_read)(void *opaque, int spr_num); |
| 304 | void (*hea_write)(void *opaque, int spr_num); | 304 | void (*hea_write)(void *opaque, int spr_num); |
| 305 | #endif | 305 | #endif |
| 306 | - const unsigned char *name; | 306 | + const char *name; |
| 307 | }; | 307 | }; |
| 308 | 308 | ||
| 309 | /* Altivec registers (128 bits) */ | 309 | /* Altivec registers (128 bits) */ |
| @@ -733,7 +733,7 @@ void cpu_ppc_reset (void *opaque); | @@ -733,7 +733,7 @@ void cpu_ppc_reset (void *opaque); | ||
| 733 | 733 | ||
| 734 | void ppc_cpu_list (FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...)); | 734 | void ppc_cpu_list (FILE *f, int (*cpu_fprintf)(FILE *f, const char *fmt, ...)); |
| 735 | 735 | ||
| 736 | -const ppc_def_t *cpu_ppc_find_by_name (const unsigned char *name); | 736 | +const ppc_def_t *cpu_ppc_find_by_name (const char *name); |
| 737 | int cpu_ppc_register_internal (CPUPPCState *env, const ppc_def_t *def); | 737 | int cpu_ppc_register_internal (CPUPPCState *env, const ppc_def_t *def); |
| 738 | 738 | ||
| 739 | /* Time-base and decrementer management */ | 739 | /* Time-base and decrementer management */ |
target-ppc/op_helper.c
| @@ -244,7 +244,7 @@ void do_mulldo (void) | @@ -244,7 +244,7 @@ void do_mulldo (void) | ||
| 244 | int64_t th; | 244 | int64_t th; |
| 245 | uint64_t tl; | 245 | uint64_t tl; |
| 246 | 246 | ||
| 247 | - muls64(&tl, &th, T0, T1); | 247 | + muls64(&tl, (uint64_t *)&th, T0, T1); |
| 248 | T0 = (int64_t)tl; | 248 | T0 = (int64_t)tl; |
| 249 | /* If th != 0 && th != -1, then we had an overflow */ | 249 | /* If th != 0 && th != -1, then we had an overflow */ |
| 250 | if (likely((uint64_t)(th + 1) <= 1)) { | 250 | if (likely((uint64_t)(th + 1) <= 1)) { |
target-ppc/translate.c
| @@ -220,7 +220,7 @@ struct opc_handler_t { | @@ -220,7 +220,7 @@ struct opc_handler_t { | ||
| 220 | /* handler */ | 220 | /* handler */ |
| 221 | void (*handler)(DisasContext *ctx); | 221 | void (*handler)(DisasContext *ctx); |
| 222 | #if defined(DO_PPC_STATISTICS) || defined(PPC_DUMP_CPU) | 222 | #if defined(DO_PPC_STATISTICS) || defined(PPC_DUMP_CPU) |
| 223 | - const unsigned char *oname; | 223 | + const char *oname; |
| 224 | #endif | 224 | #endif |
| 225 | #if defined(DO_PPC_STATISTICS) | 225 | #if defined(DO_PPC_STATISTICS) |
| 226 | uint64_t count; | 226 | uint64_t count; |
| @@ -347,7 +347,7 @@ typedef struct opcode_t { | @@ -347,7 +347,7 @@ typedef struct opcode_t { | ||
| 347 | unsigned char pad[1]; | 347 | unsigned char pad[1]; |
| 348 | #endif | 348 | #endif |
| 349 | opc_handler_t handler; | 349 | opc_handler_t handler; |
| 350 | - const unsigned char *oname; | 350 | + const char *oname; |
| 351 | } opcode_t; | 351 | } opcode_t; |
| 352 | 352 | ||
| 353 | /*****************************************************************************/ | 353 | /*****************************************************************************/ |
target-ppc/translate_init.c
| @@ -34,7 +34,7 @@ | @@ -34,7 +34,7 @@ | ||
| 34 | #endif | 34 | #endif |
| 35 | 35 | ||
| 36 | struct ppc_def_t { | 36 | struct ppc_def_t { |
| 37 | - const unsigned char *name; | 37 | + const char *name; |
| 38 | uint32_t pvr; | 38 | uint32_t pvr; |
| 39 | uint32_t svr; | 39 | uint32_t svr; |
| 40 | uint64_t insns_flags; | 40 | uint64_t insns_flags; |
| @@ -433,13 +433,13 @@ do { \ | @@ -433,13 +433,13 @@ do { \ | ||
| 433 | _spr_register(env, num, name, uea_read, uea_write, initial_value); \ | 433 | _spr_register(env, num, name, uea_read, uea_write, initial_value); \ |
| 434 | } while (0) | 434 | } while (0) |
| 435 | static inline void _spr_register (CPUPPCState *env, int num, | 435 | static inline void _spr_register (CPUPPCState *env, int num, |
| 436 | - const unsigned char *name, | 436 | + const char *name, |
| 437 | void (*uea_read)(void *opaque, int sprn), | 437 | void (*uea_read)(void *opaque, int sprn), |
| 438 | void (*uea_write)(void *opaque, int sprn), | 438 | void (*uea_write)(void *opaque, int sprn), |
| 439 | target_ulong initial_value) | 439 | target_ulong initial_value) |
| 440 | #else | 440 | #else |
| 441 | static inline void spr_register (CPUPPCState *env, int num, | 441 | static inline void spr_register (CPUPPCState *env, int num, |
| 442 | - const unsigned char *name, | 442 | + const char *name, |
| 443 | void (*uea_read)(void *opaque, int sprn), | 443 | void (*uea_read)(void *opaque, int sprn), |
| 444 | void (*uea_write)(void *opaque, int sprn), | 444 | void (*uea_write)(void *opaque, int sprn), |
| 445 | void (*oea_read)(void *opaque, int sprn), | 445 | void (*oea_read)(void *opaque, int sprn), |
| @@ -1245,7 +1245,7 @@ static void gen_spr_usprgh (CPUPPCState *env) | @@ -1245,7 +1245,7 @@ static void gen_spr_usprgh (CPUPPCState *env) | ||
| 1245 | /* PowerPC BookE SPR */ | 1245 | /* PowerPC BookE SPR */ |
| 1246 | static void gen_spr_BookE (CPUPPCState *env, uint64_t ivor_mask) | 1246 | static void gen_spr_BookE (CPUPPCState *env, uint64_t ivor_mask) |
| 1247 | { | 1247 | { |
| 1248 | - const unsigned char *ivor_names[64] = { | 1248 | + const char *ivor_names[64] = { |
| 1249 | "IVOR0", "IVOR1", "IVOR2", "IVOR3", | 1249 | "IVOR0", "IVOR1", "IVOR2", "IVOR3", |
| 1250 | "IVOR4", "IVOR5", "IVOR6", "IVOR7", | 1250 | "IVOR4", "IVOR5", "IVOR6", "IVOR7", |
| 1251 | "IVOR8", "IVOR9", "IVOR10", "IVOR11", | 1251 | "IVOR8", "IVOR9", "IVOR10", "IVOR11", |
| @@ -1407,7 +1407,7 @@ static void gen_spr_BookE (CPUPPCState *env, uint64_t ivor_mask) | @@ -1407,7 +1407,7 @@ static void gen_spr_BookE (CPUPPCState *env, uint64_t ivor_mask) | ||
| 1407 | static void gen_spr_BookE_FSL (CPUPPCState *env, uint32_t mas_mask) | 1407 | static void gen_spr_BookE_FSL (CPUPPCState *env, uint32_t mas_mask) |
| 1408 | { | 1408 | { |
| 1409 | #if !defined(CONFIG_USER_ONLY) | 1409 | #if !defined(CONFIG_USER_ONLY) |
| 1410 | - const unsigned char *mas_names[8] = { | 1410 | + const char *mas_names[8] = { |
| 1411 | "MAS0", "MAS1", "MAS2", "MAS3", "MAS4", "MAS5", "MAS6", "MAS7", | 1411 | "MAS0", "MAS1", "MAS2", "MAS3", "MAS4", "MAS5", "MAS6", "MAS7", |
| 1412 | }; | 1412 | }; |
| 1413 | int mas_sprn[8] = { | 1413 | int mas_sprn[8] = { |
| @@ -9157,7 +9157,7 @@ static int create_ppc_opcodes (CPUPPCState *env, const ppc_def_t *def) | @@ -9157,7 +9157,7 @@ static int create_ppc_opcodes (CPUPPCState *env, const ppc_def_t *def) | ||
| 9157 | static void dump_ppc_insns (CPUPPCState *env) | 9157 | static void dump_ppc_insns (CPUPPCState *env) |
| 9158 | { | 9158 | { |
| 9159 | opc_handler_t **table, *handler; | 9159 | opc_handler_t **table, *handler; |
| 9160 | - const unsigned char *p, *q; | 9160 | + const char *p, *q; |
| 9161 | uint8_t opc1, opc2, opc3; | 9161 | uint8_t opc1, opc2, opc3; |
| 9162 | 9162 | ||
| 9163 | printf("Instructions set:\n"); | 9163 | printf("Instructions set:\n"); |
| @@ -9240,7 +9240,7 @@ int cpu_ppc_register_internal (CPUPPCState *env, const ppc_def_t *def) | @@ -9240,7 +9240,7 @@ int cpu_ppc_register_internal (CPUPPCState *env, const ppc_def_t *def) | ||
| 9240 | init_ppc_proc(env, def); | 9240 | init_ppc_proc(env, def); |
| 9241 | #if defined(PPC_DUMP_CPU) | 9241 | #if defined(PPC_DUMP_CPU) |
| 9242 | { | 9242 | { |
| 9243 | - const unsigned char *mmu_model, *excp_model, *bus_model; | 9243 | + const char *mmu_model, *excp_model, *bus_model; |
| 9244 | switch (env->mmu_model) { | 9244 | switch (env->mmu_model) { |
| 9245 | case POWERPC_MMU_32B: | 9245 | case POWERPC_MMU_32B: |
| 9246 | mmu_model = "PowerPC 32"; | 9246 | mmu_model = "PowerPC 32"; |
| @@ -9443,10 +9443,10 @@ static const ppc_def_t *ppc_find_by_pvr (uint32_t pvr) | @@ -9443,10 +9443,10 @@ static const ppc_def_t *ppc_find_by_pvr (uint32_t pvr) | ||
| 9443 | 9443 | ||
| 9444 | #include <ctype.h> | 9444 | #include <ctype.h> |
| 9445 | 9445 | ||
| 9446 | -const ppc_def_t *cpu_ppc_find_by_name (const unsigned char *name) | 9446 | +const ppc_def_t *cpu_ppc_find_by_name (const char *name) |
| 9447 | { | 9447 | { |
| 9448 | const ppc_def_t *ret; | 9448 | const ppc_def_t *ret; |
| 9449 | - const unsigned char *p; | 9449 | + const char *p; |
| 9450 | int i, max, len; | 9450 | int i, max, len; |
| 9451 | 9451 | ||
| 9452 | /* Check if the given name is a PVR */ | 9452 | /* Check if the given name is a PVR */ |
target-sh4/translate.c
| @@ -183,7 +183,7 @@ void cpu_sh4_reset(CPUSH4State * env) | @@ -183,7 +183,7 @@ void cpu_sh4_reset(CPUSH4State * env) | ||
| 183 | } | 183 | } |
| 184 | 184 | ||
| 185 | typedef struct { | 185 | typedef struct { |
| 186 | - const unsigned char *name; | 186 | + const char *name; |
| 187 | int id; | 187 | int id; |
| 188 | uint32_t pvr; | 188 | uint32_t pvr; |
| 189 | uint32_t prr; | 189 | uint32_t prr; |
| @@ -206,7 +206,7 @@ static sh4_def_t sh4_defs[] = { | @@ -206,7 +206,7 @@ static sh4_def_t sh4_defs[] = { | ||
| 206 | }, | 206 | }, |
| 207 | }; | 207 | }; |
| 208 | 208 | ||
| 209 | -static const sh4_def_t *cpu_sh4_find_by_name(const unsigned char *name) | 209 | +static const sh4_def_t *cpu_sh4_find_by_name(const char *name) |
| 210 | { | 210 | { |
| 211 | int i; | 211 | int i; |
| 212 | 212 |