diff options
Diffstat (limited to 'Xenogears/compil-2.lex')
-rw-r--r-- | Xenogears/compil-2.lex | 11 |
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); |