about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-07-30 09:58:13 -0700
committerKartik Agaram <vc@akkartik.com>2018-07-30 09:58:13 -0700
commit13346ddce48b72e143df153b65d7fc3b0873616a (patch)
tree4c3c3ca2a64016d7536956bc8579a5b15e4e464e
parentd98cc38e445ab076c57fdcd5de0d20589dbaa293 (diff)
downloadmu-13346ddce48b72e143df153b65d7fc3b0873616a.tar.gz
4452
Keep a few macros more tightly scoped to just the transform they're used in.
-rw-r--r--subx/022check_instruction.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/subx/022check_instruction.cc b/subx/022check_instruction.cc
index a4a4ec14..6fef09be 100644
--- a/subx/022check_instruction.cc
+++ b/subx/022check_instruction.cc
@@ -260,12 +260,11 @@ void init_permitted_operands() {
   // End Init Permitted Operands
 }
 
-:(before "End Includes")
+:(code)
 #define HAS(bitvector, bit)  ((bitvector) & (1 << (bit)))
 #define SET(bitvector, bit)  ((bitvector) | (1 << (bit)))
 #define CLEAR(bitvector, bit)  ((bitvector) & (~(1 << (bit))))
 
-:(code)
 void check_operands(const line& inst, const word& op) {
   if (!is_hex_byte(op)) return;
   uint8_t expected_bitvector = get(Permitted_operands, op.data);
@@ -605,6 +604,10 @@ string tolower(const char* s) {
   return out.str();
 }
 
+#undef HAS
+#undef SET
+#undef CLEAR
+
 //:: docs on each operand type
 
 :(before "End Help Texts")