mirror of
https://github.com/Drezil/imgui.git
synced 2024-11-21 19:37:01 +00:00
ImVector: Stricter bound-checking asserts. Fix warnings: trailing comma (old compilers), zealous preprocessor warnings.
This commit is contained in:
parent
5f336ce8f8
commit
7b1ab5b275
@ -56,7 +56,7 @@ int main(int, char**)
|
||||
return 1;
|
||||
|
||||
// Decide GL+GLSL versions
|
||||
#if __APPLE__
|
||||
#ifdef __APPLE__
|
||||
// GL 3.2 + GLSL 150
|
||||
const char* glsl_version = "#version 150";
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
|
||||
|
@ -48,7 +48,7 @@ int main(int, char**)
|
||||
}
|
||||
|
||||
// Decide GL+GLSL versions
|
||||
#if __APPLE__
|
||||
#ifdef __APPLE__
|
||||
// GL 3.2 Core + GLSL 150
|
||||
const char* glsl_version = "#version 150";
|
||||
SDL_GL_SetAttribute(SDL_GL_CONTEXT_FLAGS, SDL_GL_CONTEXT_FORWARD_COMPATIBLE_FLAG); // Always required on Mac
|
||||
|
6
imgui.h
6
imgui.h
@ -1310,7 +1310,7 @@ enum ImGuiSliderFlags_
|
||||
|
||||
// Obsolete names (will be removed)
|
||||
#ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS
|
||||
, ImGuiSliderFlags_ClampOnInput = ImGuiSliderFlags_AlwaysClamp, // [renamed in 1.79]
|
||||
, ImGuiSliderFlags_ClampOnInput = ImGuiSliderFlags_AlwaysClamp // [renamed in 1.79]
|
||||
#endif
|
||||
};
|
||||
|
||||
@ -1408,8 +1408,8 @@ struct ImVector
|
||||
inline int size_in_bytes() const { return Size * (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]; }
|
||||
inline T& operator[](int i) { IM_ASSERT(i >= 0 && i < Size); return Data[i]; }
|
||||
inline const T& operator[](int i) const { IM_ASSERT(i >= 0 && i < Size); return Data[i]; }
|
||||
|
||||
inline void clear() { if (Data) { Size = Capacity = 0; IM_FREE(Data); Data = NULL; } }
|
||||
inline T* begin() { return Data; }
|
||||
|
Loading…
Reference in New Issue
Block a user