From f2e9dddeca2f3e59f4a5e11dfa83e161dac82946 Mon Sep 17 00:00:00 2001 From: omar Date: Sat, 28 Apr 2018 10:43:15 +0200 Subject: [PATCH] DragDrop: Removed const qualifier from ImGuiPayload 's void* data, easing casting on user side. --- imgui.cpp | 4 ++-- imgui.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/imgui.cpp b/imgui.cpp index c51695da8..86f51c082 100644 --- a/imgui.cpp +++ b/imgui.cpp @@ -13029,14 +13029,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*)(intptr_t)payload.Data, data, data_size); + memcpy(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*)(intptr_t)payload.Data, data, data_size); + memcpy(payload.Data, data, data_size); } else { diff --git a/imgui.h b/imgui.h index f72668dca..06eeda715 100644 --- a/imgui.h +++ b/imgui.h @@ -1374,7 +1374,7 @@ struct ImGuiSizeCallbackData struct ImGuiPayload { // Members - const void* Data; // Data (copied and owned by dear imgui) + void* Data; // Data (copied and owned by dear imgui) int DataSize; // Data size // [Internal]