From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MVuoU-0000as-Vw for qemu-devel@nongnu.org; Tue, 28 Jul 2009 18:06:27 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MVuoP-0000Tt-UU for qemu-devel@nongnu.org; Tue, 28 Jul 2009 18:06:26 -0400 Received: from [199.232.76.173] (port=49646 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MVuoP-0000TM-GE for qemu-devel@nongnu.org; Tue, 28 Jul 2009 18:06:21 -0400 Received: from mx2.redhat.com ([66.187.237.31]:37507) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MVuoO-0000Y0-KG for qemu-devel@nongnu.org; Tue, 28 Jul 2009 18:06:21 -0400 From: Luiz Capitulino Date: Tue, 28 Jul 2009 19:04:56 -0300 Message-Id: <1248818713-11261-9-git-send-email-lcapitulino@redhat.com> In-Reply-To: <1248818713-11261-1-git-send-email-lcapitulino@redhat.com> References: <1248818713-11261-1-git-send-email-lcapitulino@redhat.com> Subject: [Qemu-devel] [PATCH 08/25] monitor: New GET_TLONG and GET_TPHYSADDR macros List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: jan.kiszka@siemens.com, aliguori@us.ibm.com, dlaor@redhat.com, avi@redhat.com, Luiz Capitulino When we start porting handlers to use the Monitor's dictionary to pass argments, we will turn function parameters into automatic variables. This will make the build brake when the 32 bits versions of GET_TLONG and GET_TPHYSADDR are used, because the 'h' argument will not be used. The best solution I could think for this problem was changing both macros to reassign the 'h' parameter when compiled for 32 bits. I'm open for better solutions, though. Signed-off-by: Luiz Capitulino --- monitor.c | 12 ++++++++++-- 1 files changed, 10 insertions(+), 2 deletions(-) diff --git a/monitor.c b/monitor.c index 802edb7..b46df28 100644 --- a/monitor.c +++ b/monitor.c @@ -778,7 +778,11 @@ static void memory_dump(Monitor *mon, int count, int format, int wsize, #if TARGET_LONG_BITS == 64 #define GET_TLONG(h, l) (((uint64_t)(h) << 32) | (l)) #else -#define GET_TLONG(h, l) (l) +static inline uint32_t GET_TLONG(uint32_t h, uint32_t l) +{ + h = h; /* avoid build error */ + return l; +} #endif static void do_memory_dump(Monitor *mon, int count, int format, int size, @@ -791,7 +795,11 @@ static void do_memory_dump(Monitor *mon, int count, int format, int size, #if TARGET_PHYS_ADDR_BITS > 32 #define GET_TPHYSADDR(h, l) (((uint64_t)(h) << 32) | (l)) #else -#define GET_TPHYSADDR(h, l) (l) +static inline uint32_t GET_TPHYSADDR(uint32_t h, uint32_t l) +{ + h = h; /* avoid build error */ + return l; +} #endif static void do_physical_memory_dump(Monitor *mon, int count, int format, -- 1.6.4.rc3.12.gdf73a