From 1d174f37da1407b7fbcbe46f48cf2697181c39ec Mon Sep 17 00:00:00 2001 From: "Anthony J. Bentley" Date: Wed, 7 Jan 2015 23:52:22 -0700 Subject: [PATCH] rgbasm: Convert oDontExpandStrings to bool. --- include/asm/asm.h | 5 +++-- src/asm/asmy.y | 10 +++++----- src/asm/globlex.c | 5 +++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/include/asm/asm.h b/include/asm/asm.h index 548a412e..8f743803 100644 --- a/include/asm/asm.h +++ b/include/asm/asm.h @@ -9,8 +9,9 @@ #ifndef ASMOTOR_ASM_ASM_H #define ASMOTOR_ASM_ASM_H -#include +#include #include +#include #include "asm/types.h" #include "asm/symbol.h" @@ -26,7 +27,7 @@ extern char tzCurrentFileName[_MAX_PATH + 1]; extern struct Section *pCurrentSection; extern struct sSymbol *tHashedSymbols[HASHSIZE]; extern struct sSymbol *pPCSymbol; -extern UBYTE oDontExpandStrings; +extern bool oDontExpandStrings; #define MAXMACROARGS 9 #define MAXINCPATHS 16 diff --git a/src/asm/asmy.y b/src/asm/asmy.y index b4837652..864003f7 100644 --- a/src/asm/asmy.y +++ b/src/asm/asmy.y @@ -706,11 +706,11 @@ dl : T_POP_DL constlist_32bit purge : T_POP_PURGE { - oDontExpandStrings=1; + oDontExpandStrings = true; } purge_list { - oDontExpandStrings=0; + oDontExpandStrings = false; } ; @@ -952,8 +952,8 @@ relocconst : T_ID { rpn_UNNOT(&$$,&$2); } | T_OP_BANK '(' T_ID ')' { rpn_Bank(&$$,$3); $$.nVal = 0; } - | T_OP_DEF { oDontExpandStrings=1; } '(' T_ID ')' - { rpn_Number(&$$,sym_isConstDefined($4)); oDontExpandStrings=0; } + | T_OP_DEF { oDontExpandStrings = true; } '(' T_ID ')' + { rpn_Number(&$$,sym_isConstDefined($4)); oDontExpandStrings = false; } | T_OP_ROUND '(' const ')' { rpn_Number(&$$,math_Round($3)); } | T_OP_CEIL '(' const ')' { rpn_Number(&$$,math_Ceil($3)); } | T_OP_FLOOR '(' const ')' { rpn_Number(&$$,math_Floor($3)); } @@ -1022,7 +1022,7 @@ const : T_ID { $$ = sym_GetConstantValue($1); } | T_OP_ACOS '(' const ')' { $$ = math_ACos($3); } | T_OP_ATAN '(' const ')' { $$ = math_ATan($3); } | T_OP_ATAN2 '(' const ',' const ')' { $$ = math_ATan2($3,$5); } - | T_OP_DEF { oDontExpandStrings=1; } '(' T_ID ')' { $$ = sym_isConstDefined($4); oDontExpandStrings=0; } + | T_OP_DEF { oDontExpandStrings = true; } '(' T_ID ')' { $$ = sym_isConstDefined($4); oDontExpandStrings = false; } | T_OP_STRCMP '(' string ',' string ')' { $$ = strcmp( $3, $5 ); } | T_OP_STRIN '(' string ',' string ')' { diff --git a/src/asm/globlex.c b/src/asm/globlex.c index c30a76b7..e2866661 100644 --- a/src/asm/globlex.c +++ b/src/asm/globlex.c @@ -7,12 +7,13 @@ #include "asmy.h" +#include #include #include #include #include -UBYTE oDontExpandStrings = 0; +bool oDontExpandStrings = false; SLONG nGBGfxID = -1; SLONG nBinaryID = -1; @@ -184,7 +185,7 @@ ParseSymbol(char *src, ULONG size) dest[copied] = 0; - if (oDontExpandStrings == 0 && sym_isString(dest)) { + if (!oDontExpandStrings && sym_isString(dest)) { char *s; yyskipbytes(size_backup);