From 8f6b4a32106db152ce7b933fe12032ca1c3077cc Mon Sep 17 00:00:00 2001
From: chrfranke <chrfranke@4ea69e1a-61f1-4043-bf83-b5c94c648137>
Date: Mon, 26 Oct 2009 22:38:19 +0000
Subject: [PATCH] Remove duplicate function smart_device_list::add(). Replace
 calls with push_back().

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2973 4ea69e1a-61f1-4043-bf83-b5c94c648137
---
 smartmontools/CHANGELOG       |  3 +++
 smartmontools/dev_interface.h |  3 ---
 smartmontools/dev_legacy.cpp  |  4 ++--
 smartmontools/os_freebsd.cpp  |  6 +++---
 smartmontools/os_linux.cpp    |  2 +-
 smartmontools/os_win32.cpp    | 10 +++++-----
 6 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/smartmontools/CHANGELOG b/smartmontools/CHANGELOG
index d863e5b65..0cace3c0c 100644
--- a/smartmontools/CHANGELOG
+++ b/smartmontools/CHANGELOG
@@ -43,6 +43,9 @@ NOTES FOR FUTURE RELEASES: see TODO file.
 
 <DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE>
 
+  [CF] Remove duplicate function smart_device_list::add().
+       Replace calls with push_back().
+
   [MS] attribute update:
        trim attribute names to 23 chars
 
diff --git a/smartmontools/dev_interface.h b/smartmontools/dev_interface.h
index eb53a01ef..5921e0046 100644
--- a/smartmontools/dev_interface.h
+++ b/smartmontools/dev_interface.h
@@ -634,9 +634,6 @@ public:
     }
 
 
-  void add(smart_device * dev)
-    { m_list.push_back(dev); }
-
   void push_back(smart_device * dev)
     { m_list.push_back(dev); }
 
diff --git a/smartmontools/dev_legacy.cpp b/smartmontools/dev_legacy.cpp
index ff430dbf6..7680f72e6 100644
--- a/smartmontools/dev_legacy.cpp
+++ b/smartmontools/dev_legacy.cpp
@@ -557,14 +557,14 @@ bool legacy_smart_interface::scan_smart_devices(smart_device_list & devlist,
   for (i = 0; i < numata; i++) {
     ata_device * atadev = get_ata_device(atanames[i], type);
     if (atadev)
-      devlist.add(atadev);
+      devlist.push_back(atadev);
   }
   free_devnames(atanames, numata);
 
   for (i = 0; i < numscsi; i++) {
     scsi_device * scsidev = get_scsi_device(scsinames[i], type);
     if (scsidev)
-      devlist.add(scsidev);
+      devlist.push_back(scsidev);
   }
   free_devnames(scsinames, numscsi);
   return true;
diff --git a/smartmontools/os_freebsd.cpp b/smartmontools/os_freebsd.cpp
index b80793b30..e7af98960 100644
--- a/smartmontools/os_freebsd.cpp
+++ b/smartmontools/os_freebsd.cpp
@@ -1588,19 +1588,19 @@ bool freebsd_smart_interface::scan_smart_devices(smart_device_list & devlist,
   for (i = 0; i < numata; i++) {
     ata_device * atadev = get_ata_device(atanames[i], type);
     if (atadev)
-      devlist.add(atadev);
+      devlist.push_back(atadev);
   }
 
   for (i = 0; i < numscsi; i++) {
     if(!*type) { // try USB autodetection if no type specified
       smart_device * smartdev = autodetect_smart_device(scsinames[i]);
       if(smartdev)
-        devlist.add(smartdev);
+        devlist.push_back(smartdev);
     }
     else {
       scsi_device * scsidev = get_scsi_device(scsinames[i], type);
       if (scsidev)
-        devlist.add(scsidev);
+        devlist.push_back(scsidev);
     }
   }
   return true;
diff --git a/smartmontools/os_linux.cpp b/smartmontools/os_linux.cpp
index 78d9c6984..b7aa05d48 100644
--- a/smartmontools/os_linux.cpp
+++ b/smartmontools/os_linux.cpp
@@ -2892,7 +2892,7 @@ bool linux_smart_interface::get_dev_list(smart_device_list & devlist,
       else
         dev = new linux_ata_device(this, name, req_type);
       if (dev) // autodetect_smart_device() may return nullptr.
-        devlist.add(dev);
+        devlist.push_back(dev);
     }
   }
 
diff --git a/smartmontools/os_win32.cpp b/smartmontools/os_win32.cpp
index 3780f8760..26c60308a 100644
--- a/smartmontools/os_win32.cpp
+++ b/smartmontools/os_win32.cpp
@@ -2440,7 +2440,7 @@ bool win9x_smart_interface::ata_scan(smart_device_list & devlist)
     if (!(devmap & (1 << i)))
       continue;
     sprintf(name, "/dev/hd%c", 'a'+i);
-    devlist.add( new win_ata_device(this, name, "ata") );
+    devlist.push_back( new win_ata_device(this, name, "ata") );
   }
   return true;
 }
@@ -2469,7 +2469,7 @@ bool winnt_smart_interface::ata_scan(smart_device_list & devlist)
       for (int pi = 0; pi < 32; pi++) {
         if (vers_ex.dwDeviceMapEx & (1L << pi)) {
             sprintf(name, "/dev/sd%c,%u", 'a'+i, pi);
-            devlist.add( new win_ata_device(this, name, "ata") );
+            devlist.push_back( new win_ata_device(this, name, "ata") );
         }
       }
       continue;
@@ -2477,7 +2477,7 @@ bool winnt_smart_interface::ata_scan(smart_device_list & devlist)
 
     // Driver supports SMART_GET_VERSION or STORAGE_QUERY_PROPERTY returns ATA/SATA
     sprintf(name, "/dev/sd%c", 'a'+i);
-    devlist.add( new win_ata_device(this, name, "ata") );
+    devlist.push_back( new win_ata_device(this, name, "ata") );
   }
 
   return true;
@@ -3209,7 +3209,7 @@ bool win9x_smart_interface::scsi_scan(smart_device_list & devlist)
           pout("  ID %u: Device Type=0x%02x\n", id, srb.t.devtype);
         char name[20];
         sprintf(name, "/dev/scsi%u%u", ad, id);
-        devlist.add( new win_aspi_device(this, name, "scsi") );
+        devlist.push_back( new win_aspi_device(this, name, "scsi") );
       }
       else if (con->reportscsiioctl)
         pout("  ID %u: Device Type=0x%02x (ignored)\n", id, srb.t.devtype);
@@ -3432,7 +3432,7 @@ bool winnt_smart_interface::scsi_scan(smart_device_list & devlist)
       continue;
     // STORAGE_QUERY_PROPERTY returned SCSI/SAS/...
     sprintf(name, "/dev/sd%c", 'a'+i);
-    devlist.add( new win_scsi_device(this, name, "scsi") );
+    devlist.push_back( new win_scsi_device(this, name, "scsi") );
   }
   return true;
 }
-- 
GitLab