aboutsummaryrefslogtreecommitdiff
path: root/opcodes/cgen-opc.c
diff options
context:
space:
mode:
Diffstat (limited to 'opcodes/cgen-opc.c')
-rw-r--r--opcodes/cgen-opc.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/opcodes/cgen-opc.c b/opcodes/cgen-opc.c
index 7d52284..263eb2c 100644
--- a/opcodes/cgen-opc.c
+++ b/opcodes/cgen-opc.c
@@ -376,10 +376,11 @@ cgen_get_insn_value (CGEN_CPU_DESC cd, unsigned char *buf, int length)
for (i = 0; i < length; i += insn_chunk_bitsize) /* NB: i == bits */
{
- int index;
+ int bit_index;
bfd_vma this_value;
- index = i; /* NB: not dependent on endianness; opposite of cgen_put_insn_value! */
- this_value = bfd_get_bits (& buf[index / 8], insn_chunk_bitsize, big_p);
+
+ bit_index = i; /* NB: not dependent on endianness; opposite of cgen_put_insn_value! */
+ this_value = bfd_get_bits (& buf[bit_index / 8], insn_chunk_bitsize, big_p);
value = (value << insn_chunk_bitsize) | this_value;
}
}
@@ -414,9 +415,10 @@ cgen_put_insn_value (CGEN_CPU_DESC cd,
for (i = 0; i < length; i += insn_chunk_bitsize) /* NB: i == bits */
{
- int index;
- index = (length - insn_chunk_bitsize - i); /* NB: not dependent on endianness! */
- bfd_put_bits ((bfd_vma) value, & buf[index / 8], insn_chunk_bitsize, big_p);
+ int bit_index;
+
+ bit_index = (length - insn_chunk_bitsize - i); /* NB: not dependent on endianness! */
+ bfd_put_bits ((bfd_vma) value, & buf[bit_index / 8], insn_chunk_bitsize, big_p);
value >>= insn_chunk_bitsize;
}
}