From 14e40b243caff9b83a22f76b2be3818986970a88 Mon Sep 17 00:00:00 2001
From: Karl Mortensen <kmortensen@basistech.com>
Date: Wed, 17 Feb 2016 15:23:30 -0500
Subject: [PATCH] Remove unneeded code

---
 tools/autotools/tsk_comparedir.cpp | 3 +--
 tools/autotools/tsk_gettimes.cpp   | 4 ++--
 tools/autotools/tsk_recover.cpp    | 4 ++--
 tsk/auto/auto.cpp                  | 6 ++----
 tsk/auto/auto_db.cpp               | 7 +++----
 tsk/auto/tsk_auto.h                | 4 ++--
 6 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/tools/autotools/tsk_comparedir.cpp b/tools/autotools/tsk_comparedir.cpp
index 9a0d9d483..0dde70517 100644
--- a/tools/autotools/tsk_comparedir.cpp
+++ b/tools/autotools/tsk_comparedir.cpp
@@ -408,8 +408,7 @@ main(int argc, char **argv1)
 
     tskCompareDir.setFileFilterFlags(TSK_FS_DIR_WALK_FLAG_ALLOC);
 
-	int64_t objId=0;
-    if (tskCompareDir.openImage(argc - OPTIND - 1, &argv[OPTIND], imgtype, ssize, objId)) {
+	if (tskCompareDir.openImage(argc - OPTIND - 1, &argv[OPTIND], imgtype, ssize)) {
         tsk_error_print(stderr);
         exit(1);
     }
diff --git a/tools/autotools/tsk_gettimes.cpp b/tools/autotools/tsk_gettimes.cpp
index 66b801ff3..3ceb19244 100644
--- a/tools/autotools/tsk_gettimes.cpp
+++ b/tools/autotools/tsk_gettimes.cpp
@@ -216,8 +216,8 @@ main(int argc, char **argv1)
     }
 	
 	TskGetTimes tskGetTimes(sec_skew, do_hash);
-	int64_t objId=0;
-    if (tskGetTimes.openImage(argc - OPTIND, &argv[OPTIND], imgtype, ssize, objId)) {
+	
+    if (tskGetTimes.openImage(argc - OPTIND, &argv[OPTIND], imgtype, ssize)) {
         tsk_error_print(stderr);
         exit(1);
     }
diff --git a/tools/autotools/tsk_recover.cpp b/tools/autotools/tsk_recover.cpp
index 6723a1b21..d06c534d1 100644
--- a/tools/autotools/tsk_recover.cpp
+++ b/tools/autotools/tsk_recover.cpp
@@ -489,8 +489,8 @@ main(int argc, char **argv1)
     TskRecover tskRecover(argv[argc-1]);
 
     tskRecover.setFileFilterFlags(walkflag);    
-	int64_t objId=0;
-	if (tskRecover.openImage(argc - OPTIND - 1, &argv[OPTIND], imgtype, ssize, objId)) {
+	
+	if (tskRecover.openImage(argc - OPTIND - 1, &argv[OPTIND], imgtype, ssize)) {
         tsk_error_print(stderr);
         exit(1);
     }
diff --git a/tsk/auto/auto.cpp b/tsk/auto/auto.cpp
index 880c95ef1..39a8c2e07 100644
--- a/tsk/auto/auto.cpp
+++ b/tsk/auto/auto.cpp
@@ -69,12 +69,11 @@ bool TskAuto::isCurVsValid() const {
  * be equal to num_img and they must be in a sorted order)
  * @param a_imgType The disk image type (can be autodetection)
  * @param a_sSize Size of device sector in bytes (or 0 for default)
- * @param dataSourceObjId The object ID for the data source
  * @returns 1 on error (messages were NOT registered), 0 on success
  */
 uint8_t
     TskAuto::openImage(int a_numImg, const TSK_TCHAR * const a_images[],
-    TSK_IMG_TYPE_ENUM a_imgType, unsigned int a_sSize, int64_t & dataSourceObjId)
+    TSK_IMG_TYPE_ENUM a_imgType, unsigned int a_sSize)
 {
     resetErrorList();
     if (m_img_info)
@@ -98,12 +97,11 @@ uint8_t
  * be equal to num_img and they must be in a sorted order)
  * @param a_imgType The disk image type (can be autodetection)
  * @param a_sSize Size of device sector in bytes (or 0 for default)
- * @param dataSourceObjId The object ID for the data source
  * @returns 1 on error (messages were NOT registered), 0 on success
  */
 uint8_t
     TskAuto::openImageUtf8(int a_numImg, const char *const a_images[],
-    TSK_IMG_TYPE_ENUM a_imgType, unsigned int a_sSize, int64_t & dataSourceObjId)
+    TSK_IMG_TYPE_ENUM a_imgType, unsigned int a_sSize)
 {
     resetErrorList();
     if (m_img_info)
diff --git a/tsk/auto/auto_db.cpp b/tsk/auto/auto_db.cpp
index 1e1feb959..e9afd7e14 100644
--- a/tsk/auto/auto_db.cpp
+++ b/tsk/auto/auto_db.cpp
@@ -122,7 +122,7 @@ uint8_t
     TSK_IMG_TYPE_ENUM a_type, unsigned int a_ssize, int64_t & dataSourceObjId, const char* a_deviceId)
 {
     uint8_t retval =
-        TskAuto::openImageUtf8(a_num, a_images, a_type, a_ssize, dataSourceObjId);
+        TskAuto::openImageUtf8(a_num, a_images, a_type, a_ssize);
     if (retval != 0) {
         return retval;
     }
@@ -130,7 +130,6 @@ uint8_t
     if (addImageDetails(a_deviceId, a_images, a_num)) {
         return 1;
     }
-	dataSourceObjId = m_curImgId;
     return 0;
 }
 
@@ -153,7 +152,7 @@ uint8_t
 // make name of database
 #ifdef TSK_WIN32
 
-    uint8_t retval = TskAuto::openImage(a_num, a_images, a_type, a_ssize, dataSourceObjId);
+    uint8_t retval = TskAuto::openImage(a_num, a_images, a_type, a_ssize);
 
     if (retval != 0) {
         return retval;
@@ -200,7 +199,7 @@ uint8_t
         free(img_ptrs[i]);
     }
     free(img_ptrs);
-	dataSourceObjId = m_curImgId;
+	
     return 0;
 #else
     return openImageUtf8(a_num, a_images, a_type, a_ssize, dataSourceObjId, a_deviceId);
diff --git a/tsk/auto/tsk_auto.h b/tsk/auto/tsk_auto.h
index 69c6781c1..55e60ef64 100644
--- a/tsk/auto/tsk_auto.h
+++ b/tsk/auto/tsk_auto.h
@@ -69,9 +69,9 @@ class TskAuto {
      virtual ~ TskAuto();
 
     virtual uint8_t openImage(int, const TSK_TCHAR * const images[],
-        TSK_IMG_TYPE_ENUM, unsigned int a_ssize, int64_t & dataSourceObjId);
+        TSK_IMG_TYPE_ENUM, unsigned int a_ssize);
     virtual uint8_t openImageUtf8(int, const char *const images[],
-        TSK_IMG_TYPE_ENUM, unsigned int a_ssize, int64_t & dataSourceObjId);
+        TSK_IMG_TYPE_ENUM, unsigned int a_ssize);
     virtual uint8_t openImageHandle(TSK_IMG_INFO *);
     virtual void closeImage();
 
-- 
GitLab