target/m68k/fpu_helper.c: rename the access arguments
PATCH 1/1 target/m68k/fpu_helper.c: rename the access arguments
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
--- target/m68k/fpu_helper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
target/m68k/fpu_helper.c +4 -4
@@ -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; } }
Signature · 1 line
1.8.3.1
Quoted 8 lines · KONRAD Frederic
The "access" arguments clash with a macro under Windows with MinGW:
CCm68k-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 2size = 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 <[email protected]> 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);
^Quoted 6 lines
Tested with:
./configure --target-list=m68k-softmmu
make -j8Signed-off-by KONRAD Frederic <[email protected]>
Quoted 43 lines
--- target/m68k/fpu_helper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)target/m68k/fpu_helper.c +4
-4@@ -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; } }
Le 9/12/19 à 4:32 PM, Philippe Mathieu-Daudé a écrit :
Quoted 12 lines · KONRAD Frederic
Quoted 8 lines
The "access" arguments clash with a macro under Windows with MinGW:
CCm68k-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
Quoted 7 lines
commit
05e015f73c3b5c50c237d3d8e555e25cfa543a5cAuthor: KONRAD Frederic <[email protected]> Date: Thu Sep 21 12:04:20 2017 +0200memory: 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.
Quoted 11 lines
make
CHKversion_gen.h
CCaarch64-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 7arguments, \ but takes just 2 (size - access_size - i) * 8, access_mask, attrs); ^Quoted 1 line
Quoted 7 lines
Quoted 5 lines
Tested with:
./configure --target-list=m68k-softmmu
make -j8Signed-off-by KONRAD Frederic <[email protected]>Reviewed-by Philippe Mathieu-Daudé <[email protected]>
Thanks!
Cheers,
Fred
Le 12/09/2019 à 16:02, KONRAD Frederic a écrit :
Quoted 47 lines
The "access" arguments clash with a macro under Windows with MinGW:
CCm68k-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 2size = access(env, addr, &env->fregs[i], ra);So this renames them
access_fn.Tested with:
./configure --target-list=m68k-softmmu
make -j8Signed-off-by KONRAD Frederic <[email protected]>--- target/m68k/fpu_helper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)target/m68k/fpu_helper.c +3
-3@@ -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) {
target/m68k/fpu_helper.c static uint32_t fmovem_predec(CPUM68KState *env, uint32_t addr, uint32_t mask, · line 427
Quoted 10 lines
target/m68k/fpu_helper.c +1
-1uintptr_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; } }
Laurent Vivier
AppliedLe 12/09/2019 à 16:02, KONRAD Frederic a écrit :
Quoted 47 lines
The "access" arguments clash with a macro under Windows with MinGW:
CCm68k-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 2size = access(env, addr, &env->fregs[i], ra);So this renames them
access_fn.Tested with:
./configure --target-list=m68k-softmmu
make -j8Signed-off-by KONRAD Frederic <[email protected]>--- target/m68k/fpu_helper.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)target/m68k/fpu_helper.c +3
-3@@ -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) {
target/m68k/fpu_helper.c static uint32_t fmovem_predec(CPUM68KState *env, uint32_t addr, uint32_t mask, · line 427
Quoted 10 lines
target/m68k/fpu_helper.c +1
-1uintptr_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