From ae79dd6e08a51e54475195a194252b181cbd0c67 Mon Sep 17 00:00:00 2001 From: mikee47 Date: Sat, 29 Jun 2024 22:41:25 +0100 Subject: [PATCH] Fix misc. compiler warnings (not errors) --- samples/Advanced_Animation/app/application.cpp | 2 +- samples/Graphic_Editor/app/application.cpp | 4 ++-- src/Colors.cpp | 2 ++ src/RenderQueue.cpp | 1 + src/include/Graphics/Blend.h | 2 +- src/include/Graphics/Drawing/Renderer.h | 2 +- src/include/Graphics/Renderer.h | 4 ++-- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/samples/Advanced_Animation/app/application.cpp b/samples/Advanced_Animation/app/application.cpp index 9972db31..d24b35e9 100644 --- a/samples/Advanced_Animation/app/application.cpp +++ b/samples/Advanced_Animation/app/application.cpp @@ -192,7 +192,7 @@ void renderFrame() frame.state = Frame::State::rendering; frame.drawTimer.start(); - frame.surface->present([](void* param) { + frame.surface->present([](void*) { auto& frame = frames[frameIndex]; frameIndex = 1 - frameIndex; frameTime.update(frame.drawTimer.elapsedTime()); diff --git a/samples/Graphic_Editor/app/application.cpp b/samples/Graphic_Editor/app/application.cpp index 99ff812e..dc90ec20 100644 --- a/samples/Graphic_Editor/app/application.cpp +++ b/samples/Graphic_Editor/app/application.cpp @@ -495,7 +495,7 @@ void processLine(TcpClient& client, String& line) auto buffer = resourceMap.reset(props.size); String line; line += "@:"; - if (sizeof(uintptr_t) == 8) { + if(sizeof(uintptr_t) == 8) { line += "ptr64=;"; } line += "addr=0x"; @@ -566,7 +566,7 @@ bool processClientData(TcpClient& client, char* data, int size) return true; } -void gotIP(IpAddress ip, IpAddress netmask, IpAddress gateway) +void gotIP(IpAddress, IpAddress, IpAddress) { server.setClientReceiveHandler(processClientData); server.listen(23); diff --git a/src/Colors.cpp b/src/Colors.cpp index 402932c0..bf5368b1 100644 --- a/src/Colors.cpp +++ b/src/Colors.cpp @@ -124,8 +124,10 @@ PixelBuffer unpack(PixelBuffer src, PixelFormat format) } case PixelFormat::RGB24: std::swap(src.bgra32.r, src.bgra32.b); + [[fallthrough]]; case PixelFormat::BGR24: src.bgra32.a = 255; + [[fallthrough]]; default: return src; } diff --git a/src/RenderQueue.cpp b/src/RenderQueue.cpp index 82296231..1281375e 100644 --- a/src/RenderQueue.cpp +++ b/src/RenderQueue.cpp @@ -81,6 +81,7 @@ void RenderQueue::run() void RenderQueue::renderDone(const Object* object) { + assert(object == &item->object); if(!item->callback) { item.reset(); return; diff --git a/src/include/Graphics/Blend.h b/src/include/Graphics/Blend.h index 96882076..5decd923 100644 --- a/src/include/Graphics/Blend.h +++ b/src/include/Graphics/Blend.h @@ -128,7 +128,7 @@ class BlendTransparent : public BlendTemplateobject.reset(); } diff --git a/src/include/Graphics/Renderer.h b/src/include/Graphics/Renderer.h index 1a4ef7cd..318f3eda 100644 --- a/src/include/Graphics/Renderer.h +++ b/src/include/Graphics/Renderer.h @@ -173,7 +173,7 @@ class SceneRenderer : public MultiRenderer } protected: - void renderDone(const Object* object) override + void renderDone(const Object*) override { } @@ -824,7 +824,7 @@ class CopyRenderer : public Renderer void startRead(Surface& surface); /* Position is given in `location` */ - virtual void readComplete(uint8_t* data, size_t length) + virtual void readComplete([[maybe_unused]] uint8_t* data, [[maybe_unused]] size_t length) { }