From 47f0f6e443f5fd1b32cd9e351f2254001c4d09cf Mon Sep 17 00:00:00 2001 From: Louis Gombert Date: Thu, 18 Apr 2024 19:14:25 +0200 Subject: [PATCH 1/2] UIEdit: set char to 0 instead of NULL --- ui/UIEdit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui/UIEdit.cpp b/ui/UIEdit.cpp index d595519c0..30b9a43d3 100644 --- a/ui/UIEdit.cpp +++ b/ui/UIEdit.cpp @@ -199,7 +199,7 @@ void UIEdit::SetText(char *text) { void UIEdit::GetText(char *buffer, int len) { // ASSERT(strlen(m_TextBuf) < (unsigned)len); if (!m_TextBuf) { - buffer[0] = NULL; + buffer[0] = 0; return; } strncpy(buffer, m_TextBuf, len - 1); From c68d6419c905b8b237fbd791d7c322f44fb8a13a Mon Sep 17 00:00:00 2001 From: Louis Gombert Date: Thu, 18 Apr 2024 19:14:48 +0200 Subject: [PATCH 2/2] Linux-clang: also apply -Wno-address-of-temporary --- CMakeLists.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f9db790f..2f4768c3d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,13 +12,12 @@ SET(CMAKE_POSITION_INDEPENDENT_CODE ON) IF (UNIX) SET (D3_GAMEDIR "~/Descent3/") - IF (APPLE) - SET(EXTRA_CXX_FLAGS "-Wno-address-of-temporary") - ELSE() - SET(EXTRA_CXX_FLAGS "-fpermissive") + + IF (UNIX AND NOT APPLE) + SET(EXTRA_CXX_FLAGS "-fpermissive ") ENDIF() - STRING(APPEND CMAKE_CXX_FLAGS " -Wno-write-strings -Wno-multichar ${BITS} ${EXTRA_CXX_FLAGS}") + STRING(APPEND CMAKE_CXX_FLAGS " -Wno-write-strings -Wno-multichar -Wno-address-of-temporary ${BITS} ${EXTRA_CXX_FLAGS}") STRING(APPEND CMAKE_C_FLAGS " ${BITS}") FIND_PACKAGE(SDL REQUIRED)