From 6a546a500fb94e11c195850996575cb0d3f0e983 Mon Sep 17 00:00:00 2001 From: xndcn Date: Tue, 8 Sep 2020 11:49:30 +0800 Subject: [PATCH] ImVector: fix max_size() for signed int value. Amend 444873404 (#3429, #3460) --- imgui.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/imgui.h b/imgui.h index 71d1b20b..98a65699 100644 --- a/imgui.h +++ b/imgui.h @@ -1395,7 +1395,7 @@ struct ImVector inline bool empty() const { return Size == 0; } inline int size() const { return Size; } inline int size_in_bytes() const { return Size * (int)sizeof(T); } - inline int max_size() const { return (~(unsigned int)0) / (int)sizeof(T); } + inline int max_size() const { return 0x7FFFFFFF / (int)sizeof(T); } inline int capacity() const { return Capacity; } inline T& operator[](int i) { IM_ASSERT(i < Size); return Data[i]; } inline const T& operator[](int i) const { IM_ASSERT(i < Size); return Data[i]; }