:: commit 0b677c502a41ba20a423b7beb9b1ddc7028b8744

Mintsuki <mintsuki@protonmail.com> — 2026-02-08 16:12

parents: f1392ba4e7

lib/real: Parenthesise macro arguments in rm_seg/rm_off

diff --git a/common/lib/real.h b/common/lib/real.h
index 7ed1fcac..564de08e 100644
--- a/common/lib/real.h
+++ b/common/lib/real.h
@@ -4,8 +4,8 @@
 #include <stdint.h>
 #include <stdnoreturn.h>
 
-#define rm_seg(x) ((uint16_t)(((int)x & 0xffff0) >> 4))
-#define rm_off(x) ((uint16_t)(((int)x & 0x0000f) >> 0))
+#define rm_seg(x) ((uint16_t)(((int)(x) & 0xffff0) >> 4))
+#define rm_off(x) ((uint16_t)(((int)(x) & 0x0000f) >> 0))
 
 #define rm_desegment(seg, off) (((uint32_t)(seg) << 4) + (uint32_t)(off))
 
tab: 248 wrap: offon