From f600c2a80b814c8c74f93d89cc6ccd31649dfa86 Mon Sep 17 00:00:00 2001 From: orbitcowboy Date: Sun, 17 Mar 2024 08:11:33 +0100 Subject: [PATCH] wxwidget.cfg: Improved support for wxSize, wxPoint, wxRealPont and wxRect --- cfg/wxwidgets.cfg | 10 ++++++ test/cfg/wxwidgets.cpp | 71 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) diff --git a/cfg/wxwidgets.cfg b/cfg/wxwidgets.cfg index 2f0cf5a1528..0395513a942 100644 --- a/cfg/wxwidgets.cfg +++ b/cfg/wxwidgets.cfg @@ -1,5 +1,15 @@ + + + wxRect + wxSize + wxPoint + wxRealPoint + + + + diff --git a/test/cfg/wxwidgets.cpp b/test/cfg/wxwidgets.cpp index bbe799815b0..68404456707 100644 --- a/test/cfg/wxwidgets.cpp +++ b/test/cfg/wxwidgets.cpp @@ -27,8 +27,79 @@ #include #include #include +#include #include +void unreadVariable_wxSize(const wxSize &s) +{ + // cppcheck-suppress unreadVariable + wxSize a; + // cppcheck-suppress unreadVariable + wxSize b{}; + // cppcheck-suppress unreadVariable + wxSize c{4, 2}; + // cppcheck-suppress unreadVariable + wxSize d(4, 2); + // cppcheck-suppress unreadVariable + wxSize e(s); +} + +void unreadVariable_wxPoint(const wxRealPoint &rp, const int x, const int y) +{ + // cppcheck-suppress unreadVariable + wxPoint a; + // cppcheck-suppress unreadVariable + wxPoint b{}; + // cppcheck-suppress unreadVariable + wxPoint c{4, 2}; + // cppcheck-suppress unreadVariable + wxPoint d(4, 2); + // cppcheck-suppress unreadVariable + wxPoint e{x, 2}; + // cppcheck-suppress unreadVariable + wxPoint f(4, y); + // cppcheck-suppress unreadVariable + wxPoint g(rp); +} + +void unreadVariable_wxRealPoint(const wxPoint &pt, const double x, const double y) +{ + // cppcheck-suppress unreadVariable + wxRealPoint a; + // cppcheck-suppress unreadVariable + wxRealPoint b{}; + // cppcheck-suppress unreadVariable + wxRealPoint c{4.0, 2.0}; + // cppcheck-suppress unreadVariable + wxRealPoint d(4.0, 2.0); + // cppcheck-suppress unreadVariable + wxRealPoint e{x, 2.0}; + // cppcheck-suppress unreadVariable + wxRealPoint f(4.0, y); + // cppcheck-suppress unreadVariable + wxRealPoint g(pt); +} + +void unreadVariable_wxRect(const int x, const wxPoint &pt, const wxSize &sz) +{ + // cppcheck-suppress unreadVariable + wxRect a; + // cppcheck-suppress unreadVariable + wxRect b{}; + // cppcheck-suppress unreadVariable + wxRect c{x,x,x,x}; + // cppcheck-suppress unreadVariable + wxRect d{pt,sz}; + // cppcheck-suppress unreadVariable + wxRect e{sz}; + // cppcheck-suppress unreadVariable + wxRect f(x,x,x,x); + // cppcheck-suppress unreadVariable + wxRect g(pt,sz); + // cppcheck-suppress unreadVariable + wxRect h(sz); +} + void uninitvar_wxRegEx_GetMatch(const wxRegEx &obj, size_t *start, size_t *len, size_t index) { size_t s,l;