[binutils-gdb] x86: replace off-by-one OTMax

Jan Beulich jbeulich@sourceware.org
Wed Jul 11 08:26:00 GMT 2018


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=f0a85b07061964d6c608e6280ce61aa3fed1eabf

commit f0a85b07061964d6c608e6280ce61aa3fed1eabf
Author: Jan Beulich <jbeulich@novell.com>
Date:   Wed Jul 11 10:24:44 2018 +0200

    x86: replace off-by-one OTMax
    
    With its name it should equal to the largest prior enumerator, which is
    not very helpful as that will change every once in a while. Rename it to
    OTNum instead to make name and value match, and correct use sites to no
    longer use one too large a value.

Diff:
---
 opcodes/ChangeLog  | 6 ++++++
 opcodes/i386-opc.h | 8 ++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/opcodes/ChangeLog b/opcodes/ChangeLog
index f8272b8..a73380a 100644
--- a/opcodes/ChangeLog
+++ b/opcodes/ChangeLog
@@ -1,3 +1,9 @@
+2018-07-11  Jan Beulich  <jbeulich@suse.com>
+
+	* i386-opc.h: Rename OTMax to OTNum.
+	(OTNumOfUints): Adjust calculation.
+	(OTUnused): Directly alias to OTNum.
+
 2018-07-09  Maciej W. Rozycki  <macro@mips.com>
 
 	* s12z-dis.c (lea_reg_xys_opr): Rename `reg' local variable to
diff --git a/opcodes/i386-opc.h b/opcodes/i386-opc.h
index 9a22b3c..4f12830 100644
--- a/opcodes/i386-opc.h
+++ b/opcodes/i386-opc.h
@@ -765,18 +765,18 @@ enum
   /* Bound register.  */
   RegBND,
 
-  /* The last bitfield in i386_operand_type.  */
-  OTMax
+  /* The number of bitfields in i386_operand_type.  */
+  OTNum
 };
 
 #define OTNumOfUints \
-  (OTMax / sizeof (unsigned int) / CHAR_BIT + 1)
+  ((OTNum - 1) / sizeof (unsigned int) / CHAR_BIT + 1)
 #define OTNumOfBits \
   (OTNumOfUints * sizeof (unsigned int) * CHAR_BIT)
 
 /* If you get a compiler error for zero width of the unused field,
    comment it out.  */
-#define OTUnused		(OTMax + 1)
+#define OTUnused		OTNum
 
 typedef union i386_operand_type
 {



More information about the Binutils-cvs mailing list