This patch ads explicit casting for the result of the CEIL macro. Since
the only place it's currently used for assignments is with variables
declared as ints, this shouldn't result in any change in behaviour in
the existing code, but it ensures the macro actually does exactly what
it says on the tin.

Eric
>From 72ba9ba0f70ac6e92cc901ad1395851fd9d5f046 Mon Sep 17 00:00:00 2001
From: Eric Pruitt <eric.pru...@gmail.com>
Date: Wed, 18 Jun 2014 09:03:11 -0500
Subject: [PATCH] Explicit cast of CEIL macro result

---
 st.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/st.c b/st.c
index 2cf9a26..858746d 100644
--- a/st.c
+++ b/st.c
@@ -77,7 +77,7 @@ char *argv0;
 #define ATTRCMP(a, b) ((a).mode != (b).mode || (a).fg != (b).fg || (a).bg != (b).bg)
 #define IS_SET(flag) ((term.mode & (flag)) != 0)
 #define TIMEDIFF(t1, t2) ((t1.tv_sec-t2.tv_sec)*1000 + (t1.tv_usec-t2.tv_usec)/1000)
-#define CEIL(x) (((x) != (int) (x)) ? (x) + 1 : (x))
+#define CEIL(x) ((int) (((x) != (int) (x)) ? (x) + 1 : (x)))
 #define MODBIT(x, set, bit) ((set) ? ((x) |= (bit)) : ((x) &= ~(bit)))
 
 #define TRUECOLOR(r,g,b) (1 << 24 | (r) << 16 | (g) << 8 | (b))
-- 
1.7.10.4

Reply via email to