Skip to content

Commit

Permalink
Fixed warnings for more pedantic settings (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornut committed Jul 3, 2015
1 parent 2f03511 commit 7437b43
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/opengl3_example/imgui_impl_glfw_gl3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static void ImGui_ImplGlfwGL3_RenderDrawLists(ImDrawList** const cmd_lists, int
if (g_VboSize < needed_vtx_size)
{
g_VboSize = needed_vtx_size + 5000 * sizeof(ImDrawVert); // Grow buffer
glBufferData(GL_ARRAY_BUFFER, g_VboSize, NULL, GL_STREAM_DRAW);
glBufferData(GL_ARRAY_BUFFER, (GLsizeiptr)g_VboSize, NULL, GL_STREAM_DRAW);
}

// Copy and convert all vertices into a single contiguous buffer
Expand Down
2 changes: 1 addition & 1 deletion examples/opengl_example/imgui_impl_glfw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ static void ImGui_ImplGlfw_RenderDrawLists(ImDrawList** const cmd_lists, int cmd
{
glBindTexture(GL_TEXTURE_2D, (GLuint)(intptr_t)pcmd->texture_id);
glScissor((int)pcmd->clip_rect.x, (int)(height - pcmd->clip_rect.w), (int)(pcmd->clip_rect.z - pcmd->clip_rect.x), (int)(pcmd->clip_rect.w - pcmd->clip_rect.y));
glDrawArrays(GL_TRIANGLES, vtx_offset, pcmd->vtx_count);
glDrawArrays(GL_TRIANGLES, vtx_offset, (GLsizei)pcmd->vtx_count);
}
vtx_offset += pcmd->vtx_count;
}
Expand Down
6 changes: 2 additions & 4 deletions imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -719,10 +719,8 @@ void ImGuiIO::AddInputCharacter(ImWchar c)
const float IM_PI = 3.14159265358979323846f;

#ifdef INT_MAX
#define IM_INT_MIN INT_MIN
#define IM_INT_MAX INT_MAX
#else
#define IM_INT_MIN (-2147483647-1)
#define IM_INT_MAX (2147483647)
#endif

Expand All @@ -742,7 +740,7 @@ static inline ImVec2 operator-(const ImVec2& lhs, const ImVec2& rhs)
static inline ImVec2 operator*(const ImVec2& lhs, const ImVec2 rhs) { return ImVec2(lhs.x*rhs.x, lhs.y*rhs.y); }
static inline ImVec2 operator/(const ImVec2& lhs, const ImVec2 rhs) { return ImVec2(lhs.x/rhs.x, lhs.y/rhs.y); }
static inline ImVec2& operator+=(ImVec2& lhs, const ImVec2& rhs) { lhs.x += rhs.x; lhs.y += rhs.y; return lhs; }
static inline ImVec2& operator-=(ImVec2& lhs, const ImVec2& rhs) { lhs.x -= rhs.x; lhs.y -= rhs.y; return lhs; }
//static inline ImVec2& operator-=(ImVec2& lhs, const ImVec2& rhs) { lhs.x -= rhs.x; lhs.y -= rhs.y; return lhs; }
static inline ImVec2& operator*=(ImVec2& lhs, const float rhs) { lhs.x *= rhs; lhs.y *= rhs; return lhs; }
//static inline ImVec2& operator/=(ImVec2& lhs, const float rhs) { lhs.x /= rhs; lhs.y /= rhs; return lhs; }
static inline ImVec4 operator-(const ImVec4& lhs, const ImVec4& rhs) { return ImVec4(lhs.x-rhs.x, lhs.y-rhs.y, lhs.z-rhs.z, lhs.w-lhs.w); }
Expand Down Expand Up @@ -11530,7 +11528,7 @@ void ImGui::ShowTestWindow(bool* opened)
if (i > 0) ImGui::SameLine();
ImGui::BeginGroup();
ImGui::Text("%s", i == 0 ? "Top" : i == 1 ? "25%" : i == 2 ? "Center" : i == 3 ? "75%" : "Bottom");
ImGui::BeginChild(ImGui::GetID((void *)i), ImVec2(ImGui::GetWindowWidth() * 0.17f, 200.0f), true);
ImGui::BeginChild(ImGui::GetID((void *)(intptr_t)i), ImVec2(ImGui::GetWindowWidth() * 0.17f, 200.0f), true);
if (scroll_to)
ImGui::SetScrollFromPosY(ImGui::GetCursorStartPos().y + scroll_to_px, i * 0.25f);
for (int line = 0; line < 100; line++)
Expand Down

0 comments on commit 7437b43

Please sign in to comment.