qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [4877] Fix a bunch of type mismatch-related warnings (Jan K


From: Andrzej Zaborowski
Subject: [Qemu-devel] [4877] Fix a bunch of type mismatch-related warnings (Jan Kiszka).
Date: Wed, 16 Jul 2008 12:13:53 +0000

Revision: 4877
          http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=4877
Author:   balrog
Date:     2008-07-16 12:13:52 +0000 (Wed, 16 Jul 2008)

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

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

Modified Paths:
--------------
    trunk/hw/pc.c
    trunk/hw/sh7750.c
    trunk/linux-user/flatload.c
    trunk/linux-user/m68k-sim.c
    trunk/linux-user/signal.c
    trunk/linux-user/syscall.c
    trunk/target-sh4/op.c

Modified: trunk/hw/pc.c
===================================================================
--- trunk/hw/pc.c       2008-07-16 11:51:15 UTC (rev 4876)
+++ trunk/hw/pc.c       2008-07-16 12:13:52 UTC (rev 4877)
@@ -550,9 +550,9 @@
 
 #if 0
     fprintf(stderr,
-           "qemu: real_addr     = %#zx\n"
-           "qemu: cmdline_addr  = %#zx\n"
-           "qemu: prot_addr     = %#zx\n",
+           "qemu: real_addr     = 0x" TARGET_FMT_plx "\n"
+           "qemu: cmdline_addr  = 0x" TARGET_FMT_plx "\n"
+           "qemu: prot_addr     = 0x" TARGET_FMT_plx "\n",
            real_addr,
            cmdline_addr,
            prot_addr);
@@ -607,8 +607,8 @@
        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 0x" 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 @@
 
     /* 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);
     }
 

Modified: trunk/hw/sh7750.c
===================================================================
--- trunk/hw/sh7750.c   2008-07-16 11:51:15 UTC (rev 4876)
+++ trunk/hw/sh7750.c   2008-07-16 12:13:52 UTC (rev 4877)
@@ -182,13 +182,13 @@
 
 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);
 }
 

Modified: trunk/linux-user/flatload.c
===================================================================
--- trunk/linux-user/flatload.c 2008-07-16 11:51:15 UTC (rev 4876)
+++ trunk/linux-user/flatload.c 2008-07-16 12:13:52 UTC (rev 4877)
@@ -349,9 +349,9 @@
         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 @@
     }
 
     /* zero the BSS.  */
-    memset((void*)(datapos + data_len), 0, bss_len);
+    memset((void *)((unsigned long)datapos + data_len), 0, bss_len);
 
     return 0;
 }

Modified: trunk/linux-user/m68k-sim.c
===================================================================
--- trunk/linux-user/m68k-sim.c 2008-07-16 11:51:15 UTC (rev 4876)
+++ trunk/linux-user/m68k-sim.c 2008-07-16 12:13:52 UTC (rev 4877)
@@ -101,19 +101,19 @@
 {
     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 @@
             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);

Modified: trunk/linux-user/signal.c
===================================================================
--- trunk/linux-user/signal.c   2008-07-16 11:51:15 UTC (rev 4876)
+++ trunk/linux-user/signal.c   2008-07-16 12:13:52 UTC (rev 4877)
@@ -2755,7 +2755,7 @@
     /* 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 @@
        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;

Modified: trunk/linux-user/syscall.c
===================================================================
--- trunk/linux-user/syscall.c  2008-07-16 11:51:15 UTC (rev 4876)
+++ trunk/linux-user/syscall.c  2008-07-16 12:13:52 UTC (rev 4877)
@@ -72,6 +72,7 @@
 #include "linux_loop.h"
 
 #include "qemu.h"
+#include "qemu-common.h"
 
 #if defined(USE_NPTL)
 #include <linux/futex.h>

Modified: trunk/target-sh4/op.c
===================================================================
--- trunk/target-sh4/op.c       2008-07-16 11:51:15 UTC (rev 4876)
+++ trunk/target-sh4/op.c       2008-07-16 12:13:52 UTC (rev 4877)
@@ -594,7 +594,7 @@
 
 void OPPROTO op_tasb_rN(void)
 {
-    cond_t((env->gregs[PARAM1] && 0xff) == 0);
+    cond_t((env->gregs[PARAM1] & 0xff) == 0);
     *(int8_t *) &env->gregs[PARAM1] |= 0x80;
     RETURN();
 }






reply via email to

[Prev in Thread] Current Thread [Next in Thread]