From e61d7bb3006f451968714e2f653412081871e1ee Mon Sep 17 00:00:00 2001 From: Sven van Haastregt Date: Fri, 11 Oct 2024 09:55:23 +0100 Subject: [PATCH] Fix Wformat warnings for printf `%p` The `%p` specifier expects a void pointer argument, so explicitly cast to `void *`. No functional changes. Signed-off-by: Sven van Haastregt --- glslang/CInterface/glslang_c_interface.cpp | 2 +- glslang/MachineIndependent/SymbolTable.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/glslang/CInterface/glslang_c_interface.cpp b/glslang/CInterface/glslang_c_interface.cpp index 465b3ee1..97f5a86d 100644 --- a/glslang/CInterface/glslang_c_interface.cpp +++ b/glslang/CInterface/glslang_c_interface.cpp @@ -324,7 +324,7 @@ static EProfile c_shader_profile(glslang_profile_t profile) GLSLANG_EXPORT glslang_shader_t* glslang_shader_create(const glslang_input_t* input) { if (!input || !input->code) { - printf("Error creating shader: null input(%p)/input->code\n", input); + printf("Error creating shader: null input(%p)/input->code\n", (void*)input); if (input) printf("input->code = %p\n", input->code); diff --git a/glslang/MachineIndependent/SymbolTable.cpp b/glslang/MachineIndependent/SymbolTable.cpp index 3b56e414..b6edb469 100644 --- a/glslang/MachineIndependent/SymbolTable.cpp +++ b/glslang/MachineIndependent/SymbolTable.cpp @@ -169,7 +169,7 @@ void TType::buildMangledName(TString& mangledName) const if (arraySizes->getDimNode(i)->getAsSymbolNode()) snprintf(buf, maxSize, "s%lld", arraySizes->getDimNode(i)->getAsSymbolNode()->getId()); else - snprintf(buf, maxSize, "s%p", arraySizes->getDimNode(i)); + snprintf(buf, maxSize, "s%p", (void*)(arraySizes->getDimNode(i))); } else snprintf(buf, maxSize, "%d", arraySizes->getDimSize(i)); mangledName += '[';