diff options
author | Компан, Вячеслав Олегович <kompan.vo@phystech.edu> | 2018-09-28 16:00:46 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2018-09-28 16:00:46 -0400 |
commit | 2283a21049cdefb87cdd0f11df367266e3e029d1 (patch) | |
tree | eafd5a1c76fb0c91cacd8451c662c0d837563440 /sim/common/sim-core.c | |
parent | f67ffa6a785bee26bc23550670f85c6db578641f (diff) | |
download | binutils-gdb-2283a21049cdefb87cdd0f11df367266e3e029d1.tar.gz |
Change "xor" name in cpu_core to allow building with iso646.h or C++ compiler
This code was introduced back in 1998, and C99 appeared next year,
defining the `xor` as an 'alternative keyword' if iso646.h is
included. Moreover, C++98 defines it on the language level. As a
result, the code is not buildable with C++ compiler or if iso646.h is
included beforehand.
According to comment, `sim_cpu_core` is mostly a clone of `sim_core`,
so I renamed it to `byte_xor` as it's called in `sim_core`.
sim/common/ChangeLog:
* sim-core.h (sim_cpu_core): Rename cpu_core.xor to
cpu_core.byte_xor.
* sim-core.c (sim_core_set_xor): Likewise.
(sim_core_xor_read_buffer): Likewise.
(sim_core_xor_write_buffer): Likewise.
Diffstat (limited to 'sim/common/sim-core.c')
-rw-r--r-- | sim/common/sim-core.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sim/common/sim-core.c b/sim/common/sim-core.c index f26a374bb30..862f36b5f27 100644 --- a/sim/common/sim-core.c +++ b/sim/common/sim-core.c @@ -587,7 +587,7 @@ sim_core_set_xor (SIM_DESC sd, mask = 0; while (i - 1 < WITH_XOR_ENDIAN) { - cpu_core->xor[i-1] = mask; + cpu_core->byte_xor[i-1] = mask; mask = (mask << 1) & (WITH_XOR_ENDIAN - 1); i = (i << 1); } @@ -634,7 +634,8 @@ sim_core_xor_read_buffer (SIM_DESC sd, address_word addr, unsigned nr_bytes) { - address_word byte_xor = (cpu == NULL ? STATE_CORE (sd)->byte_xor : CPU_CORE (cpu)->xor[0]); + address_word byte_xor + = (cpu == NULL ? STATE_CORE (sd)->byte_xor : CPU_CORE (cpu)->byte_xor[0]); if (!WITH_XOR_ENDIAN || !byte_xor) return sim_core_read_buffer (sd, cpu, map, buffer, addr, nr_bytes); else @@ -686,7 +687,8 @@ sim_core_xor_write_buffer (SIM_DESC sd, address_word addr, unsigned nr_bytes) { - address_word byte_xor = (cpu == NULL ? STATE_CORE (sd)->byte_xor : CPU_CORE (cpu)->xor[0]); + address_word byte_xor + = (cpu == NULL ? STATE_CORE (sd)->byte_xor : CPU_CORE (cpu)->byte_xor[0]); if (!WITH_XOR_ENDIAN || !byte_xor) return sim_core_write_buffer (sd, cpu, map, buffer, addr, nr_bytes); else |