Skip to content

Commit 5a29eef

Browse files
committed
Fixed further warnings with GCC/Clang (#219)
1 parent e32f093 commit 5a29eef

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

imgui_demo.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@
1919
#pragma warning (disable: 4996) // 'This function or variable may be unsafe': strcpy, strdup, sprintf, vsnprintf, sscanf, fopen
2020
#define snprintf _snprintf
2121
#endif
22+
#ifdef __clang__
23+
#pragma clang diagnostic ignored "-Wint-to-void-pointer-cast" // warning : cast to 'void *' from smaller integer type 'int'
24+
#endif
25+
#ifdef __GNUC__
26+
#pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size
27+
#endif
2228

2329
// Play it nice with Windows users. Notepad in 2015 still doesn't display text data with Unix-style \n.
2430
#ifdef _MSC_VER
@@ -1017,7 +1023,7 @@ void ImGui::ShowTestWindow(bool* opened)
10171023
if (i > 0) ImGui::SameLine();
10181024
ImGui::BeginGroup();
10191025
ImGui::Text("%s", i == 0 ? "Top" : i == 1 ? "25%" : i == 2 ? "Center" : i == 3 ? "75%" : "Bottom");
1020-
ImGui::BeginChild(ImGui::GetID((void *)(intptr_t)i), ImVec2(ImGui::GetWindowWidth() * 0.17f, 200.0f), true);
1026+
ImGui::BeginChild(ImGui::GetID((void*)i), ImVec2(ImGui::GetWindowWidth() * 0.17f, 200.0f), true);
10211027
if (scroll_to)
10221028
ImGui::SetScrollFromPosY(ImGui::GetCursorStartPos().y + scroll_to_px, i * 0.25f);
10231029
for (int line = 0; line < 100; line++)
@@ -1846,7 +1852,7 @@ struct ExampleAppConsole
18461852
while (word_start > data->Buf)
18471853
{
18481854
const char c = word_start[-1];
1849-
if (c == ' ' || c == '\t' || c == 0x3000 || c == ',' || c == ';')
1855+
if (c == ' ' || c == '\t' || c == ',' || c == ';')
18501856
break;
18511857
word_start--;
18521858
}

0 commit comments

Comments
 (0)