diff --git a/include/Nazara/Core/Algorithm.inl b/include/Nazara/Core/Algorithm.inl index d3081931e..fc9756384 100644 --- a/include/Nazara/Core/Algorithm.inl +++ b/include/Nazara/Core/Algorithm.inl @@ -264,7 +264,7 @@ namespace Nz { UInt32 crc = 0xFFFFFFFFu; - for (std::size_t i = 0u; auto c = str[i]; ++i) + for (std::size_t i = 0u; str[i]; ++i) crc = Detail::crc32Table[(crc ^ str[i]) & 0xFF] ^ (crc >> 8); return ~crc; diff --git a/include/Nazara/VulkanRenderer/Wrapper/QueueHandle.inl b/include/Nazara/VulkanRenderer/Wrapper/QueueHandle.inl index b00005578..7cd9eb002 100644 --- a/include/Nazara/VulkanRenderer/Wrapper/QueueHandle.inl +++ b/include/Nazara/VulkanRenderer/Wrapper/QueueHandle.inl @@ -44,13 +44,7 @@ namespace Nz inline bool QueueHandle::Present(const VkPresentInfoKHR& presentInfo) const { m_lastErrorCode = m_device->vkQueuePresentKHR(m_handle, &presentInfo); - if (m_lastErrorCode != VkResult::VK_SUCCESS) - { - NazaraError("Failed to present queue: " + TranslateVulkanError(m_lastErrorCode)); - return false; - } - - return true; + return (m_lastErrorCode != VkResult::VK_SUCCESS); } inline bool QueueHandle::Present(VkSwapchainKHR swapchain, UInt32 imageIndex, VkSemaphore waitSemaphore) const diff --git a/src/Nazara/Audio/Formats/libvorbisLoader.cpp b/src/Nazara/Audio/Formats/libvorbisLoader.cpp index cbe8aaad7..05a8edb28 100644 --- a/src/Nazara/Audio/Formats/libvorbisLoader.cpp +++ b/src/Nazara/Audio/Formats/libvorbisLoader.cpp @@ -106,7 +106,7 @@ namespace Nz return 0; } - assert(readBytes > 0 && readBytes <= remainingBytes); + assert(readBytes > 0 && UInt64(readBytes) <= remainingBytes); ptr += readBytes; remainingBytes -= readBytes; diff --git a/src/Nazara/Core/Hash/CRC32.cpp b/src/Nazara/Core/Hash/CRC32.cpp index 6aacab507..ab6ae3ef1 100644 --- a/src/Nazara/Core/Hash/CRC32.cpp +++ b/src/Nazara/Core/Hash/CRC32.cpp @@ -75,7 +75,7 @@ namespace Nz { table[i] = crc32_reflect(i, 8) << 24; for (unsigned int j = 0; j < 8; ++j) - table[i] = (table[i] << 1) ^ (table[i] & ((1 << 31) ? polynomial : 0)); + table[i] = (table[i] << 1) ^ ((table[i] & (1 << 31)) ? polynomial : 0); table[i] = crc32_reflect(table[i], 32); } diff --git a/src/Nazara/Graphics/SlicedSprite.cpp b/src/Nazara/Graphics/SlicedSprite.cpp index 67a3e1d02..13207fec8 100644 --- a/src/Nazara/Graphics/SlicedSprite.cpp +++ b/src/Nazara/Graphics/SlicedSprite.cpp @@ -72,7 +72,7 @@ namespace Nz { // Material should always have textures but we're better safe than sorry if (const auto& texture = mat.GetDiffuseMap()) - return mat.GetDiffuseMap()->GetSize(); + return texture->GetSize(); } } diff --git a/src/Nazara/Graphics/Sprite.cpp b/src/Nazara/Graphics/Sprite.cpp index e1572af39..bf346049c 100644 --- a/src/Nazara/Graphics/Sprite.cpp +++ b/src/Nazara/Graphics/Sprite.cpp @@ -71,7 +71,7 @@ namespace Nz { // Material should always have textures but we're better safe than sorry if (const auto& texture = mat.GetDiffuseMap()) - return mat.GetDiffuseMap()->GetSize(); + return texture->GetSize(); } } diff --git a/src/Nazara/OpenGLRenderer/OpenGLCommandBufferBuilder.cpp b/src/Nazara/OpenGLRenderer/OpenGLCommandBufferBuilder.cpp index f1d9016a6..71a79f7ca 100644 --- a/src/Nazara/OpenGLRenderer/OpenGLCommandBufferBuilder.cpp +++ b/src/Nazara/OpenGLRenderer/OpenGLCommandBufferBuilder.cpp @@ -29,7 +29,7 @@ namespace Nz { const OpenGLBuffer& glBuffer = static_cast(indexBuffer); - m_commandBuffer.BindIndexBuffer(glBuffer.GetBuffer().GetObjectId()); + m_commandBuffer.BindIndexBuffer(glBuffer.GetBuffer().GetObjectId(), offset); } void OpenGLCommandBufferBuilder::BindPipeline(const RenderPipeline& pipeline) diff --git a/src/Nazara/Shader/Ast/SanitizeVisitor.cpp b/src/Nazara/Shader/Ast/SanitizeVisitor.cpp index aa3ff9ff4..79821e575 100644 --- a/src/Nazara/Shader/Ast/SanitizeVisitor.cpp +++ b/src/Nazara/Shader/Ast/SanitizeVisitor.cpp @@ -3257,6 +3257,7 @@ namespace Nz::ShaderAst { case PrimitiveType::Boolean: case PrimitiveType::String: + case PrimitiveType::UInt32: return false; case PrimitiveType::Float32: @@ -3280,6 +3281,8 @@ namespace Nz::ShaderAst } } } + + throw ShaderLang::AstInternalError{ node.sourceLocation, "unexpected cast from " + ShaderAst::ToString(fromPrimitiveType) + " to " + ShaderAst::ToString(targetPrimitiveType) }; }(); if (!areTypeCompatibles) diff --git a/src/Nazara/Widgets/WidgetTheme.cpp b/src/Nazara/Widgets/WidgetTheme.cpp index c8270bf34..4e52a46aa 100644 --- a/src/Nazara/Widgets/WidgetTheme.cpp +++ b/src/Nazara/Widgets/WidgetTheme.cpp @@ -56,7 +56,7 @@ namespace Nz { } - void CheckboxWidgetStyle::OnNewState(CheckboxState newState) + void CheckboxWidgetStyle::OnNewState(CheckboxState /*newState*/) { } diff --git a/src/ShaderNode/Previews/PreviewValues.cpp b/src/ShaderNode/Previews/PreviewValues.cpp index e44055333..2d3574fcb 100644 --- a/src/ShaderNode/Previews/PreviewValues.cpp +++ b/src/ShaderNode/Previews/PreviewValues.cpp @@ -30,7 +30,7 @@ QImage PreviewValues::GenerateImage() const for (std::size_t y = 0; y < 4; ++y) *ptr++ = static_cast(std::clamp((*src)[y] * 0xFF, 0.f, 255.f)); - *src++; + src++; } return preview;