From 5aeb8407bddc80d0c57ab30b22ced823eca1d29a Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 11 Aug 2022 20:57:43 +0100 Subject: Enable all cppcheck checks and fixup --- Jamroot.jam | 38 ++++++++++++---------- .../service/maintenance/ebuildMetaProcessor.cpp | 4 +-- .../service/maintenance/updatesProcessor.cpp | 5 ++- 3 files changed, 25 insertions(+), 22 deletions(-) diff --git a/Jamroot.jam b/Jamroot.jam index 8a29f49..43ac49b 100644 --- a/Jamroot.jam +++ b/Jamroot.jam @@ -33,32 +33,36 @@ project gcc,debug:-Wlogical-op gcc,debug:-Wuseless-cast coverage:on + tidy:all tidy:ICE_IGNORE_VERSION tidy:ICE_MEMBER_IMPORT_EXPORT - tidy:users.cpp - tidy:user-models.cpp - tidy:slicer-user-models.cpp - tidy:news-models.cpp - tidy:slicer-news-models.cpp tidy:extended-models.cpp - tidy:slicer-extended-models.cpp - tidy:portage-models.cpp - tidy:slicer-portage-models.cpp - tidy:portage.cpp tidy:gb-base.cpp - tidy:maintenance.h + tidy:gentoobrowse-api/api/bin/tidy/debug/checker-cppcheck/cxxstd-20-iso/maintenance.h + tidy:gentoobrowse-api/domain/bin/slicer-yes/extended-models.h + tidy:gentoobrowse-api/domain/bin/slicer-yes/portage-models.h + tidy:gentoobrowse-api/domain/bin/slicer-yes/user-models.h + tidy:gentoobrowse-api/domain/bin/unpackPqTextArray.cpp tidy:maintenance.cpp - tidy:notifications.h + tidy:news-models.cpp tidy:notifications.cpp - tidy:notifications/xslt/base.h + tidy:notifications/css/style.cpp + tidy:notifications/css/style.h + tidy:notifications.h tidy:notifications/xslt/base.cpp - tidy:notifications/xslt/news.h + tidy:notifications/xslt/base.h tidy:notifications/xslt/news.cpp - tidy:notifications/xslt/signup.h + tidy:notifications/xslt/news.h tidy:notifications/xslt/signup.cpp - tidy:notifications/css/style.h - tidy:notifications/css/style.cpp - tidy:unpackPqTextArray.cpp + tidy:notifications/xslt/signup.h + tidy:portage.cpp + tidy:portage-models.cpp + tidy:slicer-extended-models.cpp + tidy:slicer-news-models.cpp + tidy:slicer-portage-models.cpp + tidy:slicer-user-models.cpp + tidy:user-models.cpp + tidy:users.cpp tidy:boost-* tidy:bugprone-* tidy:bugprone-implicit-widening-of-multiplication-result diff --git a/gentoobrowse-api/service/maintenance/ebuildMetaProcessor.cpp b/gentoobrowse-api/service/maintenance/ebuildMetaProcessor.cpp index 441f46f..b317bf5 100644 --- a/gentoobrowse-api/service/maintenance/ebuildMetaProcessor.cpp +++ b/gentoobrowse-api/service/maintenance/ebuildMetaProcessor.cpp @@ -73,7 +73,7 @@ namespace Gentoo::Service { const Glib::ustring pv = fn[3]; if (packageVersion->match(pv, matches)) { U::EbuildCacheParser ecp(path); - const std::string categoryName = fn[2]; + const std::string & categoryName = fn[2]; const std::string packageName = matches.fetch(1); const std::string ebuildVersion = matches.fetch(2); @@ -296,7 +296,7 @@ namespace Gentoo::Service { Glib::MatchInfo matches; const Glib::ustring pv = fn[3]; if (packageVersion->match(pv, matches)) { - const std::string categoryName = fn[2]; + const std::string & categoryName = fn[2]; const std::string packageName = matches.fetch(1); const std::string ebuildVersion = matches.fetch(2); diff --git a/gentoobrowse-api/service/maintenance/updatesProcessor.cpp b/gentoobrowse-api/service/maintenance/updatesProcessor.cpp index b6bcee2..3295f54 100644 --- a/gentoobrowse-api/service/maintenance/updatesProcessor.cpp +++ b/gentoobrowse-api/service/maintenance/updatesProcessor.cpp @@ -58,8 +58,7 @@ namespace Gentoo::Service { categoryInsert(sql::maintenance::categoryInsert.modify(db)), packageInsert(sql::maintenance::packageInsert.modify(db)), findPackage(sql::portage::findPackage.select(db)), - updatesMoveUserPackages(sql::maintenance::updatesMoveUserPackages.modify(db)), changes(nullptr), - updatePacks("updatePack") + updatesMoveUserPackages(sql::maintenance::updatesMoveUserPackages.modify(db)), updatePacks("updatePack") { this->src = Utils::Database::emptyClone(db, "gentoobrowse.updates"); this->dest = "gentoobrowse.updates"; @@ -92,7 +91,7 @@ namespace Gentoo::Service { DB::ModifyCommandPtr packageInsert; DB::SelectCommandPtr findPackage; DB::ModifyCommandPtr updatesMoveUserPackages; - ChangeSet * changes; + ChangeSet * changes {}; Utils::EntityWhereFilter updatePacks; void -- cgit v1.2.3