aboutsummaryrefslogtreecommitdiff
path: root/include/opcode/cgen.h
diff options
context:
space:
mode:
authorJeff Johnston <jjohnstn@redhat.com>2001-01-09 17:01:07 +0000
committerJeff Johnston <jjohnstn@redhat.com>2001-01-09 17:01:07 +0000
commit8c1f9e76d2e75bd32925048a0ee9871aec6e81fe (patch)
tree9e8b80fc1c8eea80c116bee844d89d7727a55d0f /include/opcode/cgen.h
parent4a9f416d92db703b7396482b62889793a90fdb94 (diff)
downloadbinutils-8c1f9e76d2e75bd32925048a0ee9871aec6e81fe.zip
binutils-8c1f9e76d2e75bd32925048a0ee9871aec6e81fe.tar.gz
binutils-8c1f9e76d2e75bd32925048a0ee9871aec6e81fe.tar.bz2
2001-01-09 Jeff Johnston <jjohnstn@redhat.com>
* cgen.h (CGEN_SYNTAX_CHAR_TYPE): New typedef based on max number of operands (unsigned char or unsigned short). (CGEN_SYNTAX): Changed to make array CGEN_SYNTAX_CHAR_TYPE. (CGEN_SYNTAX_CHAR): Changed to cast to unsigned char.
Diffstat (limited to 'include/opcode/cgen.h')
-rw-r--r--include/opcode/cgen.h11
1 files changed, 8 insertions, 3 deletions
diff --git a/include/opcode/cgen.h b/include/opcode/cgen.h
index 632545d..f7962cd 100644
--- a/include/opcode/cgen.h
+++ b/include/opcode/cgen.h
@@ -1,6 +1,6 @@
/* Header file for targets using CGEN: Cpu tools GENerator.
-Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
This file is part of GDB, the GNU debugger, and the GNU Binutils.
@@ -746,15 +746,20 @@ typedef struct
#endif
#endif
+#if !defined(MAX_OPERANDS) || MAX_OPERANDS <= 127
+typedef unsigned char CGEN_SYNTAX_CHAR_TYPE;
+#else
+typedef unsigned short CGEN_SYNTAX_CHAR_TYPE;
+#endif
typedef struct
{
- unsigned char syntax[CGEN_MAX_SYNTAX_BYTES];
+ CGEN_SYNTAX_CHAR_TYPE syntax[CGEN_MAX_SYNTAX_BYTES];
} CGEN_SYNTAX;
#define CGEN_SYNTAX_STRING(syn) (syn->syntax)
#define CGEN_SYNTAX_CHAR_P(c) ((c) < 128)
-#define CGEN_SYNTAX_CHAR(c) (c)
+#define CGEN_SYNTAX_CHAR(c) ((unsigned char)c)
#define CGEN_SYNTAX_FIELD(c) ((c) - 128)
#define CGEN_SYNTAX_MAKE_FIELD(c) ((c) + 128)