[Archive] - Removing warning after adding the compilation option -Wall
authorAndrzej Popowski <a.popowski@samsung.com>
Wed, 1 Jul 2015 11:20:57 +0000 (13:20 +0200)
committerAndrzej Popowski <a.popowski@samsung.com>
Fri, 3 Jul 2015 08:19:59 +0000 (10:19 +0200)
[Verification] - The code compiles without errors

Change-Id: I1514dde0138e898ff9b03b83bd81ee2d14eafdd0
Signed-off-by: Andrzej Popowski <a.popowski@samsung.com>
src/archive/archive_callback_data.cc
src/archive/archive_manager.cc
src/archive/archive_utils.cc

index bba7ee8115944240f4ce7fbc8b19203886be55fd..d57b7b26816b30c1cb8e58548fcec2b33fcf0222 100755 (executable)
@@ -40,9 +40,9 @@ OperationCallbackData::OperationCallbackData(ArchiveCallbackType callback_type,
     m_op_id(-1),
     m_cid(-1),
     m_handle(-1),
+    instance_(instance),
     m_is_error(false),
-    m_is_canceled(false),
-    instance_(instance)
+    m_is_canceled(false)
 {
     LoggerD("Entered");
 }
@@ -616,9 +616,9 @@ ExtractAllProgressCallback::ExtractAllProgressCallback(ArchiveInstance& instance
     BaseProgressCallback(EXTRACT_ALL_PROGRESS_CALLBACK, instance),
     m_files_to_extract(0),
     m_expected_decompressed_size(0),
-    m_files_extracted(0),
     m_current_file_size(0),
     m_current_file_extracted_bytes(0),
+    m_files_extracted(0),
     m_progress_overall(0),
     m_overall_decompressed(0)
 {
index 1eb432e23446441b53ed38c2d6018ba842f11fc6..97a9998cc4c779d667f62eaa8c9314d965a6bb66 100755 (executable)
@@ -52,7 +52,7 @@ void ArchiveManager::abort(long operation_id)
         std::lock_guard<std::mutex> lock(archive_file_ptr->m_mutex);
 
         std::size_t size = archive_file_ptr->m_task_queue.size();
-        for(int i = 0; i < size; ++i){
+        for(std::size_t i = 0; i < size; ++i){
             if(operation_id == archive_file_ptr->m_task_queue[i].first){
                 archive_file_ptr->m_task_queue[i].second->setIsCanceled(true);
                 return;
index c88a4b24346767b9f2a190dccd53a209b2d88ed3..1ce2c703e0235c7da649da483da992bbbfebeaa2 100755 (executable)
@@ -134,13 +134,13 @@ void getBasePathAndName(const std::string& filepath,
     size_t name_end_index = filepath_len;
     size_t name_start_index = 0;
 
-    for(int i = filepath_len - 1; i >= 0; --i) {
+    for(int i = static_cast<int>(filepath_len) - 1; i >= 0; --i) {
         const char& cur = filepath[i];
         if(cur == '/' || cur == '\\') {
-            if( (filepath_len-1) == i ) {
-                name_end_index = i;
+            if((static_cast<int>(filepath_len)-1) == i) {
+                name_end_index = static_cast<std::size_t>(i);
             } else {
-                name_start_index = i+1;
+                name_start_index = static_cast<std::size_t>(i) + 1;
                 out_name = filepath.substr(name_start_index,
                     name_end_index - name_start_index);