[waffle] [PATCH 2/4] core: silence MSVC compiler warning

Emil Velikov emil.l.velikov at gmail.com
Tue Aug 12 08:37:33 PDT 2014


The return type of wcore_attrib_list_length() is int32_t and at the same
time MSVC promotes the (int32_t) math at the return line to int64_t thus
causing a warning message. Explicitly cast it to make MSVC happy.

Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
---
 src/waffle/core/wcore_attrib_list.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/waffle/core/wcore_attrib_list.c b/src/waffle/core/wcore_attrib_list.c
index ba380b8..48d4b33 100644
--- a/src/waffle/core/wcore_attrib_list.c
+++ b/src/waffle/core/wcore_attrib_list.c
@@ -40,7 +40,7 @@ wcore_attrib_list_length(const int32_t attrib_list[])
     while (*i != 0)
         i += 2;
 
-    return (i - attrib_list) / 2;
+    return (int32_t) (i - attrib_list) / 2;
 }
 
 bool
-- 
2.0.2



More information about the waffle mailing list