Ver código fonte

Clarify calculation precedence for '&' and '?'

Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
mvdan@mvdan.cc 10 anos atrás
pai
commit
4f21c41a1c
1 arquivos alterados com 3 adições e 3 exclusões
  1. 3 3
      st.c

+ 3 - 3
st.c

@@ -855,9 +855,9 @@ mousereport(XEvent *e) {
 	}
 
 	if(!IS_SET(MODE_MOUSEX10)) {
-		button += (state & ShiftMask   ? 4  : 0)
-			+ (state & Mod4Mask    ? 8  : 0)
-			+ (state & ControlMask ? 16 : 0);
+		button += ((state & ShiftMask  ) ? 4  : 0)
+			+ ((state & Mod4Mask   ) ? 8  : 0)
+			+ ((state & ControlMask) ? 16 : 0);
 	}
 
 	len = 0;