From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KAfrm-0002N3-TM for qemu-devel@nongnu.org; Mon, 23 Jun 2008 02:49:31 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KAfrl-0002Le-D5 for qemu-devel@nongnu.org; Mon, 23 Jun 2008 02:49:29 -0400 Received: from [199.232.76.173] (port=41841 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KAfrl-0002LM-3l for qemu-devel@nongnu.org; Mon, 23 Jun 2008 02:49:29 -0400 Received: from mx20.gnu.org ([199.232.41.8]:21159) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KAfrj-0002wx-FQ for qemu-devel@nongnu.org; Mon, 23 Jun 2008 02:49:28 -0400 Received: from fmmailgate03.web.de ([217.72.192.234]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KAfrh-0005in-73 for qemu-devel@nongnu.org; Mon, 23 Jun 2008 02:49:25 -0400 Received: from smtp08.web.de (fmsmtp08.dlan.cinetic.de [172.20.5.216]) by fmmailgate03.web.de (Postfix) with ESMTP id 68088E0F98F2 for ; Mon, 23 Jun 2008 08:48:46 +0200 (CEST) Received: from [88.65.247.188] (helo=[192.168.1.198]) by smtp08.web.de with asmtp (TLSv1:AES256-SHA:256) (WEB.DE 4.109 #226) id 1KAfr4-0002xh-00 for qemu-devel@nongnu.org; Mon, 23 Jun 2008 08:48:46 +0200 Message-ID: <485F474D.6050001@web.de> Date: Mon, 23 Jun 2008 08:48:45 +0200 From: Jan Kiszka MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Sender: jan.kiszka@web.de Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [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 This belongs into the category "mostly harmless", but it is still annoying when you change core headers and look out for build regressions. Some spots still remain (namely in slirp), but it is a start. Please cross-check if all the silencing is actually valid and not papering over a real issue (but it doesn't appear to me)! 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-i386/helper.c | 6 +++--- target-mips/op_helper.c | 4 ++-- target-sparc/cpu.h | 2 ++ 10 files changed, 34 insertions(+), 30 deletions(-) Index: b/hw/sh7750.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- a/hw/sh7750.c +++ b/hw/sh7750.c @@ -182,13 +182,13 @@ static void portb_changed(SH7750State *=20 =20 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); } =20 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); } =20 Index: b/linux-user/flatload.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- a/linux-user/flatload.c +++ b/linux-user/flatload.c @@ -349,9 +349,9 @@ void old_reloc(struct lib_info *libinfo, reloc_type =3D rl >> 30; /* ??? How to handle this? */ #if defined(CONFIG_COLDFIRE) - ptr =3D (uint32_t *) (libinfo->start_code + offset); + ptr =3D (uint32_t *)(unsigned long) (libinfo->start_code + offset); #else - ptr =3D (uint32_t *) (libinfo->start_data + offset); + ptr =3D (uint32_t *)(unsigned long) (libinfo->start_data + offset); #endif =20 #ifdef DEBUG @@ -670,7 +670,7 @@ static int load_flat_file(struct linux_b } =20 /* zero the BSS. */ - memset((void*)(datapos + data_len), 0, bss_len); + memset((void *)(unsigned long)(datapos + data_len), 0, bss_len); =20 return 0; } Index: b/linux-user/m68k-sim.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- a/linux-user/m68k-sim.c +++ b/linux-user/m68k-sim.c @@ -101,19 +101,19 @@ void do_m68k_simcall(CPUM68KState *env,=20 { uint32_t *args; =20 - args =3D (uint32_t *)(env->aregs[7] + 4); + args =3D (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,=20 struct m86k_sim_stat *p; rc =3D check_err(env, fstat(ARG(0), &s)); if (rc =3D=3D 0) { - p =3D (struct m86k_sim_stat *)ARG(1); + p =3D (struct m86k_sim_stat *)(unsigned long)ARG(1); p->sim_st_dev =3D tswap16(s.st_dev); p->sim_st_ino =3D tswap16(s.st_ino); p->sim_st_mode =3D tswap32(s.st_mode); Index: b/linux-user/syscall.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -72,6 +72,7 @@ #include "linux_loop.h" =20 #include "qemu.h" +#include "qemu-common.h" =20 #if defined(USE_NPTL) #include Index: b/target-sparc/cpu.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- a/target-sparc/cpu.h +++ b/target-sparc/cpu.h @@ -366,12 +366,14 @@ static inline int cpu_cwp_dec(CPUSPARCSt } while (0) #define GET_CWP64(env) (env->nwindows - 1 - (env)->cwp) =20 +#ifndef NO_CPU_IO_DEFS static inline void PUT_CWP64(CPUSPARCState *env1, int cwp) { if (unlikely(cwp >=3D env1->nwindows || cwp < 0)) cwp =3D 0; cpu_set_cwp(env1, env1->nwindows - 1 - cwp); } +#endif =20 #endif =20 Index: b/linux-user/signal.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 |=3D __put_user(0, &frame->uc.uc_flags); err |=3D __put_user(0, (unsigned long *)&frame->uc.uc_link); - err |=3D __put_user((void *)target_sigaltstack_used.ss_sp, + err |=3D __put_user((unsigned long)target_sigaltstack_used.ss_sp, &frame->uc.uc_stack.ss_sp); err |=3D __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=20 setup_sigcontext(&frame->sc, env); =20 /* Move the stack and setup the arguments for the handler. */ - env->regs[R_SP] =3D (uint32_t) frame; + env->regs[R_SP] =3D (uint32_t)(unsigned long) frame; env->regs[10] =3D sig; env->pc =3D (unsigned long) ka->_sa_handler; /* Link SRP so the guest returns through the trampoline. */ - env->pregs[PR_SRP] =3D (uint32_t) &frame->retcode[0]; + env->pregs[PR_SRP] =3D (uint32_t)(unsigned long) &frame->retcode[0]; =20 unlock_user_struct(frame, frame_addr, 1); return; Index: b/linux-user/arm/nwfpe/fpa11_cpdt.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- 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 =20 //printk("PerformLDF(0x%08x), Fd =3D 0x%08x\n",opcode,getFd(opcode)); =20 - pBase =3D (unsigned int*)readRegister(getRn(opcode)); + pBase =3D (unsigned int *)(unsigned long)readRegister(getRn(opcode)); if (REG_PC =3D=3D getRn(opcode)) { pBase +=3D 2; @@ -250,7 +250,7 @@ unsigned int PerformLDF(const unsigned i default: nRc =3D 0; } =20 - if (write_back) writeRegister(getRn(opcode),(unsigned int)pFinal); + if (write_back) writeRegister(getRn(opcode), (unsigned long)pFinal); return nRc; } =20 @@ -262,7 +262,7 @@ unsigned int PerformSTF(const unsigned i //printk("PerformSTF(0x%08x), Fd =3D 0x%08x\n",opcode,getFd(opcode)); SetRoundingMode(ROUND_TO_NEAREST); =20 - pBase =3D (unsigned int*)readRegister(getRn(opcode)); + pBase =3D (unsigned int *)(unsigned long)readRegister(getRn(opcode)); if (REG_PC =3D=3D getRn(opcode)) { pBase +=3D 2; @@ -285,7 +285,7 @@ unsigned int PerformSTF(const unsigned i default: nRc =3D 0; } =20 - if (write_back) writeRegister(getRn(opcode),(unsigned int)pFinal); + if (write_back) writeRegister(getRn(opcode),(unsigned long)pFinal); return nRc; } =20 @@ -294,7 +294,7 @@ unsigned int PerformLFM(const unsigned i unsigned int i, Fd, *pBase, *pAddress, *pFinal, write_back =3D WRITE_BACK(opcode); =20 - pBase =3D (unsigned int*)readRegister(getRn(opcode)); + pBase =3D (unsigned int *)(unsigned long)readRegister(getRn(opcode)); if (REG_PC =3D=3D getRn(opcode)) { pBase +=3D 2; @@ -317,7 +317,7 @@ unsigned int PerformLFM(const unsigned i if (Fd =3D=3D 8) Fd =3D 0; } =20 - if (write_back) writeRegister(getRn(opcode),(unsigned int)pFinal); + if (write_back) writeRegister(getRn(opcode), (unsigned long)pFinal); return 1; } =20 @@ -326,7 +326,7 @@ unsigned int PerformSFM(const unsigned i unsigned int i, Fd, *pBase, *pAddress, *pFinal, write_back =3D WRITE_BACK(opcode); =20 - pBase =3D (unsigned int*)readRegister(getRn(opcode)); + pBase =3D (unsigned int *)(unsigned long)readRegister(getRn(opcode)); if (REG_PC =3D=3D getRn(opcode)) { pBase +=3D 2; @@ -349,7 +349,7 @@ unsigned int PerformSFM(const unsigned i if (Fd =3D=3D 8) Fd =3D 0; } =20 - if (write_back) writeRegister(getRn(opcode),(unsigned int)pFinal); + if (write_back) writeRegister(getRn(opcode), (unsigned long)pFinal); return 1; } =20 Index: b/target-mips/op_helper.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- a/target-mips/op_helper.c +++ b/target-mips/op_helper.c @@ -461,7 +461,7 @@ void do_ldl(int mem_idx) #ifdef CONFIG_USER_ONLY #define ldfun ldub_raw #else - target_ulong (*ldfun)(target_ulong); + int (*ldfun)(target_ulong); =20 switch (mem_idx) { @@ -517,7 +517,7 @@ void do_ldr(int mem_idx) #ifdef CONFIG_USER_ONLY #define ldfun ldub_raw #else - target_ulong (*ldfun)(target_ulong); + int (*ldfun)(target_ulong); =20 switch (mem_idx) { Index: b/hw/pc.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- a/hw/pc.c +++ b/hw/pc.c @@ -607,8 +607,8 @@ static void load_linux(const char *kerne initrd_size =3D get_file_size(fi); initrd_addr =3D (initrd_max-initrd_size) & ~4095; =20 - 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); =20 if (!fread_targphys_ok(initrd_addr, initrd_size, fi)) { fprintf(stderr, "qemu: read error on initial ram disk '%s'\n", @@ -779,7 +779,8 @@ static void pc_init1(ram_addr_t ram_size =20 /* 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); } =20 Index: b/target-i386/helper.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- a/target-i386/helper.c +++ b/target-i386/helper.c @@ -827,12 +827,12 @@ target_phys_addr_t cpu_get_phys_page_deb /* XXX: This value should match the one returned by CPUID * and in exec.c */ #if defined(USE_KQEMU) -#define PHYS_ADDR_MASK 0xfffff000L +#define PHYS_ADDR_MASK 0xfffff000LL #else # if defined(TARGET_X86_64) -# define PHYS_ADDR_MASK 0xfffffff000L +# define PHYS_ADDR_MASK 0xfffffff000LL # else -# define PHYS_ADDR_MASK 0xffffff000L +# define PHYS_ADDR_MASK 0xffffff000LL # endif #endif =20