From e24150c66b3566137d760299a9bc089dffc8c78f Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Tue, 9 Jan 2001 17:01:07 +0000 Subject: 2001-01-09 Jeff Johnston * 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. --- include/opcode/cgen.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'include/opcode/cgen.h') diff --git a/include/opcode/cgen.h b/include/opcode/cgen.h index 632545d27..f7962cd77 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) -- cgit v1.2.3