From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KI0pm-0008OF-8R for qemu-devel@nongnu.org; Sun, 13 Jul 2008 08:37:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KI0pk-0008Nz-O4 for qemu-devel@nongnu.org; Sun, 13 Jul 2008 08:37:44 -0400 Received: from [199.232.76.173] (port=59677 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KI0pk-0008Nw-HW for qemu-devel@nongnu.org; Sun, 13 Jul 2008 08:37:44 -0400 Received: from fmmailgate01.web.de ([217.72.192.221]:49599) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KI0pk-0002sd-JA for qemu-devel@nongnu.org; Sun, 13 Jul 2008 08:37:45 -0400 Received: from smtp06.web.de (fmsmtp06.dlan.cinetic.de [172.20.5.172]) by fmmailgate01.web.de (Postfix) with ESMTP id BCA86E7C92CA for ; Sun, 13 Jul 2008 14:37:16 +0200 (CEST) Received: from [88.64.30.223] (helo=[192.168.1.198]) by smtp06.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.109 #226) id 1KI0pI-00071H-00 for qemu-devel@nongnu.org; Sun, 13 Jul 2008 14:37:16 +0200 Message-ID: <4879F6FC.3030209@web.de> Date: Sun, 13 Jul 2008 14:37:16 +0200 From: Jan Kiszka MIME-Version: 1.0 References: <485F474D.6050001@web.de> In-Reply-To: <485F474D.6050001@web.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Sender: jan.kiszka@web.de Subject: [Qemu-devel] [RESEND][PATCH] fix various compiler warnings Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Here are those bits from the original patch which are still unfixed. Please apply what fits, fix differently where required or desired, or let me know how you would like to see it being addressed. Signed-off-by: Jan Kiszka --- hw/pc.c | 7 ++++--- hw/sh7750.c | 4 ++-- linux-user/arm/nwfpe/fpa11_cpdt.c | 16 ++++++++-------- linux-user/flatload.c | 6 +++--- linux-user/m68k-sim.c | 12 ++++++------ linux-user/signal.c | 6 +++--- linux-user/syscall.c | 1 + target-arm/translate.c | 2 ++ target-i386/helper.c | 6 +++--- 9 files changed, 32 insertions(+), 28 deletions(-) Index: b/hw/sh7750.c =================================================================== --- a/hw/sh7750.c +++ b/hw/sh7750.c @@ -182,13 +182,13 @@ static void portb_changed(SH7750State * static void error_access(const char *kind, target_phys_addr_t addr) { - fprintf(stderr, "%s to %s (0x%08x) not supported\n", + fprintf(stderr, "%s to %s (0x" TARGET_FMT_plx ") not supported\n", kind, regname(addr), addr); } static void ignore_access(const char *kind, target_phys_addr_t addr) { - fprintf(stderr, "%s to %s (0x%08x) ignored\n", + fprintf(stderr, "%s to %s (0x" TARGET_FMT_plx ") ignored\n", kind, regname(addr), addr); } Index: b/linux-user/flatload.c =================================================================== --- a/linux-user/flatload.c +++ b/linux-user/flatload.c @@ -349,9 +349,9 @@ void old_reloc(struct lib_info *libinfo, reloc_type = rl >> 30; /* ??? How to handle this? */ #if defined(CONFIG_COLDFIRE) - ptr = (uint32_t *) (libinfo->start_code + offset); + ptr = (uint32_t *)(unsigned long) (libinfo->start_code + offset); #else - ptr = (uint32_t *) (libinfo->start_data + offset); + ptr = (uint32_t *)(unsigned long) (libinfo->start_data + offset); #endif #ifdef DEBUG @@ -670,7 +670,7 @@ static int load_flat_file(struct linux_b } /* zero the BSS. */ - memset((void*)(datapos + data_len), 0, bss_len); + memset((void *)(unsigned long)(datapos + data_len), 0, bss_len); return 0; } Index: b/linux-user/m68k-sim.c =================================================================== --- a/linux-user/m68k-sim.c +++ b/linux-user/m68k-sim.c @@ -101,19 +101,19 @@ void do_m68k_simcall(CPUM68KState *env, { uint32_t *args; - args = (uint32_t *)(env->aregs[7] + 4); + args = (uint32_t *)(unsigned long)(env->aregs[7] + 4); switch (nr) { case SYS_EXIT: exit(ARG(0)); case SYS_READ: - check_err(env, read(ARG(0), (void *)ARG(1), ARG(2))); + check_err(env, read(ARG(0), (void *)(unsigned long)ARG(1), ARG(2))); break; case SYS_WRITE: - check_err(env, write(ARG(0), (void *)ARG(1), ARG(2))); + check_err(env, write(ARG(0), (void *)(unsigned long)ARG(1), ARG(2))); break; case SYS_OPEN: - check_err(env, open((char *)ARG(0), translate_openflags(ARG(1)), - ARG(2))); + check_err(env, open((char *)(unsigned long)ARG(0), + translate_openflags(ARG(1)), ARG(2))); break; case SYS_CLOSE: { @@ -142,7 +142,7 @@ void do_m68k_simcall(CPUM68KState *env, struct m86k_sim_stat *p; rc = check_err(env, fstat(ARG(0), &s)); if (rc == 0) { - p = (struct m86k_sim_stat *)ARG(1); + p = (struct m86k_sim_stat *)(unsigned long)ARG(1); p->sim_st_dev = tswap16(s.st_dev); p->sim_st_ino = tswap16(s.st_ino); p->sim_st_mode = tswap32(s.st_mode); Index: b/linux-user/syscall.c =================================================================== --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -72,6 +72,7 @@ #include "linux_loop.h" #include "qemu.h" +#include "qemu-common.h" #if defined(USE_NPTL) #include Index: b/linux-user/signal.c =================================================================== --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -2755,7 +2755,7 @@ static void setup_rt_frame(int sig, stru /* Create the ucontext. */ err |= __put_user(0, &frame->uc.uc_flags); err |= __put_user(0, (unsigned long *)&frame->uc.uc_link); - err |= __put_user((void *)target_sigaltstack_used.ss_sp, + err |= __put_user((unsigned long)target_sigaltstack_used.ss_sp, &frame->uc.uc_stack.ss_sp); err |= __put_user(sas_ss_flags(regs->gregs[15]), &frame->uc.uc_stack.ss_flags); @@ -2982,11 +2982,11 @@ static void setup_frame(int sig, struct setup_sigcontext(&frame->sc, env); /* Move the stack and setup the arguments for the handler. */ - env->regs[R_SP] = (uint32_t) frame; + env->regs[R_SP] = (uint32_t)(unsigned long) frame; env->regs[10] = sig; env->pc = (unsigned long) ka->_sa_handler; /* Link SRP so the guest returns through the trampoline. */ - env->pregs[PR_SRP] = (uint32_t) &frame->retcode[0]; + env->pregs[PR_SRP] = (uint32_t)(unsigned long) &frame->retcode[0]; unlock_user_struct(frame, frame_addr, 1); return; Index: b/linux-user/arm/nwfpe/fpa11_cpdt.c =================================================================== --- a/linux-user/arm/nwfpe/fpa11_cpdt.c +++ b/linux-user/arm/nwfpe/fpa11_cpdt.c @@ -227,7 +227,7 @@ unsigned int PerformLDF(const unsigned i //printk("PerformLDF(0x%08x), Fd = 0x%08x\n",opcode,getFd(opcode)); - pBase = (unsigned int*)readRegister(getRn(opcode)); + pBase = (unsigned int *)(unsigned long)readRegister(getRn(opcode)); if (REG_PC == getRn(opcode)) { pBase += 2; @@ -250,7 +250,7 @@ unsigned int PerformLDF(const unsigned i default: nRc = 0; } - if (write_back) writeRegister(getRn(opcode),(unsigned int)pFinal); + if (write_back) writeRegister(getRn(opcode), (unsigned long)pFinal); return nRc; } @@ -262,7 +262,7 @@ unsigned int PerformSTF(const unsigned i //printk("PerformSTF(0x%08x), Fd = 0x%08x\n",opcode,getFd(opcode)); SetRoundingMode(ROUND_TO_NEAREST); - pBase = (unsigned int*)readRegister(getRn(opcode)); + pBase = (unsigned int *)(unsigned long)readRegister(getRn(opcode)); if (REG_PC == getRn(opcode)) { pBase += 2; @@ -285,7 +285,7 @@ unsigned int PerformSTF(const unsigned i default: nRc = 0; } - if (write_back) writeRegister(getRn(opcode),(unsigned int)pFinal); + if (write_back) writeRegister(getRn(opcode),(unsigned long)pFinal); return nRc; } @@ -294,7 +294,7 @@ unsigned int PerformLFM(const unsigned i unsigned int i, Fd, *pBase, *pAddress, *pFinal, write_back = WRITE_BACK(opcode); - pBase = (unsigned int*)readRegister(getRn(opcode)); + pBase = (unsigned int *)(unsigned long)readRegister(getRn(opcode)); if (REG_PC == getRn(opcode)) { pBase += 2; @@ -317,7 +317,7 @@ unsigned int PerformLFM(const unsigned i if (Fd == 8) Fd = 0; } - if (write_back) writeRegister(getRn(opcode),(unsigned int)pFinal); + if (write_back) writeRegister(getRn(opcode), (unsigned long)pFinal); return 1; } @@ -326,7 +326,7 @@ unsigned int PerformSFM(const unsigned i unsigned int i, Fd, *pBase, *pAddress, *pFinal, write_back = WRITE_BACK(opcode); - pBase = (unsigned int*)readRegister(getRn(opcode)); + pBase = (unsigned int *)(unsigned long)readRegister(getRn(opcode)); if (REG_PC == getRn(opcode)) { pBase += 2; @@ -349,7 +349,7 @@ unsigned int PerformSFM(const unsigned i if (Fd == 8) Fd = 0; } - if (write_back) writeRegister(getRn(opcode),(unsigned int)pFinal); + if (write_back) writeRegister(getRn(opcode), (unsigned long)pFinal); return 1; } Index: b/hw/pc.c =================================================================== --- a/hw/pc.c +++ b/hw/pc.c @@ -607,8 +607,8 @@ static void load_linux(const char *kerne initrd_size = get_file_size(fi); initrd_addr = (initrd_max-initrd_size) & ~4095; - fprintf(stderr, "qemu: loading initrd (%#x bytes) at %#zx\n", - initrd_size, initrd_addr); + fprintf(stderr, "qemu: loading initrd (%#x bytes) at " TARGET_FMT_plx + "\n", initrd_size, initrd_addr); if (!fread_targphys_ok(initrd_addr, initrd_size, fi)) { fprintf(stderr, "qemu: read error on initial ram disk '%s'\n", @@ -778,7 +778,8 @@ static void pc_init1(ram_addr_t ram_size /* above 4giga memory allocation */ if (above_4g_mem_size > 0) { - cpu_register_physical_memory(0x100000000ULL, above_4g_mem_size, + cpu_register_physical_memory((target_phys_addr_t)0x100000000ULL, + above_4g_mem_size, ram_addr + below_4g_mem_size); }