# HG changeset patch # User Sebastien Jodogne # Date 1681556867 -7200 # Node ID 49477780e25a298f7715be7c5ccc3fb2d184e65c # Parent b9456dfde58ad8ab3ef2887d996104ab2666ade9 cppcheck diff -r b9456dfde58a -r 49477780e25a OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp --- a/OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Sat Apr 15 10:33:17 2023 +0200 +++ b/OrthancServer/Plugins/Samples/Common/OrthancPluginCppWrapper.cpp Sat Apr 15 13:07:47 2023 +0200 @@ -253,14 +253,15 @@ // helper class to convert std::map of headers to the plugin SDK C structure class PluginHttpHeaders { + private: std::vector headersKeys_; std::vector headersValues_; + public: - - PluginHttpHeaders(const std::map& httpHeaders) + explicit PluginHttpHeaders(const std::map& httpHeaders) { for (std::map::const_iterator - it = httpHeaders.begin(); it != httpHeaders.end(); it++) + it = httpHeaders.begin(); it != httpHeaders.end(); ++it) { headersKeys_.push_back(it->first.c_str()); headersValues_.push_back(it->second.c_str()); diff -r b9456dfde58a -r 49477780e25a OrthancServer/Plugins/Samples/DelayedDeletion/LargeDeleteJob.cpp --- a/OrthancServer/Plugins/Samples/DelayedDeletion/LargeDeleteJob.cpp Sat Apr 15 10:33:17 2023 +0200 +++ b/OrthancServer/Plugins/Samples/DelayedDeletion/LargeDeleteJob.cpp Sat Apr 15 13:07:47 2023 +0200 @@ -168,6 +168,7 @@ levels_(levels), posResources_(0), posInstances_(0), + posSeries_(0), posDelete_(0) { if (resources.size() != levels.size()) diff -r b9456dfde58a -r 49477780e25a OrthancServer/Plugins/Samples/Housekeeper/Plugin.cpp --- a/OrthancServer/Plugins/Samples/Housekeeper/Plugin.cpp Sat Apr 15 10:33:17 2023 +0200 +++ b/OrthancServer/Plugins/Samples/Housekeeper/Plugin.cpp Sat Apr 15 13:07:47 2023 +0200 @@ -127,7 +127,7 @@ Json::Value::Members names = scheduleConfiguration.getMemberNames(); for (Json::Value::Members::const_iterator it = names.begin(); - it != names.end(); it++) + it != names.end(); ++it) { for (Json::Value::ArrayIndex i = 0; i < scheduleConfiguration[*it].size(); i++) { @@ -144,7 +144,7 @@ } for (std::list::const_iterator it = runningPeriods_.begin(); - it != runningPeriods_.end(); it++) + it != runningPeriods_.end(); ++it) { if (it->isInPeriod()) { diff -r b9456dfde58a -r 49477780e25a OrthancServer/Plugins/Samples/ModalityWorklists/Plugin.cpp --- a/OrthancServer/Plugins/Samples/ModalityWorklists/Plugin.cpp Sat Apr 15 10:33:17 2023 +0200 +++ b/OrthancServer/Plugins/Samples/ModalityWorklists/Plugin.cpp Sat Apr 15 13:07:47 2023 +0200 @@ -151,11 +151,12 @@ fs::path source(folder_); fs::directory_iterator end; - unsigned int parsedFilesCount = 0; - unsigned int matchedWorklistCount = 0; try { + unsigned int parsedFilesCount = 0; + unsigned int matchedWorklistCount = 0; + for (fs::directory_iterator it(source); it != end; ++it) { fs::file_type type(it->status().type()); diff -r b9456dfde58a -r 49477780e25a OrthancServer/Plugins/Samples/MultitenantDicom/MoveRequestHandler.cpp --- a/OrthancServer/Plugins/Samples/MultitenantDicom/MoveRequestHandler.cpp Sat Apr 15 10:33:17 2023 +0200 +++ b/OrthancServer/Plugins/Samples/MultitenantDicom/MoveRequestHandler.cpp Sat Apr 15 13:07:47 2023 +0200 @@ -47,12 +47,12 @@ { } - unsigned int GetSubOperationCount() const + virtual unsigned int GetSubOperationCount() const ORTHANC_OVERRIDE { return 1; } - Status DoNext() + virtual Status DoNext() ORTHANC_OVERRIDE { Json::Value answer; @@ -95,15 +95,15 @@ if (OrthancPlugins::RestApiPost(response, "/tools/find", request, false) && response.type() == Json::arrayValue) { - for (Json::Value::ArrayIndex i = 0; i < response.size(); i++) + for (Json::Value::ArrayIndex j = 0; j < response.size(); j++) { - if (response[i].type() != Json::stringValue) + if (response[j].type() != Json::stringValue) { throw Orthanc::OrthancException(Orthanc::ErrorCode_InternalError); } else { - publicIds.insert(response[i].asString()); + publicIds.insert(response[j].asString()); } } } diff -r b9456dfde58a -r 49477780e25a OrthancServer/Plugins/Samples/MultitenantDicom/MultitenantDicomServer.h --- a/OrthancServer/Plugins/Samples/MultitenantDicom/MultitenantDicomServer.h Sat Apr 15 10:33:17 2023 +0200 +++ b/OrthancServer/Plugins/Samples/MultitenantDicom/MultitenantDicomServer.h Sat Apr 15 13:07:47 2023 +0200 @@ -61,7 +61,7 @@ std::unique_ptr server_; public: - MultitenantDicomServer(const Json::Value& serverConfig); + explicit MultitenantDicomServer(const Json::Value& serverConfig); void Start(); diff -r b9456dfde58a -r 49477780e25a OrthancServer/Resources/RunCppCheck.sh --- a/OrthancServer/Resources/RunCppCheck.sh Sat Apr 15 10:33:17 2023 +0200 +++ b/OrthancServer/Resources/RunCppCheck.sh Sat Apr 15 13:07:47 2023 +0200 @@ -88,6 +88,7 @@ -D__cplusplus=201103 \ -D__linux__ \ -UNDEBUG \ + -DHAS_ORTHANC_EXCEPTION=1 \ \ ../../OrthancFramework/Sources \ ../../OrthancFramework/UnitTestsSources \ @@ -95,5 +96,11 @@ ../../OrthancServer/Plugins/Include \ ../../OrthancServer/Sources \ ../../OrthancServer/UnitTestsSources \ + ../../OrthancServer/Plugins/Samples/Common \ + ../../OrthancServer/Plugins/Samples/ConnectivityChecks \ + ../../OrthancServer/Plugins/Samples/DelayedDeletion \ + ../../OrthancServer/Plugins/Samples/Housekeeper \ + ../../OrthancServer/Plugins/Samples/ModalityWorklists \ + ../../OrthancServer/Plugins/Samples/MultitenantDicom \ \ 2>&1