diff --git a/cpu/cpu.cpp b/cpu/cpu.cpp
index 11393d9..11e37a0 100644
--- a/cpu/cpu.cpp
+++ b/cpu/cpu.cpp
@@ -219,7 +219,7 @@ void Cpu::aluop8(AluOp op, u8 lhs, u8 rhs, u8& out, bool update_carry)
       break;
     }
 
-  state.halfcarry = (res16 & 0x10 != 0) || op == AND;
+  state.halfcarry = ((res16 & 0x10) != 0) || op == AND;
   state.subtract = (op == SUB) || (op == SBC) || (op == CP);
 
   switch(op)
@@ -247,7 +247,7 @@ void Cpu::aluop8(AluOp op, u8 lhs, u8 rhs, u8& out, bool update_carry)
   res = (u8)(res16 & 0xFF);
 
   if(update_carry)
-    state.carry = (res16 & 0x100 != 0);
+    state.carry = ((res16 & 0x100) != 0);
 
   state.zero = (res == 0);