From e6d91bd31a2d660156c0e10c857377ed62435b24 Mon Sep 17 00:00:00 2001 From: "Jens A. Koch" Date: Fri, 16 Oct 2026 09:54:16 -0700 Subject: [PATCH 1/2] pushClipArea: drop negative-size asserts handled by isEmpty() --- src/graphics.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/graphics.cpp b/src/graphics.cpp index 00aed59f..b1f077e1 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -6,7 +6,6 @@ #include "fifechan/graphics.hpp" // Standard library includes -#include #include #include @@ -25,10 +24,9 @@ namespace fcn bool Graphics::pushClipArea(Rectangle area) { // Ignore area with a negative width or height by pushing - // an empty clip area to the stack. - assert("Width must be non-negative" && area.width >= 0); - assert("Height must be non-negative" && area.height >= 0); - + // an empty clip area to the stack. Rectangle::isEmpty() already + // reports true for width/height <= 0, so the check below handles + // those cases; asserting on them first would defeat that handling. if (area.isEmpty()) { ClipRectangle const clip_rect; mClipStack.push(clip_rect); From 6496921e897bb06b6a9d09fe7c4047ca5b92f34b Mon Sep 17 00:00:00 2001 From: "Jens A. Koch" Date: Fri, 16 Oct 2026 12:22:52 -0700 Subject: [PATCH 2/2] silence cppcheck constParameterPointer/returnByReference findings --- include/fifechan/widgets/speechbubble.hpp | 3 +++ src/widget.cpp | 1 + 2 files changed, 4 insertions(+) diff --git a/include/fifechan/widgets/speechbubble.hpp b/include/fifechan/widgets/speechbubble.hpp index 37798bfc..9f51f28e 100644 --- a/include/fifechan/widgets/speechbubble.hpp +++ b/include/fifechan/widgets/speechbubble.hpp @@ -115,6 +115,9 @@ namespace fcn TailDirection getTailDirection() const; void setTailProfile(TailProfile const & profile); + // Returning by value is deliberate: a const reference would let a + // binding alias internal state and write to it through a getter. + // cppcheck-suppress returnByReference TailProfile getTailProfile() const; void setTailColor(Color color); diff --git a/src/widget.cpp b/src/widget.cpp index 7335d6a7..de1ce2b6 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -860,6 +860,7 @@ namespace fcn return mFocusHandler; } + // cppcheck-suppress constParameterPointer void Widget::_detachFocusHandlerFromAll(FocusHandler* focusHandler) { for (auto* widget : widgetInstancesRegistry()) {