|
@@ -25,9 +25,12 @@
|
|
|
#define snprintf _snprintf
|
|
#define snprintf _snprintf
|
|
|
#endif
|
|
#endif
|
|
|
#ifdef __clang__
|
|
#ifdef __clang__
|
|
|
|
|
+#pragma clang diagnostic ignored "-Wold-style-cast" // warning : use of old-style cast // yes, they are more terse.
|
|
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations" // warning : 'xx' is deprecated: The POSIX name for this item.. // for strdup used in demo code (so user can copy & paste the code)
|
|
#pragma clang diagnostic ignored "-Wdeprecated-declarations" // warning : 'xx' is deprecated: The POSIX name for this item.. // for strdup used in demo code (so user can copy & paste the code)
|
|
|
#pragma clang diagnostic ignored "-Wint-to-void-pointer-cast" // warning : cast to 'void *' from smaller integer type 'int'
|
|
#pragma clang diagnostic ignored "-Wint-to-void-pointer-cast" // warning : cast to 'void *' from smaller integer type 'int'
|
|
|
#pragma clang diagnostic ignored "-Wformat-security" // warning : warning: format string is not a string literal
|
|
#pragma clang diagnostic ignored "-Wformat-security" // warning : warning: format string is not a string literal
|
|
|
|
|
+#pragma clang diagnostic ignored "-Wexit-time-destructors" // warning : declaration requires an exit-time destructor // exit-time destruction order is undefined. if MemFree() leads to users code that has been disabled before exit it might cause problems. ImGui coding style welcomes static/globals.
|
|
|
|
|
+#pragma clang diagnostic ignored "-Wreserved-id-macro" // warning : macro name is a reserved identifier //
|
|
|
#endif
|
|
#endif
|
|
|
#ifdef __GNUC__
|
|
#ifdef __GNUC__
|
|
|
#pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size
|
|
#pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size
|
|
@@ -2182,7 +2185,7 @@ struct ExampleAppConsole
|
|
|
// A better implementation would preserve the data on the current input line along with cursor position.
|
|
// A better implementation would preserve the data on the current input line along with cursor position.
|
|
|
if (prev_history_pos != HistoryPos)
|
|
if (prev_history_pos != HistoryPos)
|
|
|
{
|
|
{
|
|
|
- data->CursorPos = data->SelectionStart = data->SelectionEnd = data->BufTextLen = (int)snprintf(data->Buf, data->BufSize, "%s", (HistoryPos >= 0) ? History[HistoryPos] : "");
|
|
|
|
|
|
|
+ data->CursorPos = data->SelectionStart = data->SelectionEnd = data->BufTextLen = (int)snprintf(data->Buf, (size_t)data->BufSize, "%s", (HistoryPos >= 0) ? History[HistoryPos] : "");
|
|
|
data->BufDirty = true;
|
|
data->BufDirty = true;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -2340,7 +2343,7 @@ static void ShowExampleAppPropertyEditor(bool* p_open)
|
|
|
|
|
|
|
|
struct funcs
|
|
struct funcs
|
|
|
{
|
|
{
|
|
|
- static void ShowDummyObject(const char* prefix, ImU32 uid)
|
|
|
|
|
|
|
+ static void ShowDummyObject(const char* prefix, int uid)
|
|
|
{
|
|
{
|
|
|
ImGui::PushID(uid); // Use object uid as identifier. Most commonly you could also use the object pointer as a base ID.
|
|
ImGui::PushID(uid); // Use object uid as identifier. Most commonly you could also use the object pointer as a base ID.
|
|
|
ImGui::AlignFirstTextHeightToWidgets(); // Text and Tree nodes are less high than regular widgets, here we add vertical spacing to make the tree lines equal high.
|
|
ImGui::AlignFirstTextHeightToWidgets(); // Text and Tree nodes are less high than regular widgets, here we add vertical spacing to make the tree lines equal high.
|
|
@@ -2357,7 +2360,7 @@ static void ShowExampleAppPropertyEditor(bool* p_open)
|
|
|
ImGui::PushID(i); // Use field index as identifier.
|
|
ImGui::PushID(i); // Use field index as identifier.
|
|
|
if (i < 2)
|
|
if (i < 2)
|
|
|
{
|
|
{
|
|
|
- ShowDummyObject("Child", ImGui::GetID("foo"));
|
|
|
|
|
|
|
+ ShowDummyObject("Child", 424242);
|
|
|
}
|
|
}
|
|
|
else
|
|
else
|
|
|
{
|
|
{
|