Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wxwidgets.cfg: Improved support for wxSize, wxPoint, wxRealPont and wx… #6139

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions cfg/wxwidgets.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
<?xml version="1.0"?>
<def format="2">
<type-checks>
<unusedvar>
<check>wxRect</check>
<check>wxSize</check>
<check>wxPoint</check>
<check>wxRealPoint</check>
</unusedvar>
<operatorEqVarError>
</operatorEqVarError>
</type-checks>
<!-- http://docs.wxwidgets.org/trunk/group__group__funcmacro__string.html#ga437ea6ba615b75dac8603e96ec864160 -->
<!-- #define wxT(string) -->
<define name="wxT(str)" value="str"/>
Expand Down
71 changes: 71 additions & 0 deletions test/cfg/wxwidgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,79 @@
#include <wx/sizer.h>
#include <wx/string.h>
#include <wx/textctrl.h>
#include <wx/gdicmn.h>
#include <wx/propgrid/property.h>

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;
Expand Down
Loading