public
/
ack.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6722c28
)
fixed: did not compute hexadecimal numbers right
author
ceriel
<none@none>
Tue, 26 Apr 1988 13:47:02 +0000
(13:47 +0000)
committer
ceriel
<none@none>
Tue, 26 Apr 1988 13:47:02 +0000
(13:47 +0000)
lang/m2/comp/LLlex.c
patch
|
blob
|
history
diff --git
a/lang/m2/comp/LLlex.c
b/lang/m2/comp/LLlex.c
index
ca1b208
..
4506d09
100644
(file)
--- a/
lang/m2/comp/LLlex.c
+++ b/
lang/m2/comp/LLlex.c
@@
-496,9
+496,17
@@
again:
tk->TOK_INT = 0;
while (*np) {
arith old = tk->TOK_INT;
-
+ int c;
+
+ if (is_dig(*np)) {
+ c = *np++ - '0';
+ }
+ else {
+ assert(is_hex(*np));
+ c = *np++ - 'A' + 10;
+ }
tk->TOK_INT = tk->TOK_INT*base
- +
(*np++ - '0')
;
+ +
c
;
sgnswtch += (old < 0) ^
(tk->TOK_INT < 0);
}