diff options
author | Olly Betts <olly@survex.com> | 2006-09-28 06:45:46 +0000 |
---|---|---|
committer | Olly Betts <olly@survex.com> | 2006-09-28 06:45:46 +0000 |
commit | eebc219854785ad06d31819a81499350c9258a6c (patch) | |
tree | 03081619c3ced89308ceb5f7d1a35123c15bf5a7 | |
parent | 57a68af35f3fdc183740f9315b002a43f1df2890 (diff) | |
download | swig-eebc219854785ad06d31819a81499350c9258a6c.tar.gz |
Use isxdigit().
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9374 626c5289-ae23-0410-ae9c-e8d60b6d4f22
-rw-r--r-- | Source/CParse/cscanner.c | 11 | ||||
-rw-r--r-- | Source/Swig/scanner.c | 11 |
2 files changed, 8 insertions, 14 deletions
diff --git a/Source/CParse/cscanner.c b/Source/CParse/cscanner.c index a2c9e05ad..89c47e950 100644 --- a/Source/CParse/cscanner.c +++ b/Source/CParse/cscanner.c @@ -886,7 +886,7 @@ int yylook(void) { } break; case 83: - /* Might be a hexidecimal or octal number */ + /* Might be a hexadecimal or octal number */ if ((c = nextchar()) == 0) return(0); if (isdigit(c)) state = 84; else if ((c == 'x') || (c == 'X')) state = 85; @@ -916,10 +916,7 @@ int yylook(void) { case 85: /* This is an hex number */ if ((c = nextchar()) == 0) return (0); - if ((isdigit(c)) || (c=='a') || (c=='b') || (c=='c') || - (c=='d') || (c=='e') || (c=='f') || (c=='A') || - (c=='B') || (c=='C') || (c=='D') || (c=='E') || - (c=='F')) + if (isxdigit(c)) state = 85; else if ((c == 'l') || (c == 'L')) { state = 87; @@ -942,7 +939,6 @@ int yylook(void) { retract(1); return(NUM_FLOAT); } - /* Parse a character constant. ie. 'a' */ break; case 87 : @@ -985,8 +981,9 @@ int yylook(void) { retract(1); return(NUM_ULONG); } - + case 9: + /* Parse a character constant. ie. 'a' */ if ((c = nextchar()) == 0) return (0); if (c == '\\') { yylen--; diff --git a/Source/Swig/scanner.c b/Source/Swig/scanner.c index ef340df05..d997164a8 100644 --- a/Source/Swig/scanner.c +++ b/Source/Swig/scanner.c @@ -232,7 +232,7 @@ look(SwigScanner *s) { case 0 : if((c = nextchar(s)) == 0) return(0); - /* Process delimeters */ + /* Process delimiters */ if (c == '\n') { return SWIG_TOKEN_ENDLINE; @@ -529,7 +529,7 @@ look(SwigScanner *s) { } break; case 83: - /* Might be a hexidecimal or octal number */ + /* Might be a hexadecimal or octal number */ if ((c = nextchar(s)) == 0) return SWIG_TOKEN_INT; if (isdigit(c)) state = 84; else if ((c == 'x') || (c == 'X')) state = 85; @@ -559,10 +559,7 @@ look(SwigScanner *s) { case 85: /* This is an hex number */ if ((c = nextchar(s)) == 0) return SWIG_TOKEN_INT; - if ((isdigit(c)) || (c=='a') || (c=='b') || (c=='c') || - (c=='d') || (c=='e') || (c=='f') || (c=='A') || - (c=='B') || (c=='C') || (c=='D') || (c=='E') || - (c=='F')) + if (isxdigit(c)) state = 85; else if ((c == 'l') || (c == 'L')) { state = 87; @@ -601,7 +598,7 @@ look(SwigScanner *s) { } else { retract(s,1); return SWIG_TOKEN_LONG; - } + } break; /* A long long integer */ |