Use chartype.h instead of ctype.h

git-svn-id: svn://svn.cc65.org/cc65/trunk@593 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2001-01-05 19:24:47 +00:00
parent 37da7dff98
commit 8add1ad057
13 changed files with 43 additions and 81 deletions

View File

@@ -36,10 +36,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <time.h>
/* common */
#include "chartype.h"
#include "cmdline.h"
#include "target.h"
#include "tgttrans.h"
@@ -137,14 +137,14 @@ static void DefineSymbol (const char* Def)
char SymName [MAX_STR_LEN+1];
/* The symbol must start with a character or underline */
if (Def [0] != '_' && !isalpha (Def [0])) {
if (Def [0] != '_' && !IsAlpha (Def [0])) {
InvDef (Def);
}
P = Def;
/* Copy the symbol, checking the rest */
I = 0;
while (isalnum (*P) || *P == '_') {
while (IsAlNum (*P) || *P == '_') {
if (I <= MAX_STR_LEN) {
SymName [I++] = *P;
}

View File

@@ -35,9 +35,9 @@
#include <string.h>
#include <errno.h>
#include <ctype.h>
/* common */
#include "chartype.h"
#include "check.h"
#include "segdefs.h"
#include "xmalloc.h"
@@ -131,11 +131,11 @@ static Segment* NewSegment (const char* Name, unsigned SegType)
/* Check the segment name for invalid names */
N = Name;
if ((*N != '_' && !isalpha (*N)) || strlen (Name) > 80) {
if ((*N != '_' && !IsAlpha (*N)) || strlen (Name) > 80) {
Error (ERR_ILLEGAL_SEGMENT, Name);
}
do {
if (*N != '_' && !isalnum (*N)) {
if (*N != '_' && !IsAlNum (*N)) {
Error (ERR_ILLEGAL_SEGMENT, Name);
break;
}

View File

@@ -42,6 +42,7 @@
#include <sys/stat.h>
/* common */
#include "chartype.h"
#include "check.h"
#include "fname.h"
#include "xmalloc.h"
@@ -252,42 +253,10 @@ static void NextChar (void);
static int IsBlank (int C)
/* Return true if the character is a blank or tab */
{
return (C == ' ' || C == '\t');
}
static int IsDigit (int C)
/* Return true if the character is a digit */
{
return isdigit (C);
}
static int IsXDigit (int C)
/* Return true if the character is a hexadecimal digit */
{
return isxdigit (C);
}
static int IsDDigit (int C)
/* Return true if the character is a dual digit */
{
return (C == '0' || C == '1');
}
static int IsIdChar (int C)
/* Return true if the character is a valid character for an identifier */
{
return isalnum (C) ||
return IsAlNum (C) ||
(C == '_') ||
(C == '@' && AtInIdents) ||
(C == '$' && DollarInIdents);
@@ -298,7 +267,7 @@ static int IsIdChar (int C)
static int IsIdStart (int C)
/* Return true if the character may start an identifier */
{
return isalpha (C) || C == '_';
return IsAlpha (C) || C == '_';
}
@@ -692,13 +661,13 @@ Again:
NextChar ();
/* 0 or 1 must follow */
if (!IsDDigit (C)) {
if (!IsBDigit (C)) {
Error (ERR_01_EXPECTED);
}
/* Read the number */
IVal = 0;
while (IsDDigit (C)) {
while (IsBDigit (C)) {
if (IVal & 0x80000000) {
Error (ERR_NUM_OVERFLOW);
IVal = 0;