Skip to content

Commit

Permalink
suppress
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Jul 20, 2023
1 parent 8b89852 commit 0843ce9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 20 deletions.
3 changes: 2 additions & 1 deletion cfg/qt.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -444,11 +444,12 @@
<!-- QAction *QMenu::addAction(const QIcon &icon, const QString &text, const QObject *receiver, PointerToMemberFunction method, const QKeySequence &shortcut = ...) -->
<!-- QAction *QMenu::addAction(const QIcon &icon, const QString &text, Functor functor, const QKeySequence &shortcut = ...) -->
<!-- QAction *QMenu::addAction(const QIcon &icon, const QString &text, const QObject *context, Functor functor, const QKeySequence &shortcut = 0) -->
<!-- void QWidget::addAction(QAction *action) -->
<function name="QMenu::addAction">
<noreturn>false</noreturn>
<returnValue type="QAction *"/>
<leak-ignore/>
<arg nr="1" direction="in">
<arg nr="1"">
<not-uninit/>
<not-bool/>
</arg>
Expand Down
12 changes: 6 additions & 6 deletions gui/resultstree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -662,8 +662,8 @@ void ResultsTree::contextMenuEvent(QContextMenuEvent * e)

//Create an action for the application
QAction *recheckSelectedFiles = new QAction(tr("Recheck"), &menu);
const QAction *copy = new QAction(tr("Copy"), &menu);
const QAction *hide = new QAction(tr("Hide"), &menu);
QAction *copy = new QAction(tr("Copy"), &menu);
QAction *hide = new QAction(tr("Hide"), &menu);
QAction *hideallid = new QAction(tr("Hide all with id"), &menu);
QAction *opencontainingfolder = new QAction(tr("Open containing folder"), &menu);

Expand All @@ -683,7 +683,7 @@ void ResultsTree::contextMenuEvent(QContextMenuEvent * e)
menu.addAction(hide);
menu.addAction(hideallid);

const QAction *suppress = new QAction(tr("Suppress selected id(s)"), &menu);
QAction *suppress = new QAction(tr("Suppress selected id(s)"), &menu);
menu.addAction(suppress);
connect(suppress, &QAction::triggered, this, &ResultsTree::suppressSelectedIds);

Expand All @@ -701,15 +701,15 @@ void ResultsTree::contextMenuEvent(QContextMenuEvent * e)
menu.addSeparator();
QMenu *tagMenu = menu.addMenu(tr("Tag"));
{
const QAction *action = new QAction(tr("No tag"), tagMenu);
QAction *action = new QAction(tr("No tag"), tagMenu);
tagMenu->addAction(action);
connect(action, &QAction::triggered, [=]() {
tagSelectedItems(QString());
});
}

for (const QString& tagstr : currentProject->getTags()) {
const QAction *action = new QAction(tagstr, tagMenu);
QAction *action = new QAction(tagstr, tagMenu);
tagMenu->addAction(action);
connect(action, &QAction::triggered, [=]() {
tagSelectedItems(tagstr);
Expand All @@ -725,7 +725,7 @@ void ResultsTree::contextMenuEvent(QContextMenuEvent * e)
mContextItem = mModel.itemFromIndex(index);
if (mContextItem && mApplications->getApplicationCount() > 0 && mContextItem->parent()) {
//Disconnect all signals
for (const QAction* action : actions) {
for (QAction* action : actions) {
disconnect(action, SIGNAL(triggered()), signalMapper, SLOT(map()));
}

Expand Down
39 changes: 26 additions & 13 deletions test/cfg/std.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,8 @@ void nullpointerMemchr2(char *p, const char *s)

void nullPointer_memchr(char *p)
{
const char *s = 0;
// cppcheck-suppress constVariablePointer
char *s = 0;
// cppcheck-suppress nullPointer
p = memchr(s, 0, strlen(s));
(void)p;
Expand Down Expand Up @@ -4450,7 +4451,8 @@ void uninitvar_sscanf(char *s, const char *f, int i, int *ip)
void uninitvar_fwscanf(void)
{
FILE* stream;
const wchar_t* format1, *format2;
// cppcheck-suppress constVariablePointer
wchar_t* format1, *format2;
int i;
// cppcheck-suppress uninitvar
(void)fwscanf(stream,format1);
Expand All @@ -4460,8 +4462,10 @@ void uninitvar_fwscanf(void)

void uninitvar_swscanf(void)
{
const wchar_t* s;
const wchar_t* format1, *format2;
// cppcheck-suppress constVariablePointer
wchar_t* s;
// cppcheck-suppress constVariablePointer
wchar_t* format1, *format2;
int i;
// cppcheck-suppress uninitvar
(void)swscanf(s,format1);
Expand All @@ -4476,7 +4480,8 @@ void uninitvar_system(void)
(void)system(c);
}

void nullPointer_system(const char *c)
// cppcheck-suppress constParameterPointer
void nullPointer_system(char *c)
{
// If a null pointer is given, command processor is checked for existence
(void)system(NULL);
Expand All @@ -4496,7 +4501,8 @@ int nullPointer_mtx_timedlock( mtx_t *restrict mutex, const struct timespec *res

void uninitvar_zonetime(void)
{
const time_t *tp;
// cppcheck-suppress constVariablePointer
time_t *tp;
int zone;
// cppcheck-suppress uninitvar
(void)zonetime(tp,zone);
Expand Down Expand Up @@ -4524,7 +4530,8 @@ void uninitvar_c16rtomb(void)
void uninitvar_mbrtoc16(void)
{
char16_t * pc16;
const char * pmb;
// cppcheck-suppress constVariablePointer
char * pmb;
size_t max;
mbstate_t * ps;
// cppcheck-suppress uninitvar
Expand All @@ -4545,7 +4552,8 @@ void uninitvar_c32rtomb(void)
void uninitvar_mbrtoc32(void)
{
char32_t * pc32;
const char * pmb;
// cppcheck-suppress constVariablePointer
char * pmb;
size_t max;
mbstate_t * ps;
// cppcheck-suppress uninitvar
Expand Down Expand Up @@ -4847,7 +4855,8 @@ void ignoredReturnValue_abs(int i)

void nullPointer_asctime(void)
{
const struct tm *tm = 0;
// cppcheck-suppress constVariablePointer
struct tm *tm = 0;
// cppcheck-suppress asctimeCalled
// cppcheck-suppress nullPointer
(void)asctime(tm);
Expand All @@ -4858,7 +4867,8 @@ void nullPointer_asctime(void)

void nullPointer_asctime_s(void)
{
const struct tm *tm = 0;
// cppcheck-suppress constVariablePointer
struct tm *tm = 0;
char * buf = NULL;
// cppcheck-suppress asctime_sCalled
// cppcheck-suppress nullPointer
Expand Down Expand Up @@ -4913,7 +4923,8 @@ void nullPointer_fesetexceptflag(int excepts)
(void)fesetexceptflag(0,excepts);
}

void invalidFunctionArg_fesetexceptflag(const fexcept_t* flagp, int excepts)
// cppcheck-suppress constParameterPointer
void invalidFunctionArg_fesetexceptflag(fexcept_t* flagp, int excepts)
{
(void)fesetexceptflag(flagp, excepts);
// cppcheck-suppress invalidFunctionArg
Expand Down Expand Up @@ -4945,7 +4956,8 @@ void invalidFunctionArg_fetestexcept(int excepts)

void nullPointer_feupdateenv(void)
{
const fenv_t* envp = 0;
// cppcheck-suppress constVariablePointer
fenv_t* envp = 0;
// cppcheck-suppress nullPointer
(void)feupdateenv(envp);
// cppcheck-suppress nullPointer
Expand All @@ -4960,7 +4972,8 @@ void nullPointer_atexit(void)

void nullPointer_atof(void)
{
const char * c = 0;
// cppcheck-suppress constVariablePointer
char * c = 0;
// cppcheck-suppress nullPointer
(void)atof(c);
// cppcheck-suppress nullPointer
Expand Down

0 comments on commit 0843ce9

Please sign in to comment.