From 1c23981782a9c1c20b97f6a5bfb101f29b5bca55 Mon Sep 17 00:00:00 2001 From: omar Date: Thu, 7 Mar 2019 16:09:11 +0100 Subject: [PATCH] Made ImS8 and ImS16 explicitly signed in case some crazy SDK decide to flip the signedness over. (#2408) --- imgui.h | 4 ++-- imgui_widgets.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/imgui.h b/imgui.h index 748313ec0..9ee597bf8 100644 --- a/imgui.h +++ b/imgui.h @@ -150,9 +150,9 @@ typedef int (*ImGuiInputTextCallback)(ImGuiInputTextCallbackData *data); typedef void (*ImGuiSizeCallback)(ImGuiSizeCallbackData* data); // Scalar data types -typedef char ImS8; // 8-bit signed integer == char +typedef signed char ImS8; // 8-bit signed integer == char typedef unsigned char ImU8; // 8-bit unsigned integer -typedef short ImS16; // 16-bit signed integer +typedef signed short ImS16; // 16-bit signed integer typedef unsigned short ImU16; // 16-bit unsigned integer typedef signed int ImS32; // 32-bit signed integer == int typedef unsigned int ImU32; // 32-bit unsigned integer (often used to store packed colors) diff --git a/imgui_widgets.cpp b/imgui_widgets.cpp index 965cef979..0f52b454a 100644 --- a/imgui_widgets.cpp +++ b/imgui_widgets.cpp @@ -74,12 +74,12 @@ Index of this file: //------------------------------------------------------------------------- // Those MIN/MAX values are not define because we need to point to them -static const char IM_S8_MIN = -128; -static const char IM_S8_MAX = 127; +static const signed char IM_S8_MIN = -128; +static const signed char IM_S8_MAX = 127; static const unsigned char IM_U8_MIN = 0; static const unsigned char IM_U8_MAX = 0xFF; -static const short IM_S16_MIN = -32768; -static const short IM_S16_MAX = 32767; +static const signed short IM_S16_MIN = -32768; +static const signed short IM_S16_MAX = 32767; static const unsigned short IM_U16_MIN = 0; static const unsigned short IM_U16_MAX = 0xFFFF; static const ImS32 IM_S32_MIN = INT_MIN; // (-2147483647 - 1), (0x80000000);