remove some warnings on Clang (#1154)

This commit is contained in:
Dennis Brakhane
2025-07-09 07:44:18 +02:00
committed by GitHub
parent 282b81c3d9
commit 573b60418e
6 changed files with 30 additions and 17 deletions
+10 -10
View File
@@ -198,16 +198,16 @@ void MaterialWindow::Create(EditorComponent* _editor)
shaderTypeComboBox.SetSize(XMFLOAT2(wid, hei));
shaderTypeComboBox.OnSelect(forEachSelected([this] (auto material, auto args) {
if (args.iValue >= MaterialComponent::SHADERTYPE_COUNT)
{
material->SetCustomShaderID(args.iValue - MaterialComponent::SHADERTYPE_COUNT);
blendModeComboBox.SetEnabled(false);
}
else
{
material->shaderType = (MaterialComponent::SHADERTYPE)args.userdata;
material->SetCustomShaderID(-1);
blendModeComboBox.SetEnabled(true);
}
{
material->SetCustomShaderID(args.iValue - MaterialComponent::SHADERTYPE_COUNT);
blendModeComboBox.SetEnabled(false);
}
else
{
material->shaderType = (MaterialComponent::SHADERTYPE)args.userdata;
material->SetCustomShaderID(-1);
blendModeComboBox.SetEnabled(true);
}
}));
shaderTypeComboBox.SetEnabled(false);
shaderTypeComboBox.SetMaxVisibleItemCount(5);
+3
View File
@@ -125,6 +125,9 @@ else ()
#-Werror
#uncomment this to stop the compilation at the first error
# -Wfatal-errors
# turn off some warnings we don't want
-Wno-nullability-completeness # _Nonnull etc. are only supported on Clang
)
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
# add some warnings and set them as errors
+8 -2
View File
@@ -12,9 +12,15 @@ if (UNIX)
target_compile_definitions(LUA PUBLIC LUA_USE_POSIX=1)
endif()
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(LUA PRIVATE
-Wno-string-plus-int
)
endif()
set_target_properties(LUA PROPERTIES
FOLDER "ThirdParty"
POSITION_INDEPENDENT_CODE ${WICKED_PIC}
FOLDER "ThirdParty"
POSITION_INDEPENDENT_CODE ${WICKED_PIC}
)
install(FILES ${LUA_HEADERS}
+3 -3
View File
@@ -328,11 +328,11 @@ namespace wi::input
case Controller::SDLINPUT:
connected = wi::input::sdlinput::GetControllerState(&controller.state, controller.deviceIndex);
break;
#ifdef PLATFORM_PS5
case Controller::PS5:
#ifdef PLATFORM_PS5
connected = wi::input::ps5::GetControllerState(&controller.state, controller.deviceIndex);
break;
#endif // PLATFORM_PS5
break;
case Controller::DISCONNECTED:
connected = false;
break;
@@ -1129,7 +1129,7 @@ namespace wi::input
if (strcmp(str, "Numpad 9") == 0)
return KEYBOARD_BUTTON_NUMPAD9;
if (str[0] >= DIGIT_RANGE_START && str[0] < GAMEPAD_RANGE_START)
if (str[0] >= DIGIT_RANGE_START /*&& str[0] < GAMEPAD_RANGE_START*/)
{
return (BUTTON)str[0];
}
+4
View File
@@ -1929,6 +1929,10 @@ namespace wi::physics
return;
}
break;
// make Clang happy
case wi::scene::RigidBodyPhysicsComponent::ENUM_FORCE_UINT32:
JPH_ASSERT(false);
}
if (!shape_result.IsValid())
+2 -2
View File
@@ -192,7 +192,7 @@ namespace wi::video
int size = 0;
int index = 0;
const void* data = nullptr;
while (data = MP4D_read_sps(&mp4, ntrack, index, &size))
while ((data = MP4D_read_sps(&mp4, ntrack, index, &size)))
{
const uint8_t* sps_data = (const uint8_t*)data;
#ifdef DEBUG_DUMP_H264
@@ -236,7 +236,7 @@ namespace wi::video
int size = 0;
int index = 0;
const void* data = nullptr;
while (data = MP4D_read_pps(&mp4, ntrack, index, &size))
while ((data = MP4D_read_pps(&mp4, ntrack, index, &size)))
{
const uint8_t* pps_data = (const uint8_t*)data;
#ifdef DEBUG_DUMP_H264