]> git.sur5r.net Git - cc65/blobdiff - src/cc65/pragma.c
Allow any number of optional braces around all initializers as required by the standard
[cc65] / src / cc65 / pragma.c
index f4c38491b003504e10ea1c7d3c3f3f25afc215b9..bf93bcd5b948633bf6ab54e28601abd749bd6fb3 100644 (file)
@@ -37,6 +37,7 @@
 #include <string.h>
 
 /* common */
+#include "segnames.h"
 #include "tgttrans.h"
 
 /* cc65 */
@@ -47,7 +48,6 @@
 #include "litpool.h"
 #include "scanner.h"
 #include "scanstrbuf.h"
-#include "segments.h"
 #include "symtab.h"
 #include "pragma.h"
 
@@ -215,7 +215,6 @@ static void CharMapPragma (StrBuf* B)
     }
 
     /* Remap the character */
-    printf ("Translating %04lX to %04lX\n", Index, C);
     TgtTranslateSet ((unsigned) Index, (unsigned char) C);
 }
 
@@ -225,14 +224,9 @@ static void FlagPragma (StrBuf* B, unsigned char* Flag)
 /* Handle a pragma that expects a boolean paramater */
 {
     ident Ident;
+    long  Val;
 
-    if (SB_Peek (B) == '0') {
-        SB_Skip (B);
-        *Flag = 0;
-    } else if (SB_Peek (B) == '1') {
-        SB_Skip (B);
-        *Flag = 1;
-    } else if (SB_GetSym (B, Ident)) {
+    if (SB_GetSym (B, Ident)) {
         if (strcmp (Ident, "true") == 0 || strcmp (Ident, "on") == 0) {
             *Flag = 1;
         } else if (strcmp (Ident, "false") == 0 || strcmp (Ident, "off") == 0) {
@@ -240,6 +234,8 @@ static void FlagPragma (StrBuf* B, unsigned char* Flag)
         } else {
             Error ("Pragma argument must be one of `on', `off', `true' or `false'");
         }
+    } else if (SB_GetNumber (B, &Val)) {
+       *Flag = (Val != 0);
     } else {
         Error ("Invalid pragma argument");
     }