Commit 526ccb7a26fea4b07eae4d34c8ad0599802a93ce

Authored by balrog
1 parent c5f2f668

Fix a bunch of type mismatch-related warnings (Jan Kiszka).

Fix a typo in my previous comming (spotted by Laurent Desnouges).


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4877 c046a42c-6fe2-441c-8c8c-71466251a162
... ... @@ -550,9 +550,9 @@ static void load_linux(const char *kernel_filename,
550 550  
551 551 #if 0
552 552 fprintf(stderr,
553   - "qemu: real_addr = %#zx\n"
554   - "qemu: cmdline_addr = %#zx\n"
555   - "qemu: prot_addr = %#zx\n",
  553 + "qemu: real_addr = 0x" TARGET_FMT_plx "\n"
  554 + "qemu: cmdline_addr = 0x" TARGET_FMT_plx "\n"
  555 + "qemu: prot_addr = 0x" TARGET_FMT_plx "\n",
556 556 real_addr,
557 557 cmdline_addr,
558 558 prot_addr);
... ... @@ -607,8 +607,8 @@ static void load_linux(const char *kernel_filename,
607 607 initrd_size = get_file_size(fi);
608 608 initrd_addr = (initrd_max-initrd_size) & ~4095;
609 609  
610   - fprintf(stderr, "qemu: loading initrd (%#x bytes) at %#zx\n",
611   - initrd_size, initrd_addr);
  610 + fprintf(stderr, "qemu: loading initrd (%#x bytes) at 0x" TARGET_FMT_plx
  611 + "\n", initrd_size, initrd_addr);
612 612  
613 613 if (!fread_targphys_ok(initrd_addr, initrd_size, fi)) {
614 614 fprintf(stderr, "qemu: read error on initial ram disk '%s'\n",
... ... @@ -778,7 +778,8 @@ static void pc_init1(ram_addr_t ram_size, int vga_ram_size,
778 778  
779 779 /* above 4giga memory allocation */
780 780 if (above_4g_mem_size > 0) {
781   - cpu_register_physical_memory(0x100000000ULL, above_4g_mem_size,
  781 + cpu_register_physical_memory((target_phys_addr_t) 0x100000000ULL,
  782 + above_4g_mem_size,
782 783 ram_addr + below_4g_mem_size);
783 784 }
784 785  
... ...
hw/sh7750.c
... ... @@ -182,13 +182,13 @@ static void portb_changed(SH7750State * s, uint16_t prev)
182 182  
183 183 static void error_access(const char *kind, target_phys_addr_t addr)
184 184 {
185   - fprintf(stderr, "%s to %s (0x%08x) not supported\n",
  185 + fprintf(stderr, "%s to %s (0x" TARGET_FMT_plx ") not supported\n",
186 186 kind, regname(addr), addr);
187 187 }
188 188  
189 189 static void ignore_access(const char *kind, target_phys_addr_t addr)
190 190 {
191   - fprintf(stderr, "%s to %s (0x%08x) ignored\n",
  191 + fprintf(stderr, "%s to %s (0x" TARGET_FMT_plx ") ignored\n",
192 192 kind, regname(addr), addr);
193 193 }
194 194  
... ...
linux-user/flatload.c
... ... @@ -349,9 +349,9 @@ void old_reloc(struct lib_info *libinfo, uint32_t rl)
349 349 reloc_type = rl >> 30;
350 350 /* ??? How to handle this? */
351 351 #if defined(CONFIG_COLDFIRE)
352   - ptr = (uint32_t *) (libinfo->start_code + offset);
  352 + ptr = (uint32_t *) ((unsigned long) libinfo->start_code + offset);
353 353 #else
354   - ptr = (uint32_t *) (libinfo->start_data + offset);
  354 + ptr = (uint32_t *) ((unsigned long) libinfo->start_data + offset);
355 355 #endif
356 356  
357 357 #ifdef DEBUG
... ... @@ -670,7 +670,7 @@ static int load_flat_file(struct linux_binprm * bprm,
670 670 }
671 671  
672 672 /* zero the BSS. */
673   - memset((void*)(datapos + data_len), 0, bss_len);
  673 + memset((void *)((unsigned long)datapos + data_len), 0, bss_len);
674 674  
675 675 return 0;
676 676 }
... ...
linux-user/m68k-sim.c
... ... @@ -101,19 +101,19 @@ void do_m68k_simcall(CPUM68KState *env, int nr)
101 101 {
102 102 uint32_t *args;
103 103  
104   - args = (uint32_t *)(env->aregs[7] + 4);
  104 + args = (uint32_t *)(unsigned long)(env->aregs[7] + 4);
105 105 switch (nr) {
106 106 case SYS_EXIT:
107 107 exit(ARG(0));
108 108 case SYS_READ:
109   - check_err(env, read(ARG(0), (void *)ARG(1), ARG(2)));
  109 + check_err(env, read(ARG(0), (void *)(unsigned long)ARG(1), ARG(2)));
110 110 break;
111 111 case SYS_WRITE:
112   - check_err(env, write(ARG(0), (void *)ARG(1), ARG(2)));
  112 + check_err(env, write(ARG(0), (void *)(unsigned long)ARG(1), ARG(2)));
113 113 break;
114 114 case SYS_OPEN:
115   - check_err(env, open((char *)ARG(0), translate_openflags(ARG(1)),
116   - ARG(2)));
  115 + check_err(env, open((char *)(unsigned long)ARG(0),
  116 + translate_openflags(ARG(1)), ARG(2)));
117 117 break;
118 118 case SYS_CLOSE:
119 119 {
... ... @@ -142,7 +142,7 @@ void do_m68k_simcall(CPUM68KState *env, int nr)
142 142 struct m86k_sim_stat *p;
143 143 rc = check_err(env, fstat(ARG(0), &s));
144 144 if (rc == 0) {
145   - p = (struct m86k_sim_stat *)ARG(1);
  145 + p = (struct m86k_sim_stat *)(unsigned long)ARG(1);
146 146 p->sim_st_dev = tswap16(s.st_dev);
147 147 p->sim_st_ino = tswap16(s.st_ino);
148 148 p->sim_st_mode = tswap32(s.st_mode);
... ...
linux-user/signal.c
... ... @@ -2755,7 +2755,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka,
2755 2755 /* Create the ucontext. */
2756 2756 err |= __put_user(0, &frame->uc.uc_flags);
2757 2757 err |= __put_user(0, (unsigned long *)&frame->uc.uc_link);
2758   - err |= __put_user((void *)target_sigaltstack_used.ss_sp,
  2758 + err |= __put_user((unsigned long)target_sigaltstack_used.ss_sp,
2759 2759 &frame->uc.uc_stack.ss_sp);
2760 2760 err |= __put_user(sas_ss_flags(regs->gregs[15]),
2761 2761 &frame->uc.uc_stack.ss_flags);
... ... @@ -2982,11 +2982,11 @@ static void setup_frame(int sig, struct target_sigaction *ka,
2982 2982 setup_sigcontext(&frame->sc, env);
2983 2983  
2984 2984 /* Move the stack and setup the arguments for the handler. */
2985   - env->regs[R_SP] = (uint32_t) frame;
  2985 + env->regs[R_SP] = (uint32_t) (unsigned long) frame;
2986 2986 env->regs[10] = sig;
2987 2987 env->pc = (unsigned long) ka->_sa_handler;
2988 2988 /* Link SRP so the guest returns through the trampoline. */
2989   - env->pregs[PR_SRP] = (uint32_t) &frame->retcode[0];
  2989 + env->pregs[PR_SRP] = (uint32_t) (unsigned long) &frame->retcode[0];
2990 2990  
2991 2991 unlock_user_struct(frame, frame_addr, 1);
2992 2992 return;
... ...
linux-user/syscall.c
... ... @@ -72,6 +72,7 @@
72 72 #include "linux_loop.h"
73 73  
74 74 #include "qemu.h"
  75 +#include "qemu-common.h"
75 76  
76 77 #if defined(USE_NPTL)
77 78 #include <linux/futex.h>
... ...
target-sh4/op.c
... ... @@ -594,7 +594,7 @@ void OPPROTO op_shlr16_Rn(void)
594 594  
595 595 void OPPROTO op_tasb_rN(void)
596 596 {
597   - cond_t((env->gregs[PARAM1] && 0xff) == 0);
  597 + cond_t((env->gregs[PARAM1] & 0xff) == 0);
598 598 *(int8_t *) &env->gregs[PARAM1] |= 0x80;
599 599 RETURN();
600 600 }
... ...