[Common] Fixing expectation of datatypes warnings in Logger methods 15/157015/1
authorArkadiusz Pietraszek <a.pietraszek@partner.samsung.com>
Thu, 19 Oct 2017 17:02:47 +0000 (19:02 +0200)
committerPiotr Kosko <p.kosko@samsung.com>
Mon, 23 Oct 2017 06:23:01 +0000 (08:23 +0200)
Either formats %_ corrected to expect correct datatype or dytatype
casting while passing it to Logger method.

[Verification] Code compiles without warnings regarding datatypes passed
to Logger methods.

Change-Id: I8bf50728aee0c09b4b998614f3854972ef178aa5
Signed-off-by: Arkadiusz Pietraszek <a.pietraszek@partner.samsung.com>
22 files changed:
src/archive/archive_callback_data.cc
src/archive/archive_file.cc
src/archive/archive_instance.cc
src/archive/filesystem_node.cc
src/archive/un_zip.cc
src/archive/un_zip_extract_request.cc
src/archive/zip_add_request.cc
src/common/GDBus/proxy.cpp
src/common/extension.cc
src/common/filesystem/filesystem_storage.cc
src/common/filter-utils.cc
src/common/platform_result.cc
src/common/tools.cc
src/datacontrol/datacontrol_instance.cc
src/download/download_instance.cc
src/exif/exif_gps_location.cc
src/exif/exif_information.cc
src/exif/exif_util.cc
src/exif/jpeg_file.cc
src/exif/rational.cc
src/filesystem/filesystem_file.cc
src/systeminfo/systeminfo_properties_manager.cc

index 450d9c0f8bea55b933ee6744a77901ed974932f5..7c09c59f862e55c4f2e662a5007b78076308d4da 100644 (file)
@@ -591,7 +591,7 @@ void ExtractAllProgressCallback::updateOverallProgress(unsigned long bytes_decom
   m_progress_overall = static_cast<double>(m_overall_decompressed + m_files_extracted) /
                        static_cast<double>(m_expected_decompressed_size + m_files_to_extract);
 
-  LoggerD("%s of %s - %f%% (%d/%d files)", bytesToReadableString(m_overall_decompressed).c_str(),
+  LoggerD("%s of %s - %f%% (%lu/%lu files)", bytesToReadableString(m_overall_decompressed).c_str(),
           bytesToReadableString(m_expected_decompressed_size).c_str(), m_progress_overall * 100.0,
           m_files_extracted, m_files_to_extract);
 }
index f52da91aef20fc54652cfd01fcdfdccd1c6bca29..18edb2ccdcc7e10af0788dd6a6eaf079e7cfa590 100644 (file)
@@ -106,7 +106,7 @@ gboolean ArchiveFile::openTaskCompleteCB(void* data) {
     std::string fm_str;
     PlatformResult result = fileModeToString(archive_file->getFileMode(), &fm_str);
     if (result.error_code() != ErrorCode::NO_ERROR) {
-      LoggerE("%s (%d)", result.message().c_str(), result.error_code());
+      LoggerE("%s (%d)", result.message().c_str(), static_cast<int>(result.error_code()));
       delete callback;
       callback = NULL;
       return false;
@@ -204,7 +204,7 @@ void ArchiveFile::taskManagerThread(gpointer data, gpointer user_data) {
         delete callback;
         callback = NULL;
       } else if (ErrorCode::NO_ERROR != result.error_code()) {
-        LoggerE("taskManagerThread fails, %d: %s", result.error_code(), result.message().c_str());
+        LoggerE("taskManagerThread fails, %d: %s", static_cast<int>(result.error_code()), result.message().c_str());
         callback->setError(result.error_code(), result.message().c_str());
         if (!g_idle_add(callErrorCallback, static_cast<void*>(callback))) {
           LoggerE("g_idle_add fails");
index 6c26eda0380dd8077d9f23e1b078d18b662a801c..b2c324c5e8002b01a04730996d26ded1d5840734 100644 (file)
@@ -85,7 +85,7 @@ ArchiveInstance::~ArchiveInstance() {
 void ArchiveInstance::PostError(const PlatformResult& e, double callback_id) {
   LoggerD("Entered");
 
-  LoggerE("Posting an error: %d, message: %s", e.error_code(), e.message().c_str());
+  LoggerE("Posting an error: %d, message: %s", static_cast<int>(e.error_code()), e.message().c_str());
 
   picojson::value val = picojson::value(picojson::object());
   picojson::object& obj = val.get<picojson::object>();
index ee782666cd239e94afe30d240603563d3ab04c5e..27ee2e0c2b47ef89865cc194f7728fec154d495a 100644 (file)
@@ -132,7 +132,7 @@ PlatformResult Node::resolve(const PathPtr& path, NodePtr* node) {
     }
   }
 
-  if ((!S_ISDIR(info.st_mode)) & (!S_ISREG(info.st_mode)) && !S_ISLNK(info.st_mode)) {
+  if ((!S_ISDIR(info.st_mode)) && (!S_ISREG(info.st_mode)) && !S_ISLNK(info.st_mode)) {
     SLoggerE("File: [%s]", path->getFullPath().c_str());
     return LogAndCreateResult(ErrorCode::IO_ERR, "Platform node is of unsupported type.");
   }
@@ -550,7 +550,7 @@ PlatformResult Node::removeAsDirectory(const PathPtr& path, bool recursive) {
           platform_result = removeAsFile(subPath);
         }
         if (platform_result.error_code() != ErrorCode::NO_ERROR) {
-          LoggerE("Fail: getFullPath() (%d)", platform_result.error_code());
+          LoggerE("Fail: getFullPath() (%d)", static_cast<int>(platform_result.error_code()));
           closedir(dir);
           return platform_result;
         }
index de34b5f69920ae167e528456bebeb97ce2ac3a4a..4a603de78641dbc944c2b9b6ee290035693491d5 100644 (file)
@@ -125,7 +125,7 @@ PlatformResult UnZip::listEntries(unsigned long* decompressedSize,
                                 ("ret: %d", err));
     }
 
-    LoggerD("file: %s | unc size: %d | comp size: %d", filename_inzip, file_info.uncompressed_size,
+    LoggerD("file: %s | unc size: %lu | comp size: %lu", filename_inzip, file_info.uncompressed_size,
             file_info.compressed_size);
 
     ArchiveFileEntryPtr entry = ArchiveFileEntryPtr(new ArchiveFileEntry());
@@ -444,7 +444,7 @@ PlatformResult UnZip::updateCallbackWithArchiveStatistics(ExtractAllProgressCall
           bytesToReadableString(astats.uncompressed_size).c_str());
 
   callback->setNumberOfFilesToExtract(astats.number_of_files);
-  LoggerD("Number entries to extract: files: %d folders: %d", astats.number_of_files,
+  LoggerD("Number entries to extract: files: %lu folders: %lu", astats.number_of_files,
           astats.number_of_folders);
 
   return PlatformResult(ErrorCode::NO_ERROR);
index e3b7adb42dd4f185d9ce7c1bcfa2eb9077065137..cbe12b52c0637d72178e2ece2cbd0790b25caceb 100644 (file)
@@ -234,7 +234,7 @@ PlatformResult UnZipExtractRequest::getCurrentFileInfo() {
 
   m_output_filepath = removeDuplicatedSlashesFromPath(m_extract_path + "/" + file_path);
 
-  LoggerD("Packed: [%s], uncompressed_size: %d, will extract to: [%s]", m_filename_inzip,
+  LoggerD("Packed: [%s], uncompressed_size: %lu, will extract to: [%s]", m_filename_inzip,
           m_file_info.uncompressed_size, m_output_filepath.c_str());
 
   std::string path, name;
@@ -399,7 +399,7 @@ PlatformResult UnZipExtractRequest::handleFileEntry() {
 
   bool marked_as_finished = false;
 
-  LoggerD("Started extracting: [%s] uncompressed size: %d - %s", m_filename_inzip,
+  LoggerD("Started extracting: [%s] uncompressed size: %lu - %s", m_filename_inzip,
           m_file_info.uncompressed_size,
           bytesToReadableString(m_file_info.uncompressed_size).c_str());
 
index d376d7a1580c573230e9fe3bb548cdeaee8a3300..73bbb84114b3dc11869a659af61e632dd2b93445 100644 (file)
@@ -152,7 +152,7 @@ PlatformResult ZipAddRequest::run() {
             bytesToReadableString(size).c_str());
   }
 
-  LoggerD("m_files_to_compress: %d", m_files_to_compress);
+  LoggerD("m_files_to_compress: %lu", m_files_to_compress);
   LoggerD("m_bytes_to_compress: %llu (%s)", m_bytes_to_compress,
           bytesToReadableString(m_bytes_to_compress).c_str());
 
@@ -347,7 +347,7 @@ PlatformResult ZipAddRequest::addToZipArchive(filesystem::NodePtr src_file_node)
   LoggerD("m_bytes_compressed:%llu / m_bytes_to_compress: %llu", m_bytes_compressed,
           m_bytes_to_compress);
 
-  LoggerD("m_files_compressed:%d / m_files_to_compress: %d", m_files_compressed,
+  LoggerD("m_files_compressed: %lu / m_files_to_compress: %lu", m_files_compressed,
           m_files_to_compress);
 
   if (src_file_node->getType() == filesystem::NT_FILE) {
@@ -402,7 +402,7 @@ PlatformResult ZipAddRequest::addToZipArchive(filesystem::NodePtr src_file_node)
 
       LoggerD(
           "Callculatting overall progress: %llu/%llu bytes; "
-          "%d/%d files; current file: [%s] progress: %d/%d bytes; ",
+          "%lu/%lu files; current file: [%s] progress: %d/%d bytes; ",
           m_bytes_compressed, m_bytes_to_compress, m_files_compressed, m_files_to_compress,
           src_file_path.c_str(), total_bytes_read, in_file_size);
 
@@ -412,7 +412,7 @@ PlatformResult ZipAddRequest::addToZipArchive(filesystem::NodePtr src_file_node)
                    static_cast<double>(m_bytes_to_compress + m_files_to_compress);
       }
 
-      LoggerD("Wrote: %s total progress: %.2f%% %d/%d files",
+      LoggerD("Wrote: %s total progress: %.2f%% %lu/%lu files",
               bytesToReadableString(size_read).c_str(), progress * 100.0, m_files_compressed,
               m_files_to_compress);
 
index 936a10e56a3099118dd39452d4a13f8d02af03f6..86d4d6faae31ab2a70860138bd543d94445f97dd 100644 (file)
@@ -49,7 +49,7 @@ Proxy::Proxy(const std::string& proxy_path, const std::string& proxy_iface,
       m_signal_iface.c_str());
 
   const gchar* unique_name = g_dbus_connection_get_unique_name(m_conn.getDBus());
-  LoggerD("Generated unique name: %d", unique_name);
+  LoggerD("Generated unique name: %s", unique_name);
 
   // path and interface are not obligatory to receive, but
   // they should be set to send the signals.
index 983c73a1cb86eeacae1d5c68af4d1343b3078e95..64ec6382ef18b4138d3d17e7d73b3ab9140e6c09 100644 (file)
@@ -368,7 +368,7 @@ void ParsedInstance::HandleException(const PlatformException& ex) {
 }
 
 void ParsedInstance::HandleError(const PlatformResult& e) {
-  LoggerE("Error: %s", static_cast<int>(e.error_code()));
+  LoggerE("Error: %d", static_cast<int>(e.error_code()));
   picojson::value result = picojson::value(picojson::object());
   ReportError(e, &result.get<picojson::object>());
   SendSyncReply(result.serialize().c_str());
index a776e698eaef41f1699eb3dd520580dba32b8f47..9c5354a08de248365dd3820eccb24d89b53eb455 100644 (file)
@@ -42,7 +42,7 @@ Storage::Storage(int id, StorageType type, StorageState state, std::string const
         break;
       default:
         name_ = "unknown";
-        LoggerE("Unknown storage type: %d", type);
+        LoggerE("Unknown storage type: %d", static_cast<int>(type));
         break;
     }
     name_ += std::to_string(id);
@@ -93,7 +93,7 @@ std::string VirtualRoot::ToString(StorageType type) {
     case StorageType::kMmc:
       return "EXTERNAL";
     default:
-      LoggerE("Unknown storage type: %d", type);
+      LoggerE("Unknown storage type: %d", static_cast<int>(type));
       return "UNKNOWN";
   }
 }
@@ -108,7 +108,7 @@ std::string VirtualRoot::ToString(StorageState state) {
     case StorageState::kMounted:
       return "MOUNTED";
     default:
-      LoggerE("Unknown storage state: %d", state);
+      LoggerE("Unknown storage state: %d", static_cast<int>(state));
       return "UNKNOWN";
   }
 }
index 9bc7441a9272772355176d1ed1c8f40284088f9d..d6cefaf0314c6828eee1dde2abdad7b5aaf81f7d 100644 (file)
@@ -37,7 +37,7 @@ PlatformResult AttributeMatchFlagFromString(const std::string &str,
   } else if (str == "EXISTS") {
     *filter_match_flag = AttributeMatchFlag::kExists;
   } else {
-    LoggerE("Invalid attribute match string: %i", str.c_str());
+    LoggerE("Invalid attribute match string: %s", str.c_str());
     return PlatformResult(ErrorCode::INVALID_VALUES_ERR, "Invalid attribute match string!");
   }
 
@@ -52,7 +52,7 @@ PlatformResult CompositeFilterTypeFromString(const std::string &str,
   } else if (str == "INTERSECTION") {
     *comp_filter_type = CompositeFilterType::kIntersection;
   } else {
-    LoggerE("Invalid composite type string: %i", str.c_str());
+    LoggerE("Invalid composite type string: %s", str.c_str());
 
     return PlatformResult(ErrorCode::INVALID_VALUES_ERR, "Invalid composite type string!");
   }
index ec3a50de31e2f6aa8dbde4b011058bf11cc4f424..7181ee24525e1dc2879e2653da6433d8e008467b 100644 (file)
@@ -24,7 +24,7 @@ PlatformResult::PlatformResult(const ErrorCode& error_code, const std::string& m
   LoggerD("Enter");
 
   if (ErrorCode::NO_ERROR != error_code) {
-    LoggerE("PlatformResult: %d, message: %s", error_code, message.c_str());
+    LoggerE("PlatformResult: %d, message: %s", static_cast<int>(error_code), message.c_str());
   }
 }
 
index 588663f45537973f56aba732fe43e9a9832465f7..5afef9aa492665ac1bfa30cca8940b831ef51572 100644 (file)
@@ -62,7 +62,7 @@ void ReportError(const PlatformException& ex, picojson::object& out) {
 }
 
 void ReportError(const PlatformResult& error, picojson::object* out) {
-  LoggerE("PlatformResult: %d, message: %s", error.error_code(), error.message().c_str());
+  LoggerE("PlatformResult: %d, message: %s", static_cast<int>(error.error_code()), error.message().c_str());
   out->insert(std::make_pair("status", picojson::value("error")));
   out->insert(std::make_pair("error", error.ToJSON()));
 }
index dbfaae96bca374ddf6e47ceea1f08c8e8abb7b3d..da5e7ceb2b315ba33681056deccc58dd218b8c34 100644 (file)
@@ -174,7 +174,7 @@ static bool SQLColumnValue(result_set_cursor cursor, int columnIndex, picojson::
       break;
     }
     default: {
-      LoggerE("%th column is undefined column type", columnIndex);
+      LoggerE("%d column is undefined column type", columnIndex);
       return false;
     }
   }
index 208caae3688bebe24e214d1fe6b7dde2d5d4892b..c689695af0330d4bb36502e869630f5e193b9b35 100644 (file)
@@ -236,7 +236,7 @@ gboolean DownloadInstance::OnProgressChanged(void* user_data) {
   out["receivedSize"] = picojson::value(static_cast<double>(downCbPtr->received));
   out["totalSize"] = picojson::value(static_cast<double>(diPtr->file_size));
 
-  LoggerD("OnProgressChanged for callbackId %d Called: Received: %ld", downCbPtr->callbackId,
+  LoggerD("OnProgressChanged for callbackId %d Called: Received: %llu", downCbPtr->callbackId,
           downCbPtr->received);
 
   picojson::value v = picojson::value(out);
index 2426cb05f6b73d0ef45f55a249a5b4849e40cb75..dce7effbb92a55f2de5ab9ee4085ca377115fd08 100644 (file)
@@ -76,7 +76,7 @@ std::string GCSPosition::toDebugString() const {
 }
 
 GCSPosition GCSPosition::createFromDouble(double value) {
-  LoggerD("Entered value:%f");
+  LoggerD("Entered value:%f", value);
   if (value < 0) {
     LoggerW("Trying to create GCSPosition with double < 0: %f", value);
     return GCSPosition();
index 08f7ed95aeaa100ca47796acb8703af159141947..e0977505abe6592bd75733371ae0f9132b4a5f71 100644 (file)
@@ -698,14 +698,14 @@ PlatformResult ExifInformation::updateAttributesInExifData(ExifData* exif_data)
   AssertMsg(exif_data, "exif_data is NULL");
 
   if (isSet(EXIF_INFORMATION_ATTRIBUTE_WIDTH)) {
-    LoggerD("Saving width: %d", getWidth());
+    LoggerD("Saving width: %lu", getWidth());
     ret = ExifTagSaver::saveToExif(getWidth(), EXIF_TAG_IMAGE_WIDTH, exif_data);
     if (!ret) {
       return ret;
     }
   }
   if (isSet(EXIF_INFORMATION_ATTRIBUTE_HEIGHT)) {
-    LoggerD("Saving height: %d", getHeight());
+    LoggerD("Saving height: %lu", getHeight());
     ret = ExifTagSaver::saveToExif(getHeight(), EXIF_TAG_IMAGE_LENGTH, exif_data);
     if (!ret) {
       return ret;
index 9f9bc90e47fa4c8e5ab06bfd42cdd7e097f4d7f8..8dd08a4259fbac13b68cdfda165cebd44715b934 100644 (file)
@@ -323,7 +323,7 @@ size_t ExifUtil::getSizeOfExifFormatType(ExifFormat format) {
       break;
 
     default:
-      LoggerE("output ExifFormat: %d is not supported!");
+      LoggerE("output ExifFormat: %d is not supported!", format);
       return 0;
   }
 
index b46ed6e23305e4a957c45d0b18fe245eeb4f6892..a7e6f8abb70ed69c11c15e5ac28aca77aa58c3a0 100644 (file)
@@ -174,7 +174,7 @@ PlatformResult JpegFile::load(const std::string& path) {
   if (read_bytes != m_in_data_size) {
     return LogAndCreateResult(
         ErrorCode::UNKNOWN_ERR, "Could not read JPEG file",
-        ("Couldn't read all: %d bytes. Read only: %d bytes!", m_in_data_size, read_bytes));
+        ("Couldn't read all: %d bytes. Read only: %u bytes!", m_in_data_size, read_bytes));
   }
 
   if (fclose(m_in_file) == EOF) {
@@ -230,7 +230,7 @@ common::PlatformResult JpegFile::generateListOfSections() {
   m_padding_data_size = 0;
 
   for (size_t offset = 0, iterration = 0; offset < m_in_data_size; ++iterration) {
-    LoggerD("offset:%d | Starting iteration: %d", offset, iterration);
+    LoggerD("offset:%u | Starting iteration: %u", offset, iterration);
     const std::size_t search_len = 10;
     std::size_t search_offset = 0;
     for (search_offset = 0; search_offset < search_len; ++search_offset) {
@@ -243,7 +243,7 @@ common::PlatformResult JpegFile::generateListOfSections() {
 
     if (search_len == search_offset) {
       return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "JPEG file is invalid",
-                                ("offset:%d | Couldn't find marker! RAW DATA:{%s}", offset,
+                                ("offset:%u | Couldn't find marker! RAW DATA:{%s}", offset,
                                  getPartOfFile(offset, 0, 10).c_str()));
     }
 
@@ -251,16 +251,16 @@ common::PlatformResult JpegFile::generateListOfSections() {
     unsigned char* section_begin = m_in_data + section_offset;
 
     offset = section_offset;  // Move to section begin
-    LoggerD("offset:%d | Moved to section begin", offset);
+    LoggerD("offset:%u | Moved to section begin", offset);
 
     if (!isJpegMarker(section_begin[1])) {
       return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "JPEG file is invalid",
-                                ("offset:%d | Is not valid marker: 0x%x RAW DATA:{%s}", offset,
+                                ("offset:%u | Is not valid marker: 0x%x RAW DATA:{%s}", offset,
                                  section_begin[1], getPartOfFile(section_offset, 0, 4).c_str()));
     }
 
     const JpegMarker cur_marker = castToJpegMarker(section_begin[1]);
-    LoggerD("offset:%d | Found valid marker: 0x%x RAW DATA:{%s}", offset, cur_marker,
+    LoggerD("offset:%u | Found valid marker: 0x%x RAW DATA:{%s}", offset, cur_marker,
             getPartOfFile(section_offset, 0, 4).c_str());
 
     offset += 2;  // Read 0xffxx marker tag - 2 bytes
@@ -279,7 +279,7 @@ common::PlatformResult JpegFile::generateListOfSections() {
     section->type = cur_marker;
     m_sections.push_back(section);
     if (cur_marker == JPEG_MARKER_SOI || cur_marker == JPEG_MARKER_EOI) {
-      LoggerD("offset:%d | Found: %s marker, moving to next marker at:%d", section_offset,
+      LoggerD("offset:%u | Found: %s marker, moving to next marker at:%u", section_offset,
               ((cur_marker == JPEG_MARKER_SOI) ? "SOI" : "EOI"), offset);
 
       if (cur_marker == JPEG_MARKER_EOI && m_padding_data != NULL) {
@@ -306,21 +306,21 @@ common::PlatformResult JpegFile::generateListOfSections() {
       // size 2 bytes
       const long section_data_len = total_section_len - 2;
 
-      LoggerD("offset:%d tag:0x%x | Read total_section_len:%d (data len:%d)", section_offset,
+      LoggerD("offset:%u tag:0x%x | Read total_section_len:%ld (data len:%ld)", section_offset,
               cur_marker, total_section_len, section_data_len);
 
       offset += 2;  // Read data size - 2 bytes
 
       if (total_section_len < 0) {
         return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "JPEG file is invalid",
-                                  ("offset:%d tag:0x%x | Error: total_section_len is: %d < 0",
+                                  ("offset:%u tag:0x%x | Error: total_section_len is: %ld < 0",
                                    offset, cur_marker, total_section_len));
       }
 
       if (section_offset + 2 + total_section_len > m_in_data_size) {
         return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "JPEG file is invalid",
-                                  ("offset:%d tag:0x%x | Error: current section offset:%d"
-                                   " + 2 + total_section_len:%d = %d is greater then file size:%d",
+                                  ("offset:%u tag:0x%x | Error: current section offset:%u"
+                                   " + 2 + total_section_len:%ld = %lu is greater then file size:%u",
                                    offset, cur_marker, section_offset, total_section_len,
                                    section_offset + total_section_len, m_in_data_size));
       }
@@ -330,8 +330,8 @@ common::PlatformResult JpegFile::generateListOfSections() {
         section->exif_data = exif_data_new_from_data(section_begin, exif_data_size);
 
         LoggerD(
-            "offset:%d tag:0x%x | Loading exif from offset:%d"
-            " len:%d exif_data_new_from_data returned: %p",
+            "offset:%u tag:0x%x | Loading exif from offset:%u"
+            " len:%u exif_data_new_from_data returned: %p",
             offset, cur_marker, section_offset, exif_data_size, section->exif_data);
 
         if (!section->exif_data) {
@@ -356,7 +356,7 @@ common::PlatformResult JpegFile::generateListOfSections() {
         std::size_t image_size = m_in_data_size - image_data_offset - 2;
         LoggerW(
             "offset:%d tag:0x%x"
-            " | Image data offset:%d Estimated image size:%d",
+            " | Image data offset:%u Estimated image size:%u",
             offset, cur_marker, image_data_offset, image_size);
 
         m_image_data = m_in_data + image_data_offset;
@@ -380,7 +380,7 @@ common::PlatformResult JpegFile::generateListOfSections() {
                 " delta:%d",
                 image_size, eoi_tag_index, image_size - eoi_tag_index);
 
-            LoggerW("Setting image_size to EOI tag: %d", eoi_tag_index);
+            LoggerW("Setting image_size to EOI tag: %u", eoi_tag_index);
             image_size = eoi_tag_index;
 
             m_padding_data = m_image_data + image_size + 2;  // (skip EOI tag)
@@ -393,10 +393,10 @@ common::PlatformResult JpegFile::generateListOfSections() {
         m_image_size = image_size;
 
         offset = image_data_offset + image_size;
-        LoggerD("offset:%d tag:0x%x | SOS Offset moved to next marker", offset, cur_marker);
+        LoggerD("offset:%u tag:0x%x | SOS Offset moved to next marker", offset, cur_marker);
       } else {
         offset += section_data_len;
-        LoggerD("offset:%d tag:0x%x | Offset moved to next marker", offset, cur_marker);
+        LoggerD("offset:%u tag:0x%x | Offset moved to next marker", offset, cur_marker);
       }
     }
   }
@@ -514,7 +514,7 @@ PlatformResult JpegFile::saveToFile(const std::string& out_path) {
 
   LoggerE(
       "Exception occured during saveToFilePriv "
-      "original file: [%] new: [%s]",
+      "original file: [%s] new: [%s]",
       m_source_file_path.c_str(), out_path.c_str());
 
   if (out_path == m_source_file_path) {
@@ -671,7 +671,7 @@ PlatformResult JpegFile::saveToFilePriv(const std::string& out_path) {
   }
 
   if (m_padding_data && m_padding_data_size > 0) {
-    LoggerD("Padding data exists and contains:%d bytes saving to JPEG file");
+    LoggerD("Padding data exists and contains:%d bytes saving to JPEG file", m_padding_data_size);
     const std::size_t bytes_wrote = fwrite(m_image_data, 1, m_padding_data_size, m_out_file);
 
     if (bytes_wrote != m_padding_data_size) {
@@ -712,7 +712,7 @@ JpegFileSectionPtr JpegFile::getExifSection() {
       } else {
         LoggerW(
             "Warning: found %d APP1/Exif sections -"
-            " only first is currently supported!");
+            " only first is currently supported!", num_exif_sections);
       }
     }
   }
index 2df69705890dc4934dc079efb0b827a7cbfadb7a..6009de545724ecb620ba7695ae4a2f19dfde9eaf 100644 (file)
@@ -41,7 +41,7 @@ Rational::Rational(const ExifRational& exif_rational)
 }
 
 Rational Rational::createFromDouble(const double value, const long precision) {
-  LoggerD("Entered value:%f precision:%d", value, precision);
+  LoggerD("Entered value:%f precision:%lu", value, precision);
   if (value < 0.0) {
     LoggerW("Trying to create negative Rational: %f!", value);
     return Rational();
@@ -122,7 +122,7 @@ Rational Rational::createFromDouble(const double value, const long precision) {
     result_denominator *= -1;
   }
 
-  LoggerD("Rational(%d, %d) error0 < error1m:%d", result_numerator, result_denominator,
+  LoggerD("Rational(%ld, %ld) error0 < error1m:%d", result_numerator, result_denominator,
           error0 < error1m);
 
   return Rational(numerator0, denominator0);
@@ -202,7 +202,7 @@ Rational Rational::createFromExposureTimeString(const std::string& exp_time) {
   }
 
   nominator += denominator * integer_value;
-  LoggerD("%d/%d -> %f", nominator, denominator, static_cast<float>(nominator) / denominator);
+  LoggerD("%ld/%ld -> %f", nominator, denominator, static_cast<float>(nominator) / denominator);
 
   if (0 == nominator) {
     // Exposure time = 0 is invalid value
index bc0734cd3ff5f20047169feec71a9d76a276c6eb..3c75d1f237212d6768c38d35a0f10291e5803255 100644 (file)
@@ -197,7 +197,7 @@ bool FilesystemFile::Read(FilesystemBuffer* data, size_t offset, size_t length)
     data_p += part;
     data_size -= part;
 
-    LoggerD("Readed part %li bytes", readed);
+    LoggerD("Readed part %u bytes", readed);
 
     if (ferror(file)) {
       LoggerE("Error during file write!");
@@ -209,7 +209,7 @@ bool FilesystemFile::Read(FilesystemBuffer* data, size_t offset, size_t length)
       break;
     }
   }
-  LoggerD("Readed %li bytes", readed);
+  LoggerD("Readed %u bytes", readed);
   data->resize(readed);
   return true;
 }
@@ -238,7 +238,7 @@ bool FilesystemFile::Write(const FilesystemBuffer& data, size_t offset, bool rew
 
   int status;
   status = fseek(file, offset, SEEK_SET);
-  LoggerD("Offset is %li, writing %i bytes", offset, data.size());
+  LoggerD("Offset is %u, writing %i bytes", offset, data.size());
   if (status) {
     LoggerE("Cannot perform seek!");
     return false;
@@ -271,7 +271,7 @@ bool FilesystemFile::Write(const FilesystemBuffer& data, size_t offset, bool rew
     LoggerE("Cannot sync file!");
     return false;
   }
-  LoggerD("Written %li bytes", written);
+  LoggerD("Written %u bytes", written);
 
   return true;
 }
index ec0218ab2b151527de313ce2095ea6270c2048dd..3bb52c2da753ee06da03d9d4a85da1f180927353 100644 (file)
@@ -131,7 +131,7 @@ PlatformResult SysteminfoPropertiesManager::GetPropertyValue(const std::string&
       return ret;
     }
     LoggerD("property name: %s", property.c_str());
-    LoggerD("available property count: %d", property_count);
+    LoggerD("available property count: %lu", property_count);
 
     for (std::size_t i = 0; i < property_count; i++) {
       picojson::value result = picojson::value(picojson::object());
@@ -447,7 +447,7 @@ PlatformResult SysteminfoPropertiesManager::FetchStatus(std::string* result) {
       break;
     default:
       return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "Received unexpected data",
-                                ("Received unexpected data: %u", rotation));
+                                ("Received unexpected data: %d", rotation));
   }
   *result = status;
   return PlatformResult(ErrorCode::NO_ERROR);
@@ -556,7 +556,7 @@ static PlatformResult GetNetworkTypeString(NetworkType type, std::string& type_s
 
 PlatformResult SysteminfoPropertiesManager::ReportNetwork(picojson::object* out,
                                                           unsigned long count) {
-  LoggerD("Entered with index property %d", count);
+  LoggerD("Entered with index property %lu", count);
   connection_h connection_handle = nullptr;
   connection_type_e connection_type = CONNECTION_TYPE_DISCONNECTED;
   int networkType = 0;
@@ -1036,7 +1036,7 @@ static PlatformResult FetchConnection(std::string* result_status, std::string* r
 
 PlatformResult SysteminfoPropertiesManager::ReportCellularNetwork(picojson::object* out,
                                                                   unsigned long count) {
-  LoggerD("Entered with index property %d", count);
+  LoggerD("Entered with index property %lu", count);
   PlatformResult ret = SysteminfoUtils::CheckTelephonySupport();
   if (ret.IsError()) {
     return ret;