qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] w32: Fix compilation and replace non-portable usage of ulong
@ 2011-05-15  9:38 Stefan Weil
  2011-05-15 10:36 ` Aurelien Jarno
  0 siblings, 1 reply; 3+ messages in thread
From: Stefan Weil @ 2011-05-15  9:38 UTC (permalink / raw)
  To: qemu-devel; +Cc: Aurelien Jarno

ulong is undefined for w32 (and maybe other) compilations.
Replace it by uintptr_t (which also fixes compilation for w64
and is a better choice for pointer to integer conversions).

Cc: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
 target-ppc/cpu.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
index 7a6a7df..8e4582f 100644
--- a/target-ppc/cpu.h
+++ b/target-ppc/cpu.h
@@ -1929,8 +1929,8 @@ static inline void cpu_set_tls(CPUState *env, target_ulong newtls)
 #if !defined(CONFIG_USER_ONLY)
 static inline int booke206_tlbe_id(CPUState *env, ppcemb_tlb_t *tlbe)
 {
-    ulong tlbel = (ulong)tlbe;
-    ulong tlbl = (ulong)env->tlb;
+    uintptr_t tlbel = (uintptr_t)tlbe;
+    uintptr_t tlbl = (uintptr_t)env->tlb;
 
     return (tlbel - tlbl) / sizeof(env->tlb[0]);
 }
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] w32: Fix compilation and replace non-portable usage of ulong
  2011-05-15  9:38 [Qemu-devel] [PATCH] w32: Fix compilation and replace non-portable usage of ulong Stefan Weil
@ 2011-05-15 10:36 ` Aurelien Jarno
  2011-05-20 21:05   ` Andreas Färber
  0 siblings, 1 reply; 3+ messages in thread
From: Aurelien Jarno @ 2011-05-15 10:36 UTC (permalink / raw)
  To: Stefan Weil; +Cc: qemu-devel

On Sun, May 15, 2011 at 11:38:04AM +0200, Stefan Weil wrote:
> ulong is undefined for w32 (and maybe other) compilations.
> Replace it by uintptr_t (which also fixes compilation for w64
> and is a better choice for pointer to integer conversions).
> 
> Cc: Aurelien Jarno <aurelien@aurel32.net>
> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
> ---
>  target-ppc/cpu.h |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
 
> diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
> index 7a6a7df..8e4582f 100644
> --- a/target-ppc/cpu.h
> +++ b/target-ppc/cpu.h
> @@ -1929,8 +1929,8 @@ static inline void cpu_set_tls(CPUState *env, target_ulong newtls)
>  #if !defined(CONFIG_USER_ONLY)
>  static inline int booke206_tlbe_id(CPUState *env, ppcemb_tlb_t *tlbe)
>  {
> -    ulong tlbel = (ulong)tlbe;
> -    ulong tlbl = (ulong)env->tlb;
> +    uintptr_t tlbel = (uintptr_t)tlbe;
> +    uintptr_t tlbl = (uintptr_t)env->tlb;
>  
>      return (tlbel - tlbl) / sizeof(env->tlb[0]);
>  }
> -- 
> 1.5.6.5
> 
> 

-- 
Aurelien Jarno                          GPG: 1024D/F1BCDB73
aurelien@aurel32.net                 http://www.aurel32.net

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] w32: Fix compilation and replace non-portable usage of ulong
  2011-05-15 10:36 ` Aurelien Jarno
@ 2011-05-20 21:05   ` Andreas Färber
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Färber @ 2011-05-20 21:05 UTC (permalink / raw)
  To: Aurelien Jarno, Alexander Graf; +Cc: QEMU-devel Developers

Am 15.05.2011 um 12:36 schrieb Aurelien Jarno:

> On Sun, May 15, 2011 at 11:38:04AM +0200, Stefan Weil wrote:
>> ulong is undefined for w32 (and maybe other) compilations.

Darwin

>> Replace it by uintptr_t (which also fixes compilation for w64
>> and is a better choice for pointer to integer conversions).
>>
>> Cc: Aurelien Jarno <aurelien@aurel32.net>
>> Signed-off-by: Stefan Weil <weil@mail.berlios.de>
>> ---
>> target-ppc/cpu.h |    4 ++--
>> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>

Matches the patch I came up with for Mac OS X.

Acked-by: Andreas Färber <andreas.faerber@web.de>

>> diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
>> index 7a6a7df..8e4582f 100644
>> --- a/target-ppc/cpu.h
>> +++ b/target-ppc/cpu.h
>> @@ -1929,8 +1929,8 @@ static inline void cpu_set_tls(CPUState *env,  
>> target_ulong newtls)
>> #if !defined(CONFIG_USER_ONLY)
>> static inline int booke206_tlbe_id(CPUState *env, ppcemb_tlb_t *tlbe)
>> {
>> -    ulong tlbel = (ulong)tlbe;
>> -    ulong tlbl = (ulong)env->tlb;
>> +    uintptr_t tlbel = (uintptr_t)tlbe;
>> +    uintptr_t tlbl = (uintptr_t)env->tlb;
>>
>>     return (tlbel - tlbl) / sizeof(env->tlb[0]);
>> }
>> -- 
>> 1.5.6.5
>>
>>
>
> -- 
> Aurelien Jarno                          GPG: 1024D/F1BCDB73
> aurelien@aurel32.net                 http://www.aurel32.net
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-05-20 21:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-15  9:38 [Qemu-devel] [PATCH] w32: Fix compilation and replace non-portable usage of ulong Stefan Weil
2011-05-15 10:36 ` Aurelien Jarno
2011-05-20 21:05   ` Andreas Färber

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).