qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Laurent Desnogues" <laurent.desnogues@gmail.com>
To: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [4844] Avoid compiler warning.
Date: Fri, 4 Jul 2008 09:29:36 +0200	[thread overview]
Message-ID: <761ea48b0807040029k368086e1n1525f183b49d9c81@mail.gmail.com> (raw)
In-Reply-To: <E1KEWTk-000782-7A@cvs.savannah.gnu.org>

[-- Attachment #1: Type: text/plain, Size: 283 bytes --]

On Thu, Jul 3, 2008 at 11:36 PM, Thiemo Seufer <ths@networkno.de> wrote:
> Revision: 4844
[...]
> -#define h2g(x) ((target_ulong)(x - GUEST_BASE))
> +#define h2g(x) ((target_ulong)((unsigned long)(x) - GUEST_BASE))

What about getting rid of explicit casts when using h2g?


Laurent

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: h2g.patch --]
[-- Type: text/x-patch; name=h2g.patch, Size: 1370 bytes --]

Index: linux-user/syscall.c
===================================================================
--- linux-user/syscall.c	(revision 4845)
+++ linux-user/syscall.c	(working copy)
@@ -2018,7 +2018,7 @@
                 ret = get_errno((long)host_addr);
                 break;
             }
-            raddr = h2g((unsigned long)host_addr);
+            raddr = h2g(host_addr);
             /* find out the length of the shared memory segment */
             
             ret = get_errno(shmctl(first, IPC_STAT, &shm_info));
@@ -2477,7 +2477,7 @@
         if (!ldt_table)
             return -TARGET_ENOMEM;
         memset(ldt_table, 0, TARGET_LDT_ENTRIES * TARGET_LDT_ENTRY_SIZE);
-        env->ldt.base = h2g((unsigned long)ldt_table);
+        env->ldt.base = h2g(ldt_table);
         env->ldt.limit = 0xffff;
     }
 
Index: linux-user/main.c
===================================================================
--- linux-user/main.c	(revision 4845)
+++ linux-user/main.c	(working copy)
@@ -2472,7 +2472,7 @@
     {
         uint64_t *gdt_table;
         gdt_table = qemu_mallocz(sizeof(uint64_t) * TARGET_GDT_ENTRIES);
-        env->gdt.base = h2g((unsigned long)gdt_table);
+        env->gdt.base = h2g(gdt_table);
         env->gdt.limit = sizeof(uint64_t) * TARGET_GDT_ENTRIES - 1;
 #ifdef TARGET_ABI32
         write_dt(&gdt_table[__USER_CS >> 3], 0, 0xfffff,

      parent reply	other threads:[~2008-07-04  7:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-03 21:36 [Qemu-devel] [4844] Avoid compiler warning Thiemo Seufer
2008-07-04  6:05 ` [Qemu-devel] " Jan Kiszka
2008-07-04  7:29 ` Laurent Desnogues [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=761ea48b0807040029k368086e1n1525f183b49d9c81@mail.gmail.com \
    --to=laurent.desnogues@gmail.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).