Warning fixes

This commit is contained in:
Henrik Rydgård 2024-11-06 11:58:06 +01:00
parent 447a78e453
commit 55aa1ff66e
3 changed files with 9 additions and 4 deletions

View File

@ -383,8 +383,12 @@ if(NOT MSVC)
add_definitions(-DPNG_ARM_NEON_OPT=0)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Werror=return-type -Wno-unused-function -Wno-sign-compare -Wno-unused-but-set-variable -Wno-reorder -Wno-unknown-pragmas -Wno-unused-value -Wno-unused-variable")
if(NOT CLANG)
# This one is very useful but has many false positives.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-class-memaccess")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
endif()
if(ANDROID)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++17")

View File

@ -178,6 +178,7 @@ bool TextDrawerWin32::DrawStringBitmap(std::vector<uint8_t> &bitmapData, TextStr
if (size.cx == 0 || size.cy == 0) {
// Don't draw zero-sized textures.
WARN_LOG(Log::G3D, "Text '%.*s' caused a zero size image", (int)str.length(), str.data());
return false;
}

View File

@ -43,7 +43,7 @@ void WebSocketBroadcastConfigGet(DebuggerRequest & req) {
json.pushDict("disallowed");
for (const auto[name, status] : disallowed_config) {
for (const auto &[name, status] : disallowed_config) {
if (status)
json.writeBool(name, true);
}
@ -97,7 +97,7 @@ void WebSocketBroadcastConfigSet(DebuggerRequest & req) {
json.pushDict("disallowed");
for (const auto[name, status] : disallowed_config) {
for (const auto &[name, status] : disallowed_config) {
if (status)
json.writeBool(name, true);
}