diff --git a/include/SFML/System/Utf.inl b/include/SFML/System/Utf.inl index 35cad7be4..3c7f30e88 100644 --- a/include/SFML/System/Utf.inl +++ b/include/SFML/System/Utf.inl @@ -645,7 +645,7 @@ Out Utf<32>::toUtf32(In begin, In end, Out output) //////////////////////////////////////////////////////////// template -Uint32 Utf<32>::decodeAnsi(In input, const std::locale& locale) +Uint32 Utf<32>::decodeAnsi(In input, [[maybe_unused]] const std::locale& locale) { // On Windows, GCC's standard library (glibc++) has almost // no support for Unicode stuff. As a consequence, in this @@ -656,8 +656,6 @@ Uint32 Utf<32>::decodeAnsi(In input, const std::locale& locale) (defined(__GLIBCPP__) || defined (__GLIBCXX__)) && /* ... and standard library is glibc++ ... */ \ !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) /* ... and STLPort is not used on top of it */ - (void)locale; // to avoid warnings - wchar_t character = 0; mbtowc(&character, &input, 1); return static_cast(character); @@ -690,7 +688,7 @@ Uint32 Utf<32>::decodeWide(In input) //////////////////////////////////////////////////////////// template -Out Utf<32>::encodeAnsi(Uint32 codepoint, Out output, char replacement, const std::locale& locale) +Out Utf<32>::encodeAnsi(Uint32 codepoint, Out output, char replacement, [[maybe_unused]] const std::locale& locale) { // On Windows, gcc's standard library (glibc++) has almost // no support for Unicode stuff. As a consequence, in this @@ -701,8 +699,6 @@ Out Utf<32>::encodeAnsi(Uint32 codepoint, Out output, char replacement, const st (defined(__GLIBCPP__) || defined (__GLIBCXX__)) && /* ... and standard library is glibc++ ... */ \ !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) /* ... and STLPort is not used on top of it */ - (void)locale; // to avoid warnings - char character = 0; if (wctomb(&character, static_cast(codepoint)) >= 0) *output++ = character; diff --git a/src/SFML/Graphics/VertexBuffer.cpp b/src/SFML/Graphics/VertexBuffer.cpp index b9e2beb2f..d3fef25a2 100644 --- a/src/SFML/Graphics/VertexBuffer.cpp +++ b/src/SFML/Graphics/VertexBuffer.cpp @@ -206,11 +206,10 @@ bool VertexBuffer::update(const Vertex* vertices, std::size_t vertexCount, unsig //////////////////////////////////////////////////////////// -bool VertexBuffer::update(const VertexBuffer& vertexBuffer) +bool VertexBuffer::update([[maybe_unused]] const VertexBuffer& vertexBuffer) { #ifdef SFML_OPENGL_ES - (void) vertexBuffer; return false; #else diff --git a/src/SFML/Window/EglContext.cpp b/src/SFML/Window/EglContext.cpp index 6f69b237d..5a31501b2 100644 --- a/src/SFML/Window/EglContext.cpp +++ b/src/SFML/Window/EglContext.cpp @@ -132,7 +132,7 @@ m_config (nullptr) //////////////////////////////////////////////////////////// -EglContext::EglContext(EglContext* shared, const ContextSettings& settings, const WindowImpl& owner, unsigned int bitsPerPixel) : +EglContext::EglContext(EglContext* shared, const ContextSettings& settings, [[maybe_unused]] const WindowImpl& owner, unsigned int bitsPerPixel) : m_display (EGL_NO_DISPLAY), m_context (EGL_NO_CONTEXT), m_surface (EGL_NO_SURFACE), @@ -164,8 +164,7 @@ m_config (nullptr) // Create EGL surface (except on Android because the window is created // asynchronously, its activity manager will call it for us) createSurface(owner.getSystemHandle()); -#else - (void) owner; + #endif } diff --git a/src/SFML/Window/Vulkan.cpp b/src/SFML/Window/Vulkan.cpp index 9dce81636..9bf614f6c 100644 --- a/src/SFML/Window/Vulkan.cpp +++ b/src/SFML/Window/Vulkan.cpp @@ -55,11 +55,10 @@ using VulkanImplType = sf::priv::VulkanImplWin32; namespace sf { //////////////////////////////////////////////////////////// -bool Vulkan::isAvailable(bool requireGraphics) +bool Vulkan::isAvailable([[maybe_unused]] bool requireGraphics) { #if defined(SFML_VULKAN_IMPLEMENTATION_NOT_AVAILABLE) - (void) requireGraphics; return false; #else @@ -71,11 +70,10 @@ bool Vulkan::isAvailable(bool requireGraphics) //////////////////////////////////////////////////////////// -VulkanFunctionPointer Vulkan::getFunction(const char* name) +VulkanFunctionPointer Vulkan::getFunction([[maybe_unused]] const char* name) { #if defined(SFML_VULKAN_IMPLEMENTATION_NOT_AVAILABLE) - (void) name; return nullptr; #else diff --git a/src/SFML/Window/WindowImpl.cpp b/src/SFML/Window/WindowImpl.cpp index 3e45efe11..cc2293e8a 100644 --- a/src/SFML/Window/WindowImpl.cpp +++ b/src/SFML/Window/WindowImpl.cpp @@ -295,13 +295,10 @@ void WindowImpl::processSensorEvents() //////////////////////////////////////////////////////////// -bool WindowImpl::createVulkanSurface(const VkInstance& instance, VkSurfaceKHR& surface, const VkAllocationCallbacks* allocator) +bool WindowImpl::createVulkanSurface([[maybe_unused]] const VkInstance& instance, [[maybe_unused]] VkSurfaceKHR& surface, [[maybe_unused]] const VkAllocationCallbacks* allocator) { #if defined(SFML_VULKAN_IMPLEMENTATION_NOT_AVAILABLE) - (void) instance; - (void) surface; - (void) allocator; return false; #else