Linux: fixing compile warnings

This commit is contained in:
Darragh Coy 2023-06-10 02:32:52 -07:00
parent acefdbcbb3
commit 4cb5d2498b
3 changed files with 9 additions and 6 deletions

View File

@ -576,7 +576,10 @@ add_psydoom_common_target_compile_options(${GAME_TGT_NAME})
# Clang or GCC specific
if (COMPILER_CLANG OR COMPILER_GCC)
# Warnings
target_compile_options(${GAME_TGT_NAME} PUBLIC -Wno-format-security) # Disable: format string is not a string literal (potentially insecure)
target_compile_options(${GAME_TGT_NAME} PUBLIC
-Wno-format-security # Disable: format string is not a string literal (potentially insecure)
-Wno-stringop-truncation # Disable: output may be truncated copying... (and other similar warnings)
)
endif()
# Setup target compile options

View File

@ -643,8 +643,8 @@ static void draw(Core& core, const DrawTriangle& triangle) noexcept {
continue;
// Compute the texture coordinate to use and nudge slightly if it's close to the next integer coord (to account for float inprecision and prevent 'fuzzyness')
const uint16_t u = (uint16_t)(u1 * w1 + u2 * w2 + u3 * w3 + 1.0f / 8192.0f);
const uint16_t v = (uint16_t)(v1 * w1 + v2 * w2 + v3 * w3 - 1.0f / 8192.0f);
[[maybe_unused]] const uint16_t u = (uint16_t)(u1 * w1 + u2 * w2 + u3 * w3 + 1.0f / 8192.0f);
[[maybe_unused]] const uint16_t v = (uint16_t)(v1 * w1 + v2 * w2 + v3 * w3 - 1.0f / 8192.0f);
// Get the foreground color for the triangle pixel if the triangle is textured.
// If the pixel is transparent and masking is enabled then also skip it, otherwise modulate it by the primitive color...
@ -820,8 +820,8 @@ static void draw(Core& core, const DrawTriangleGouraud& triangle) noexcept {
continue;
// Compute the texture coordinate to use and nudge slightly if it's close to the next integer coord (to account for float inprecision and prevent 'fuzzyness')
const uint16_t u = (uint16_t)(u1 * w1 + u2 * w2 + u3 * w3 + 1.0f / 8192.0f);
const uint16_t v = (uint16_t)(v1 * w1 + v2 * w2 + v3 * w3 - 1.0f / 8192.0f);
[[maybe_unused]] const uint16_t u = (uint16_t)(u1 * w1 + u2 * w2 + u3 * w3 + 1.0f / 8192.0f);
[[maybe_unused]] const uint16_t v = (uint16_t)(v1 * w1 + v2 * w2 + v3 * w3 - 1.0f / 8192.0f);
// Compute the triangle gouraud color at this pixel using the weights
const uint8_t gColorR = (uint8_t) std::clamp(color1R * w1 + color2R * w2 + color3R * w3 + 0.5f, 0.0f, 255.0f);

View File

@ -241,7 +241,7 @@ IMPL_GET_LIST_FOR_RESOURCE_TYPE(DescriptorPool, mDescriptorPools)
IMPL_GET_LIST_FOR_RESOURCE_TYPE(DescriptorSet, mDescriptorSets)
IMPL_GET_LIST_FOR_RESOURCE_TYPE(DescriptorSetLayout, mDescriptorSetLayouts)
IMPL_GET_LIST_FOR_RESOURCE_TYPE(PipelineLayout, mPipelineLayouts)
IMPL_GET_LIST_FOR_RESOURCE_TYPE(Pipeline, mPipelines);
IMPL_GET_LIST_FOR_RESOURCE_TYPE(Pipeline, mPipelines)
IMPL_GET_LIST_FOR_RESOURCE_TYPE(MutableTexture, mMutableTextures)
IMPL_GET_LIST_FOR_RESOURCE_TYPE(RawBuffer, mRawBuffers)
IMPL_GET_LIST_FOR_RESOURCE_TYPE(RenderTexture, mRenderTextures)