Remove #include <stdbool.h> from mach/powerpc/as/mach1.c
authorGeorge Koehler <xkernigh@netscape.net>
Mon, 30 Jan 2017 21:39:23 +0000 (16:39 -0500)
committerGeorge Koehler <xkernigh@netscape.net>
Mon, 30 Jan 2017 21:39:23 +0000 (16:39 -0500)
We should not include a system header file here, because
mach/proto/as/comm2.y goes through cpp twice.  The include can cause
problems like https://github.com/davidgiven/ack/issues/1

Remove this include #<stdbool.h> and leave a comment pointing to the
includes in comm0.h.  Change the few instances of bool, false, true,
to int, 0, 1.

mach/powerpc/as/mach1.c
mach/powerpc/as/mach4.c
mach/powerpc/as/mach5.c

index a1977f4..44b415f 100644 (file)
@@ -3,7 +3,9 @@
  * $State$
  */
 
-#include <stdbool.h>
+/*
+ * Do not #include anything here.  Do it in mach/proto/as/comm0.h
+ */
 
-extern word_t emit_hi(struct expr_t* expr, bool is_signed);
+extern word_t emit_hi(struct expr_t* expr, int is_signed);
 extern word_t emit_lo(struct expr_t* expr);
index 7464dcb..640573f 100644 (file)
@@ -218,8 +218,8 @@ e16
                        serror("16-bit value out of range");
                $$ = (uint16_t) $1;
        }
-       | OP_HI ASC_LPAR expr ASC_RPAR           { $$ = emit_hi(&$3, false); }
-       | OP_HA ASC_LPAR expr ASC_RPAR           { $$ = emit_hi(&$3, true); }
+       | OP_HI ASC_LPAR expr ASC_RPAR           { $$ = emit_hi(&$3, 0); }
+       | OP_HA ASC_LPAR expr ASC_RPAR           { $$ = emit_hi(&$3, 1); }
        | OP_LO ASC_LPAR expr ASC_RPAR           { $$ = emit_lo(&$3); }
        ;
 
index 87d5140..4746079 100644 (file)
@@ -1,5 +1,5 @@
 
-word_t emit_hi(struct expr_t* expr, bool is_signed)
+word_t emit_hi(struct expr_t* expr, int is_signed)
 {
     /* If this is a symbol reference, discard the symbol and keep only the
         * offset part. */