qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] target/m68k/fpu_helper.c: rename the access arguments
@ 2019-09-12 14:02 KONRAD Frederic
  2019-09-12 14:32 ` Philippe Mathieu-Daudé
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: KONRAD Frederic @ 2019-09-12 14:02 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial; +Cc: KONRAD Frederic, Laurent Vivier

The "access" arguments clash with a macro under Windows with MinGW:
  CC      m68k-softmmu/target/m68k/fpu_helper.o
  target/m68k/fpu_helper.c: In function 'fmovem_predec':
  target/m68k/fpu_helper.c:405:56: error: macro "access" passed 4 arguments,
   but takes just 2
               size = access(env, addr, &env->fregs[i], ra);

So this renames them access_fn.

Tested with:
 ./configure --target-list=m68k-softmmu
 make -j8

Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com>
---
 target/m68k/fpu_helper.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/target/m68k/fpu_helper.c b/target/m68k/fpu_helper.c
index 9b039c8..4137542 100644
--- a/target/m68k/fpu_helper.c
+++ b/target/m68k/fpu_helper.c
@@ -396,14 +396,14 @@ typedef int (*float_access)(CPUM68KState *env, uint32_t addr, FPReg *fp,
                             uintptr_t ra);
 
 static uint32_t fmovem_predec(CPUM68KState *env, uint32_t addr, uint32_t mask,
-                               float_access access)
+                              float_access access_fn)
 {
     uintptr_t ra = GETPC();
     int i, size;
 
     for (i = 7; i >= 0; i--, mask <<= 1) {
         if (mask & 0x80) {
-            size = access(env, addr, &env->fregs[i], ra);
+            size = access_fn(env, addr, &env->fregs[i], ra);
             if ((mask & 0xff) != 0x80) {
                 addr -= size;
             }
@@ -414,14 +414,14 @@ static uint32_t fmovem_predec(CPUM68KState *env, uint32_t addr, uint32_t mask,
 }
 
 static uint32_t fmovem_postinc(CPUM68KState *env, uint32_t addr, uint32_t mask,
-                               float_access access)
+                               float_access access_fn)
 {
     uintptr_t ra = GETPC();
     int i, size;
 
     for (i = 0; i < 8; i++, mask <<= 1) {
         if (mask & 0x80) {
-            size = access(env, addr, &env->fregs[i], ra);
+            size = access_fn(env, addr, &env->fregs[i], ra);
             addr += size;
         }
     }
-- 
1.8.3.1



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

* Re: [Qemu-devel] [PATCH] target/m68k/fpu_helper.c: rename the access arguments
  2019-09-12 14:02 [Qemu-devel] [PATCH] target/m68k/fpu_helper.c: rename the access arguments KONRAD Frederic
@ 2019-09-12 14:32 ` Philippe Mathieu-Daudé
  2019-09-12 14:35   ` KONRAD Frederic
  2019-09-12 17:08 ` Laurent Vivier
  2019-09-19 10:12 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
  2 siblings, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2019-09-12 14:32 UTC (permalink / raw)
  To: KONRAD Frederic, qemu-devel, qemu-trivial; +Cc: Laurent Vivier

On 9/12/19 4:02 PM, KONRAD Frederic wrote:
> The "access" arguments clash with a macro under Windows with MinGW:
>   CC      m68k-softmmu/target/m68k/fpu_helper.o
>   target/m68k/fpu_helper.c: In function 'fmovem_predec':
>   target/m68k/fpu_helper.c:405:56: error: macro "access" passed 4 arguments,
>    but takes just 2
>                size = access(env, addr, &env->fregs[i], ra);
> 
> So this renames them access_fn.

access() is not your friend... this reminds me of

commit 05e015f73c3b5c50c237d3d8e555e25cfa543a5c
Author: KONRAD Frederic <frederic.konrad@adacore.com>
Date:   Thu Sep 21 12:04:20 2017 +0200

    memory: avoid a name clash with access macro

    This avoids a name clash with the access macro on windows 64:

    make
            CHK version_gen.h
      CC      aarch64-softmmu/memory.o
    /home/konrad/qemu/memory.c: In function 'access_with_adjusted_size':
    /home/konrad/qemu/memory.c:591:73: error: macro "access" passed 7
arguments, \
                     but takes just 2
                     (size - access_size - i) * 8, access_mask, attrs);
                                                                     ^
> 
> Tested with:
>  ./configure --target-list=m68k-softmmu
>  make -j8
> 
> Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>  target/m68k/fpu_helper.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/target/m68k/fpu_helper.c b/target/m68k/fpu_helper.c
> index 9b039c8..4137542 100644
> --- a/target/m68k/fpu_helper.c
> +++ b/target/m68k/fpu_helper.c
> @@ -396,14 +396,14 @@ typedef int (*float_access)(CPUM68KState *env, uint32_t addr, FPReg *fp,
>                              uintptr_t ra);
>  
>  static uint32_t fmovem_predec(CPUM68KState *env, uint32_t addr, uint32_t mask,
> -                               float_access access)
> +                              float_access access_fn)
>  {
>      uintptr_t ra = GETPC();
>      int i, size;
>  
>      for (i = 7; i >= 0; i--, mask <<= 1) {
>          if (mask & 0x80) {
> -            size = access(env, addr, &env->fregs[i], ra);
> +            size = access_fn(env, addr, &env->fregs[i], ra);
>              if ((mask & 0xff) != 0x80) {
>                  addr -= size;
>              }
> @@ -414,14 +414,14 @@ static uint32_t fmovem_predec(CPUM68KState *env, uint32_t addr, uint32_t mask,
>  }
>  
>  static uint32_t fmovem_postinc(CPUM68KState *env, uint32_t addr, uint32_t mask,
> -                               float_access access)
> +                               float_access access_fn)
>  {
>      uintptr_t ra = GETPC();
>      int i, size;
>  
>      for (i = 0; i < 8; i++, mask <<= 1) {
>          if (mask & 0x80) {
> -            size = access(env, addr, &env->fregs[i], ra);
> +            size = access_fn(env, addr, &env->fregs[i], ra);
>              addr += size;
>          }
>      }
> 


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

* Re: [Qemu-devel] [PATCH] target/m68k/fpu_helper.c: rename the access arguments
  2019-09-12 14:32 ` Philippe Mathieu-Daudé
@ 2019-09-12 14:35   ` KONRAD Frederic
  0 siblings, 0 replies; 5+ messages in thread
From: KONRAD Frederic @ 2019-09-12 14:35 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel, qemu-trivial; +Cc: Laurent Vivier



Le 9/12/19 à 4:32 PM, Philippe Mathieu-Daudé a écrit :
> On 9/12/19 4:02 PM, KONRAD Frederic wrote:
>> The "access" arguments clash with a macro under Windows with MinGW:
>>    CC      m68k-softmmu/target/m68k/fpu_helper.o
>>    target/m68k/fpu_helper.c: In function 'fmovem_predec':
>>    target/m68k/fpu_helper.c:405:56: error: macro "access" passed 4 arguments,
>>     but takes just 2
>>                 size = access(env, addr, &env->fregs[i], ra);
>>
>> So this renames them access_fn.
> 
> access() is not your friend... this reminds me of
> 
> commit 05e015f73c3b5c50c237d3d8e555e25cfa543a5c
> Author: KONRAD Frederic <frederic.konrad@adacore.com>
> Date:   Thu Sep 21 12:04:20 2017 +0200
> 
>      memory: avoid a name clash with access macro
> 
>      This avoids a name clash with the access macro on windows 64:

True, I didn't catch this one at the time because we didn't build m68k.

> 
>      make
>              CHK version_gen.h
>        CC      aarch64-softmmu/memory.o
>      /home/konrad/qemu/memory.c: In function 'access_with_adjusted_size':
>      /home/konrad/qemu/memory.c:591:73: error: macro "access" passed 7
> arguments, \
>                       but takes just 2
>                       (size - access_size - i) * 8, access_mask, attrs);
>                                                                       ^
>>
>> Tested with:
>>   ./configure --target-list=m68k-softmmu
>>   make -j8
>>
>> Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com>
> 
> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

Thanks!

Cheers,
Fred



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

* Re: [Qemu-devel] [PATCH] target/m68k/fpu_helper.c: rename the access arguments
  2019-09-12 14:02 [Qemu-devel] [PATCH] target/m68k/fpu_helper.c: rename the access arguments KONRAD Frederic
  2019-09-12 14:32 ` Philippe Mathieu-Daudé
@ 2019-09-12 17:08 ` Laurent Vivier
  2019-09-19 10:12 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier
  2 siblings, 0 replies; 5+ messages in thread
From: Laurent Vivier @ 2019-09-12 17:08 UTC (permalink / raw)
  To: KONRAD Frederic, qemu-devel, qemu-trivial

Le 12/09/2019 à 16:02, KONRAD Frederic a écrit :
> The "access" arguments clash with a macro under Windows with MinGW:
>   CC      m68k-softmmu/target/m68k/fpu_helper.o
>   target/m68k/fpu_helper.c: In function 'fmovem_predec':
>   target/m68k/fpu_helper.c:405:56: error: macro "access" passed 4 arguments,
>    but takes just 2
>                size = access(env, addr, &env->fregs[i], ra);
> 
> So this renames them access_fn.
> 
> Tested with:
>  ./configure --target-list=m68k-softmmu
>  make -j8
> 
> Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com>
> ---
>  target/m68k/fpu_helper.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/target/m68k/fpu_helper.c b/target/m68k/fpu_helper.c
> index 9b039c8..4137542 100644
> --- a/target/m68k/fpu_helper.c
> +++ b/target/m68k/fpu_helper.c
> @@ -396,14 +396,14 @@ typedef int (*float_access)(CPUM68KState *env, uint32_t addr, FPReg *fp,
>                              uintptr_t ra);
>  
>  static uint32_t fmovem_predec(CPUM68KState *env, uint32_t addr, uint32_t mask,
> -                               float_access access)
> +                              float_access access_fn)
>  {
>      uintptr_t ra = GETPC();
>      int i, size;
>  
>      for (i = 7; i >= 0; i--, mask <<= 1) {
>          if (mask & 0x80) {
> -            size = access(env, addr, &env->fregs[i], ra);
> +            size = access_fn(env, addr, &env->fregs[i], ra);
>              if ((mask & 0xff) != 0x80) {
>                  addr -= size;
>              }
> @@ -414,14 +414,14 @@ static uint32_t fmovem_predec(CPUM68KState *env, uint32_t addr, uint32_t mask,
>  }
>  
>  static uint32_t fmovem_postinc(CPUM68KState *env, uint32_t addr, uint32_t mask,
> -                               float_access access)
> +                               float_access access_fn)
>  {
>      uintptr_t ra = GETPC();
>      int i, size;
>  
>      for (i = 0; i < 8; i++, mask <<= 1) {
>          if (mask & 0x80) {
> -            size = access(env, addr, &env->fregs[i], ra);
> +            size = access_fn(env, addr, &env->fregs[i], ra);
>              addr += size;
>          }
>      }
> 

Reviewed-by: Laurent Vivier <laurent@vivier.eu>



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

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] target/m68k/fpu_helper.c: rename the access arguments
  2019-09-12 14:02 [Qemu-devel] [PATCH] target/m68k/fpu_helper.c: rename the access arguments KONRAD Frederic
  2019-09-12 14:32 ` Philippe Mathieu-Daudé
  2019-09-12 17:08 ` Laurent Vivier
@ 2019-09-19 10:12 ` Laurent Vivier
  2 siblings, 0 replies; 5+ messages in thread
From: Laurent Vivier @ 2019-09-19 10:12 UTC (permalink / raw)
  To: KONRAD Frederic, qemu-devel, qemu-trivial

Le 12/09/2019 à 16:02, KONRAD Frederic a écrit :
> The "access" arguments clash with a macro under Windows with MinGW:
>   CC      m68k-softmmu/target/m68k/fpu_helper.o
>   target/m68k/fpu_helper.c: In function 'fmovem_predec':
>   target/m68k/fpu_helper.c:405:56: error: macro "access" passed 4 arguments,
>    but takes just 2
>                size = access(env, addr, &env->fregs[i], ra);
> 
> So this renames them access_fn.
> 
> Tested with:
>  ./configure --target-list=m68k-softmmu
>  make -j8
> 
> Signed-off-by: KONRAD Frederic <frederic.konrad@adacore.com>
> ---
>  target/m68k/fpu_helper.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/target/m68k/fpu_helper.c b/target/m68k/fpu_helper.c
> index 9b039c8..4137542 100644
> --- a/target/m68k/fpu_helper.c
> +++ b/target/m68k/fpu_helper.c
> @@ -396,14 +396,14 @@ typedef int (*float_access)(CPUM68KState *env, uint32_t addr, FPReg *fp,
>                              uintptr_t ra);
>  
>  static uint32_t fmovem_predec(CPUM68KState *env, uint32_t addr, uint32_t mask,
> -                               float_access access)
> +                              float_access access_fn)
>  {
>      uintptr_t ra = GETPC();
>      int i, size;
>  
>      for (i = 7; i >= 0; i--, mask <<= 1) {
>          if (mask & 0x80) {
> -            size = access(env, addr, &env->fregs[i], ra);
> +            size = access_fn(env, addr, &env->fregs[i], ra);
>              if ((mask & 0xff) != 0x80) {
>                  addr -= size;
>              }
> @@ -414,14 +414,14 @@ static uint32_t fmovem_predec(CPUM68KState *env, uint32_t addr, uint32_t mask,
>  }
>  
>  static uint32_t fmovem_postinc(CPUM68KState *env, uint32_t addr, uint32_t mask,
> -                               float_access access)
> +                               float_access access_fn)
>  {
>      uintptr_t ra = GETPC();
>      int i, size;
>  
>      for (i = 0; i < 8; i++, mask <<= 1) {
>          if (mask & 0x80) {
> -            size = access(env, addr, &env->fregs[i], ra);
> +            size = access_fn(env, addr, &env->fregs[i], ra);
>              addr += size;
>          }
>      }
> 

Applied to my trivial-patches branch.

Thanks,
Laurent



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

end of thread, other threads:[~2019-09-19 10:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-12 14:02 [Qemu-devel] [PATCH] target/m68k/fpu_helper.c: rename the access arguments KONRAD Frederic
2019-09-12 14:32 ` Philippe Mathieu-Daudé
2019-09-12 14:35   ` KONRAD Frederic
2019-09-12 17:08 ` Laurent Vivier
2019-09-19 10:12 ` [Qemu-devel] [Qemu-trivial] " Laurent Vivier

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