changeset 576:4c9949987d5f annotations

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 02 Sep 2026 17:26:14 +0200
parents 86082b569b99
children aef928e35e9d
files ViewerPlugin/Annotations/AnnotationsRestApi.cpp ViewerPlugin/Annotations/AnnotationsWorkspace.cpp ViewerPlugin/Annotations/AnnotationsWorkspace.h ViewerPlugin/Annotations/CachedAnnotationsWorkspace.h ViewerPlugin/Annotations/IAuthenticatedUser.cpp ViewerPlugin/Annotations/ImportedLayer.h ViewerPlugin/Annotations/LayersCollection.cpp ViewerPlugin/Annotations/LayersCollection.h ViewerPlugin/Annotations/ProjectInformation.h ViewerPlugin/Annotations/UserAnnotationsSettings.h ViewerPlugin/Annotations/UserFeatures.h ViewerPlugin/Annotations/UserLayer.h
diffstat 12 files changed, 14 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/ViewerPlugin/Annotations/AnnotationsRestApi.cpp	Wed Sep 02 16:38:56 2026 +0200
+++ b/ViewerPlugin/Annotations/AnnotationsRestApi.cpp	Wed Sep 02 17:26:14 2026 +0200
@@ -51,7 +51,7 @@
     IAuthenticatedUser::ProjectRole              role_;
 
   public:
-    AnnotationsCommandContext(const OrthancPluginHttpRequest* request)
+    explicit AnnotationsCommandContext(const OrthancPluginHttpRequest* request)
     {
       if (request->method != OrthancPluginHttpMethod_Post)
       {
--- a/ViewerPlugin/Annotations/AnnotationsWorkspace.cpp	Wed Sep 02 16:38:56 2026 +0200
+++ b/ViewerPlugin/Annotations/AnnotationsWorkspace.cpp	Wed Sep 02 17:26:14 2026 +0200
@@ -47,7 +47,7 @@
     }
 
 
-    PersistentInfo(const Json::Value& serialized)
+    explicit PersistentInfo(const Json::Value& serialized)
     {
       const Json::Value& users = serialized[KEY_ACTIVE_USERS];
 
@@ -353,7 +353,7 @@
     const std::string layerId = userSettings_->CreateUserLayer();
     Commit();
 
-    UserLayer& layer = userSettings_->GetUserLayer(layerId);
+    const UserLayer& layer = userSettings_->GetUserLayer(layerId);
     layer.Serialize(answer);
   }
 
@@ -390,7 +390,7 @@
     assert(found->second != NULL);
     const UserAnnotationsSettings& authorData = *found->second;
 
-    UserLayer& layer = authorData.GetUserLayer(layerId);
+    const UserLayer& layer = authorData.GetUserLayer(layerId);
     if (!layer.IsSharedWith(userId_))
     {
       throw Orthanc::OrthancException(Orthanc::ErrorCode_ForbiddenAccess);
--- a/ViewerPlugin/Annotations/AnnotationsWorkspace.h	Wed Sep 02 16:38:56 2026 +0200
+++ b/ViewerPlugin/Annotations/AnnotationsWorkspace.h	Wed Sep 02 17:26:14 2026 +0200
@@ -49,7 +49,7 @@
     ProjectInformation               projectInformation_;
 
   public:
-    AnnotationsWorkspace(const AnnotationsWorkspaceId& id);
+    explicit AnnotationsWorkspace(const AnnotationsWorkspaceId& id);
 
     ~AnnotationsWorkspace();
 
--- a/ViewerPlugin/Annotations/CachedAnnotationsWorkspace.h	Wed Sep 02 16:38:56 2026 +0200
+++ b/ViewerPlugin/Annotations/CachedAnnotationsWorkspace.h	Wed Sep 02 17:26:14 2026 +0200
@@ -36,7 +36,7 @@
     boost::shared_ptr<Orthanc::IDynamicObject>  cached_;
 
   public:
-    CachedAnnotationsWorkspace(const AnnotationsWorkspaceId& id);
+    explicit CachedAnnotationsWorkspace(const AnnotationsWorkspaceId& id);
 
     AnnotationsWorkspace& GetContent() const
     {
--- a/ViewerPlugin/Annotations/IAuthenticatedUser.cpp	Wed Sep 02 16:38:56 2026 +0200
+++ b/ViewerPlugin/Annotations/IAuthenticatedUser.cpp	Wed Sep 02 17:26:14 2026 +0200
@@ -187,7 +187,7 @@
     std::string  username_;
 
   public:
-    GenericInstructor(const std::string& username) :
+    explicit GenericInstructor(const std::string& username) :
       username_(username)
     {
     }
--- a/ViewerPlugin/Annotations/ImportedLayer.h	Wed Sep 02 16:38:56 2026 +0200
+++ b/ViewerPlugin/Annotations/ImportedLayer.h	Wed Sep 02 17:26:14 2026 +0200
@@ -47,7 +47,7 @@
     ImportedLayer(const UserId& author,
                   const UserLayer& layer);
 
-    ImportedLayer(const Json::Value& serialized);
+    explicit ImportedLayer(const Json::Value& serialized);
 
     void Assign(const ImportedLayer& other);
 
--- a/ViewerPlugin/Annotations/LayersCollection.cpp	Wed Sep 02 16:38:56 2026 +0200
+++ b/ViewerPlugin/Annotations/LayersCollection.cpp	Wed Sep 02 17:26:14 2026 +0200
@@ -164,7 +164,7 @@
     }
     else
     {
-      it_++;
+      ++it_;
     }
   }
 }
--- a/ViewerPlugin/Annotations/LayersCollection.h	Wed Sep 02 16:38:56 2026 +0200
+++ b/ViewerPlugin/Annotations/LayersCollection.h	Wed Sep 02 17:26:14 2026 +0200
@@ -64,7 +64,7 @@
       Content::const_iterator  end_;
 
     public:
-      Iterator(const LayersCollection& that);
+      explicit Iterator(const LayersCollection& that);
 
       bool IsDone() const;
 
--- a/ViewerPlugin/Annotations/ProjectInformation.h	Wed Sep 02 16:38:56 2026 +0200
+++ b/ViewerPlugin/Annotations/ProjectInformation.h	Wed Sep 02 17:26:14 2026 +0200
@@ -45,7 +45,7 @@
     void Refresh();
 
   public:
-    ProjectInformation(const std::string& projectId);
+    explicit ProjectInformation(const std::string& projectId);
 
     std::string GetName();
 
--- a/ViewerPlugin/Annotations/UserAnnotationsSettings.h	Wed Sep 02 16:38:56 2026 +0200
+++ b/ViewerPlugin/Annotations/UserAnnotationsSettings.h	Wed Sep 02 17:26:14 2026 +0200
@@ -41,7 +41,7 @@
     {
     }
 
-    UserAnnotationsSettings(const Json::Value& serialized);
+    explicit UserAnnotationsSettings(const Json::Value& serialized);
 
     std::string AddUserLayer(UserLayer* layer);
 
--- a/ViewerPlugin/Annotations/UserFeatures.h	Wed Sep 02 16:38:56 2026 +0200
+++ b/ViewerPlugin/Annotations/UserFeatures.h	Wed Sep 02 17:26:14 2026 +0200
@@ -44,7 +44,7 @@
     void Save() const;
 
   public:
-    UserFeatures(const std::string& key);
+    explicit UserFeatures(const std::string& key);
 
     void GetContent(Json::Value& target);
 
--- a/ViewerPlugin/Annotations/UserLayer.h	Wed Sep 02 16:38:56 2026 +0200
+++ b/ViewerPlugin/Annotations/UserLayer.h	Wed Sep 02 17:26:14 2026 +0200
@@ -48,7 +48,7 @@
     UserLayer(const BackgroundColor& color,
               const std::string& name);
 
-    UserLayer(const Json::Value& serialized);
+    explicit UserLayer(const Json::Value& serialized);
 
     virtual std::string GetId() const ORTHANC_OVERRIDE
     {