changeset 321:eb0b04c10bc4

cppcheck
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 20 Jul 2021 08:32:28 +0200
parents 1ff0751efd67
children 7e9622c64c40
files Framework/Plugins/IndexUnitTests.h MySQL/Plugins/MySQLIndex.cpp
diffstat 2 files changed, 21 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/Framework/Plugins/IndexUnitTests.h	Tue Jul 20 08:16:17 2021 +0200
+++ b/Framework/Plugins/IndexUnitTests.h	Tue Jul 20 08:32:28 2021 +0200
@@ -612,15 +612,15 @@
       resources.push_back(db.CreateResource(*manager, "series", OrthancPluginResourceType_Series));
       resources.push_back(db.CreateResource(*manager, "instance", OrthancPluginResourceType_Instance));
 
-      OrthancPluginAttachment a;
-      a.uuid = "attachment";
-      a.contentType = Orthanc::FileContentType_DicomAsJson;
-      a.uncompressedSize = 4242;
-      a.uncompressedHash = "md5";
-      a.compressionType = Orthanc::CompressionType_None;
-      a.compressedSize = 4242;
-      a.compressedHash = "md5";
-      db.AddAttachment(*manager, resources[attachmentLevel], a, 42);
+      OrthancPluginAttachment d;
+      d.uuid = "attachment";
+      d.contentType = Orthanc::FileContentType_DicomAsJson;
+      d.uncompressedSize = 4242;
+      d.uncompressedHash = "md5";
+      d.compressionType = Orthanc::CompressionType_None;
+      d.compressedSize = 4242;
+      d.compressedHash = "md5";
+      db.AddAttachment(*manager, resources[attachmentLevel], d, 42);
     
       db.AttachChild(*manager, resources[0], resources[1]);
       db.AttachChild(*manager, resources[1], resources[2]);
@@ -666,23 +666,23 @@
       db.AttachChild(*manager, resources[level - 1], remaining);
       ASSERT_EQ(6u, db.GetAllResourcesCount(*manager));
 
-      OrthancPluginAttachment a;
-      a.uuid = "attachment";
-      a.contentType = Orthanc::FileContentType_DicomAsJson;
-      a.uncompressedSize = 4242;
-      a.uncompressedHash = "md5";
-      a.compressionType = Orthanc::CompressionType_None;
-      a.compressedSize = 4242;
-      a.compressedHash = "md5";
-      db.AddAttachment(*manager, resources[attachmentLevel], a, 42);
+      OrthancPluginAttachment d;
+      d.uuid = "attachment";
+      d.contentType = Orthanc::FileContentType_DicomAsJson;
+      d.uncompressedSize = 4242;
+      d.uncompressedHash = "md5";
+      d.compressionType = Orthanc::CompressionType_None;
+      d.compressedSize = 4242;
+      d.compressedHash = "md5";
+      db.AddAttachment(*manager, resources[attachmentLevel], d, 42);
 
       deletedAttachments.clear();
-      a.uuid = "attachment2";
+      d.uuid = "attachment2";
       db.DeleteAttachment(*output, *manager, resources[attachmentLevel], Orthanc::FileContentType_DicomAsJson);
       ASSERT_EQ(1u, deletedAttachments.size());
       ASSERT_EQ("attachment", *deletedAttachments.begin());
       
-      db.AddAttachment(*manager, resources[attachmentLevel], a, 43);
+      db.AddAttachment(*manager, resources[attachmentLevel], d, 43);
       
       deletedAttachments.clear();
       deletedResources.clear();
--- a/MySQL/Plugins/MySQLIndex.cpp	Tue Jul 20 08:16:17 2021 +0200
+++ b/MySQL/Plugins/MySQLIndex.cpp	Tue Jul 20 08:32:28 2021 +0200
@@ -368,7 +368,7 @@
     while (!done)
     {
       bool hasSibling = false;
-      int64_t parentId;
+      int64_t parentId = -1;  // Dummy initialization
       
       {
         DatabaseManager::CachedStatement lookupSiblings(