From f768579377521b0b1d1b25120780043df29761e7 Mon Sep 17 00:00:00 2001 From: ocornut Date: Sun, 26 Oct 2014 18:57:19 +0000 Subject: [PATCH] GCC warning fix --- imgui.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index 2e5b5e6c..9e71281f 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -4645,11 +4645,13 @@ bool ColorEdit4(const char* label, float col[4], bool alpha) char* p = buf; while (*p == '#' || *p == ' ' || *p == '\t') p++; + + // Treat at unsigned (%X is unsigned) ix = iy = iz = iw = 0; if (alpha) - sscanf(p, "%02X%02X%02X%02X", &ix, &iy, &iz, &iw); + sscanf(p, "%02X%02X%02X%02X", (unsigned int*)&ix, (unsigned int*)&iy, (unsigned int*)&iz, (unsigned int*)&iw); else - sscanf(p, "%02X%02X%02X", &ix, &iy, &iz); + sscanf(p, "%02X%02X%02X", (unsigned int*)&ix, (unsigned int*)&iy, (unsigned int*)&iz); } break; }