mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-04 03:58:47 +02:00
Removed need for -Wnocast-qual on modern Clang/Xcode as a token of good behavior. Unfortunately the old stb_ decompress code is a little const clunky. + warning fix in stb_textedit which is already in master afaik.
This commit is contained in:
12
imgui.cpp
12
imgui.cpp
@ -688,14 +688,12 @@
|
||||
#pragma clang diagnostic ignored "-Wsign-conversion" // warning : implicit conversion changes signedness //
|
||||
#pragma clang diagnostic ignored "-Wformat-pedantic" // warning : format specifies type 'void *' but the argument has type 'xxxx *' // unreasonable, would lead to casting every %p arg to void*. probably enabled by -pedantic.
|
||||
#pragma clang diagnostic ignored "-Wint-to-void-pointer-cast" // warning : cast to 'void *' from smaller integer type 'int'
|
||||
#pragma clang diagnostic ignored "-Wcast-qual" // warning : cast from 'const xxxx *' to 'xxxx *' drops const qualifier
|
||||
#elif defined(__GNUC__)
|
||||
#pragma GCC diagnostic ignored "-Wunused-function" // warning: 'xxxx' defined but not used
|
||||
#pragma GCC diagnostic ignored "-Wint-to-pointer-cast" // warning: cast to pointer from integer of different size
|
||||
#pragma GCC diagnostic ignored "-Wformat" // warning: format '%p' expects argument of type 'void*', but argument 6 has type 'ImGuiWindow*'
|
||||
#pragma GCC diagnostic ignored "-Wdouble-promotion" // warning: implicit conversion from 'float' to 'double' when passing argument to function
|
||||
#pragma GCC diagnostic ignored "-Wconversion" // warning: conversion to 'xxxx' from 'xxxx' may alter its value
|
||||
#pragma GCC diagnostic ignored "-Wcast-qual" // warning: cast from type 'const xxxx *' to type 'xxxx *' casts away qualifiers
|
||||
#pragma GCC diagnostic ignored "-Wformat-nonliteral" // warning: format not a string literal, format string not checked
|
||||
#pragma GCC diagnostic ignored "-Wstrict-overflow" // warning: assuming signed overflow does not occur when assuming that (X - c) > X is always false
|
||||
#endif
|
||||
@ -3763,7 +3761,7 @@ static void LoadIniSettingsFromMemory(const char* buf_readonly)
|
||||
line_end[-1] = 0;
|
||||
const char* name_end = line_end - 1;
|
||||
const char* type_start = line + 1;
|
||||
char* type_end = (char*)ImStrchrRange(type_start, name_end, ']');
|
||||
char* type_end = (char*)(intptr_t)ImStrchrRange(type_start, name_end, ']');
|
||||
const char* name_start = type_end ? ImStrchrRange(type_end + 1, name_end, '[') : NULL;
|
||||
if (!type_end || !name_start)
|
||||
{
|
||||
@ -3839,8 +3837,8 @@ static void MarkIniSettingsDirty(ImGuiWindow* window)
|
||||
// FIXME: Add a more explicit sort order in the window structure.
|
||||
static int IMGUI_CDECL ChildWindowComparer(const void* lhs, const void* rhs)
|
||||
{
|
||||
const ImGuiWindow* a = *(const ImGuiWindow**)lhs;
|
||||
const ImGuiWindow* b = *(const ImGuiWindow**)rhs;
|
||||
const ImGuiWindow* const a = *(const ImGuiWindow* const *)lhs;
|
||||
const ImGuiWindow* const b = *(const ImGuiWindow* const *)rhs;
|
||||
if (int d = (a->Flags & ImGuiWindowFlags_Popup) - (b->Flags & ImGuiWindowFlags_Popup))
|
||||
return d;
|
||||
if (int d = (a->Flags & ImGuiWindowFlags_Tooltip) - (b->Flags & ImGuiWindowFlags_Tooltip))
|
||||
@ -12935,14 +12933,14 @@ bool ImGui::SetDragDropPayload(const char* type, const void* data, size_t data_s
|
||||
// Store in heap
|
||||
g.DragDropPayloadBufHeap.resize((int)data_size);
|
||||
payload.Data = g.DragDropPayloadBufHeap.Data;
|
||||
memcpy((void*)payload.Data, data, data_size);
|
||||
memcpy((void*)(intptr_t)payload.Data, data, data_size);
|
||||
}
|
||||
else if (data_size > 0)
|
||||
{
|
||||
// Store locally
|
||||
memset(&g.DragDropPayloadBufLocal, 0, sizeof(g.DragDropPayloadBufLocal));
|
||||
payload.Data = g.DragDropPayloadBufLocal;
|
||||
memcpy((void*)payload.Data, data, data_size);
|
||||
memcpy((void*)(intptr_t)payload.Data, data, data_size);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user