summaryrefslogtreecommitdiff
path: root/Xenogears/compil-2.lex
diff options
context:
space:
mode:
authorPixel <Pixel>2002-07-26 13:45:53 +0000
committerPixel <Pixel>2002-07-26 13:45:53 +0000
commitb5c9aec9a9725bac99f948dab8bececb43e414e1 (patch)
tree6e1f703a2b5dc3c58939a55f8bca98d4a6350987 /Xenogears/compil-2.lex
parent8cc5bf50f11bca8ee945e6716c68d609fdaa9e8f (diff)
Updated the lex thingies
Diffstat (limited to 'Xenogears/compil-2.lex')
-rw-r--r--Xenogears/compil-2.lex11
1 files changed, 6 insertions, 5 deletions
diff --git a/Xenogears/compil-2.lex b/Xenogears/compil-2.lex
index 805a964..931a04c 100644
--- a/Xenogears/compil-2.lex
+++ b/Xenogears/compil-2.lex
@@ -7,6 +7,8 @@
/* Waiting for OpCode arguments */
%s Op
+ #include <string.h>
+
int num_blocks = 0;
int num_lines = 0;
int cur_num_lines = 0;
@@ -21,8 +23,6 @@
%%
<INITIAL>"<Blocks:"\ *[[:digit:]]+">"\n {
- int i;
- char zeros[4] = {0, 0, 0, 0};
num_blocks = atoi(yytext + 8);
fprintf(stderr, "Number of blocks: %i\n", num_blocks);
@@ -175,9 +175,10 @@
<I>"<Bare"\ +[[:xdigit:]]{1,2}">" {
char str[5] = {'0', 'x', 0, 0, 0};
int d;
- for (yytext += 6; *yytext == ' '; yytext++);
- str[2] = *(yytext++);
- str[3] = *(yytext++);
+ char * _yytext = yytext;
+ for (_yytext += 6; *_yytext == ' '; _yytext++);
+ str[2] = *(_yytext++);
+ str[3] = *(_yytext++);
sscanf(str, "%i", &d);
if (d > 255) {
fprintf(stderr, "Error: Bare number too important: %i\n", d);