summaryrefslogtreecommitdiff
path: root/opcodes/cgen-opc.c
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2001-09-19 05:33:36 +0000
committerH.J. Lu <hjl.tools@gmail.com>2001-09-19 05:33:36 +0000
commit3882b010780ca1aa1ed5d7b38e936cd2d6d5486b (patch)
treec806a73a13afd3265ba6b538ba73cae065c591f5 /opcodes/cgen-opc.c
parent6b819c92c4512ccfba90f0caa204ab687fae8254 (diff)
downloadbinutils-gdb-3882b010780ca1aa1ed5d7b38e936cd2d6d5486b.tar.gz
Locale changes from Bruno Haible <haible@clisp.cons.org>.
Diffstat (limited to 'opcodes/cgen-opc.c')
-rw-r--r--opcodes/cgen-opc.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/opcodes/cgen-opc.c b/opcodes/cgen-opc.c
index 9dfc16e9e51..06544ca057d 100644
--- a/opcodes/cgen-opc.c
+++ b/opcodes/cgen-opc.c
@@ -20,10 +20,10 @@
59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "sysdep.h"
-#include <ctype.h>
#include <stdio.h>
#include "ansidecl.h"
#include "libiberty.h"
+#include "safe-ctype.h"
#include "bfd.h"
#include "symcat.h"
#include "opcode/cgen.h"
@@ -69,9 +69,7 @@ cgen_keyword_lookup_name (kt, name)
while (*p
&& (*p == *n
- || (isalpha ((unsigned char) *p)
- && (tolower ((unsigned char) *p)
- == tolower ((unsigned char) *n)))))
+ || (ISALPHA (*p) && (TOLOWER (*p) == TOLOWER (*n)))))
++n, ++p;
if (!*p && !*n)
@@ -135,7 +133,7 @@ cgen_keyword_add (kt, ke)
kt->null_entry = ke;
for (i = 1; i < strlen (ke->name); i++)
- if (! isalnum ((unsigned char) ke->name[i])
+ if (! ISALNUM (ke->name[i])
&& ! strchr (kt->nonalpha_chars, ke->name[i]))
{
size_t idx = strlen (kt->nonalpha_chars);
@@ -232,7 +230,7 @@ hash_keyword_name (kt, name, case_sensitive_p)
hash = (hash * 97) + (unsigned char) *name;
else
for (hash = 0; *name; ++name)
- hash = (hash * 97) + (unsigned char) tolower (*name);
+ hash = (hash * 97) + (unsigned char) TOLOWER (*name);
return hash % kt->hash_table_size;
}