summaryrefslogtreecommitdiff
path: root/opcodes/cgen-asm.in
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2001-10-13 09:38:04 +0000
committerNick Clifton <nickc@redhat.com>2001-10-13 09:38:04 +0000
commit37111cc7285ddcb9fbbc07ed43ecf344a3f4ee2f (patch)
treee602365ad5e8ff808885668cd003a7739fa91c5e /opcodes/cgen-asm.in
parent03dd63aa03bb1962c1c8756a64f869dae2c7b146 (diff)
downloadbinutils-gdb-37111cc7285ddcb9fbbc07ed43ecf344a3f4ee2f.tar.gz
Use safe-ctype.h not ctype.h
Diffstat (limited to 'opcodes/cgen-asm.in')
-rw-r--r--opcodes/cgen-asm.in39
1 files changed, 17 insertions, 22 deletions
diff --git a/opcodes/cgen-asm.in b/opcodes/cgen-asm.in
index 4ae36d00438..475a4f14690 100644
--- a/opcodes/cgen-asm.in
+++ b/opcodes/cgen-asm.in
@@ -26,7 +26,6 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
Keep that in mind. */
#include "sysdep.h"
-#include <ctype.h>
#include <stdio.h>
#include "ansidecl.h"
#include "bfd.h"
@@ -36,29 +35,29 @@ along with this program; if not, write to the Free Software Foundation, Inc.,
#include "opintl.h"
#include "xregex.h"
#include "libiberty.h"
+#include "safe-ctype.h"
-#undef min
+#undef min
#define min(a,b) ((a) < (b) ? (a) : (b))
-#undef max
+#undef max
#define max(a,b) ((a) > (b) ? (a) : (b))
static const char * parse_insn_normal
PARAMS ((CGEN_CPU_DESC, const CGEN_INSN *, const char **, CGEN_FIELDS *));
-/* -- assembler routines inserted here */
+/* -- assembler routines inserted here. */
-/*
- Regex construction routine.
+/* Regex construction routine.
- This translates an opcode syntax string into a regex string,
- by replacing any non-character syntax element (such as an
- opcode) with the pattern '.*'
+ This translates an opcode syntax string into a regex string,
+ by replacing any non-character syntax element (such as an
+ opcode) with the pattern '.*'
- It then compiles the regex and stores it in the opcode, for
- later use by @arch@_cgen_assemble_insn
+ It then compiles the regex and stores it in the opcode, for
+ later use by @arch@_cgen_assemble_insn
- Returns NULL for success, an error message for failure. */
+ Returns NULL for success, an error message for failure. */
char *
@arch@_cgen_build_insn_regex (insn)
@@ -66,7 +65,6 @@ char *
{
CGEN_OPCODE *opc = (CGEN_OPCODE *) CGEN_INSN_OPCODE (insn);
const char *mnem = CGEN_INSN_MNEMONIC (insn);
- int mnem_len;
char rxbuf[CGEN_MAX_RX_ELEMENTS];
char *rx = rxbuf;
const CGEN_SYNTAX_CHAR_TYPE *syn;
@@ -134,9 +132,6 @@ char *
*rx++ = c;
break;
}
-
- /* Insert syntax char into rx. */
- *rx++ = c;
}
else
{
@@ -170,7 +165,7 @@ char *
regfree ((regex_t *) CGEN_INSN_RX (insn));
free (CGEN_INSN_RX (insn));
(CGEN_INSN_RX (insn)) = NULL;
- return msg;
+ return msg;
}
}
@@ -211,14 +206,14 @@ parse_insn_normal (cd, insn, strp, fields)
GAS's input scrubber will ensure mnemonics are lowercase, but we may
not be called from GAS. */
p = CGEN_INSN_MNEMONIC (insn);
- while (*p && tolower (*p) == tolower (*str))
+ while (*p && TOLOWER (*p) == TOLOWER (*str))
++p, ++str;
if (* p)
return _("unrecognized instruction");
#ifndef CGEN_MNEMONIC_OPERANDS
- if (* str && !isspace (* str))
+ if (* str && ! ISSPACE (* str))
return _("unrecognized instruction");
#endif
@@ -247,7 +242,7 @@ parse_insn_normal (cd, insn, strp, fields)
first char after the mnemonic part is a space. */
/* FIXME: We also take inappropriate advantage of the fact that
GAS's input scrubber will remove extraneous blanks. */
- if (tolower (*str) == tolower (CGEN_SYNTAX_CHAR (* syn)))
+ if (TOLOWER (*str) == TOLOWER (CGEN_SYNTAX_CHAR (* syn)))
{
#ifdef CGEN_MNEMONIC_OPERANDS
if (CGEN_SYNTAX_CHAR(* syn) == ' ')
@@ -296,7 +291,7 @@ parse_insn_normal (cd, insn, strp, fields)
blanks now. IE: We needn't try again with a longer version of
the insn and it is assumed that longer versions of insns appear
before shorter ones (eg: lsr r2,r3,1 vs lsr r2,r3). */
- while (isspace (* str))
+ while (ISSPACE (* str))
++ str;
if (* str != '\0')
@@ -345,7 +340,7 @@ const CGEN_INSN *
int recognized_mnemonic = 0;
/* Skip leading white space. */
- while (isspace (* str))
+ while (ISSPACE (* str))
++ str;
/* The instructions are stored in hashed lists.