[Project] Fixing formatting + errors found by cpplint 92/158992/1
authorSzymon Jastrzebski <s.jastrzebsk@partner.samsung.com>
Mon, 6 Nov 2017 07:39:40 +0000 (08:39 +0100)
committerSzymon Jastrzebski <s.jastrzebsk@partner.samsung.com>
Mon, 6 Nov 2017 07:39:40 +0000 (08:39 +0100)
[Verification] Code compiles

Change-Id: I9a501c568d7da8348284977ec5d1f58837170e70

src/archive/archive_file.cc
src/archive/archive_instance.cc
src/archive/un_zip.cc
src/common/tools.cc
src/datacontrol/datacontrol_instance.cc
src/exif/jpeg_file.cc
src/iotcon/iotcon_utils.cc
src/keymanager/keymanager_instance.cc
src/notification/common_notification.h
src/sensor/sensor_service.cc
src/systeminfo/systeminfo_manager.cc

index 98df4f9..0f91199 100644 (file)
@@ -204,7 +204,8 @@ 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", static_cast<int>(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 77a2239..ae2745c 100644 (file)
@@ -85,7 +85,8 @@ ArchiveInstance::~ArchiveInstance() {
 void ArchiveInstance::PostError(const PlatformResult& e, double callback_id) {
   ScopeLogger();
 
-  LoggerE("Posting an error: %d, message: %s", static_cast<int>(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 46f9675..9689622 100644 (file)
@@ -125,8 +125,8 @@ PlatformResult UnZip::listEntries(unsigned long* decompressedSize,
                                 ("ret: %d", err));
     }
 
-    LoggerD("file: %s | unc size: %lu | comp size: %lu", filename_inzip, file_info.uncompressed_size,
-            file_info.compressed_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());
     entry->setName(filename_inzip);
index 44d9d6a..c1d4998 100644 (file)
@@ -62,7 +62,8 @@ void ReportError(const PlatformException& ex, picojson::object& out) {
 }
 
 void ReportError(const PlatformResult& error, picojson::object* out) {
-  LoggerE("PlatformResult: %d, message: %s", static_cast<int>(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 77c916a..c0cd6a8 100644 (file)
 
 #include <algorithm>
 #include <functional>
+#include <limits>
 #include <map>
 #include <string>
 #include <vector>
-#include <limits>
 
 #include "common/logger.h"
 #include "common/picojson.h"
index 305dcc3..4db14bf 100644 (file)
@@ -320,11 +320,12 @@ common::PlatformResult JpegFile::generateListOfSections() {
       }
 
       if (section_offset + 2 + total_section_len > m_in_data_size) {
-        return LogAndCreateResult(ErrorCode::UNKNOWN_ERR, "JPEG file is invalid",
-                                  ("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));
+        return LogAndCreateResult(
+            ErrorCode::UNKNOWN_ERR, "JPEG file is invalid",
+            ("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));
       }
 
       if (JPEG_MARKER_APP1 == cur_marker) {
@@ -714,7 +715,8 @@ JpegFileSectionPtr JpegFile::getExifSection() {
       } else {
         LoggerW(
             "Warning: found %d APP1/Exif sections -"
-            " only first is currently supported!", num_exif_sections);
+            " only first is currently supported!",
+            num_exif_sections);
       }
     }
   }
index 70546a4..a10e0c6 100644 (file)
@@ -1119,7 +1119,6 @@ common::TizenResult IotconUtils::QueryToJson(iotcon_query_h query, picojson::obj
       auto result = ConvertIotconError(iotcon_query_foreach(
           query,
           [](const char* key, const char* value, void* user_data) -> bool {
-
             ScopeLogger("Entered into asynchronous function, iotcon_query_foreach's argument");
             if (key && value) {
               auto obj = static_cast<picojson::object*>(user_data);
index 0e05512..ef5aa08 100644 (file)
@@ -252,7 +252,6 @@ void KeyManagerInstance::SetPermission(const picojson::value& args, picojson::ob
 
   auto set_permissions = [data_name, id,
                           permissions](const std::shared_ptr<picojson::value>& response) -> void {
-
     ScopeLogger("Entered into asynchronous function, set_permissions");
     int ret = ckmc_set_permission(data_name.c_str(), id.c_str(), permissions);
 
index 9ec9ed0..7bb17c4 100644 (file)
@@ -40,8 +40,8 @@ const std::string kProgressTypeByte = "BYTE";
 typedef std::map<int, notification_text_type_e> InformationEnumMap;
 typedef std::map<int, notification_image_type_e> ImageEnumMap;
 
-typedef std::function<common::PlatformResult(const picojson::value& noti_val,
-                                             bool is_update, notification_h* noti_handle)>
+typedef std::function<common::PlatformResult(const picojson::value& noti_val, bool is_update,
+                                             notification_h* noti_handle)>
     GetHandleFromJsonFun;
 
 class CommonNotification {
index 56dd2ab..8c65220 100644 (file)
@@ -917,7 +917,6 @@ void SensorService::SensorStart(const picojson::value& args, picojson::object& o
 
   auto start = [this, type_enum, type_str,
                 start_result](const std::shared_ptr<picojson::value>& result) {
-
     ScopeLogger("Entered into asynchronous function, start");
     auto sensor_data = GetSensor(type_enum);
     if (!sensor_data) {
index 35e8043..d411091 100644 (file)
@@ -1045,11 +1045,11 @@ PlatformResult SysteminfoManager::RegisterDeviceOrientationListener() {
       sensord_register_event(GetSensorHandle(), AUTO_ROTATION_EVENT_CHANGE_STATE,
                              BASE_GATHERING_INTERVAL, 0, OnDeviceOrientationChangedCb, this);
   if (!sensor_ret) {
-    SysteminfoUtils::UnregisterVconfCallback(
-        VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, OnDeviceAutoRotationChangedCb);
-    return LogAndCreateResult(
-        ErrorCode::UNKNOWN_ERR, "Failed to register orientation change event listener",
-        ("sensord_register_event returned false"));
+    SysteminfoUtils::UnregisterVconfCallback(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL,
+                                             OnDeviceAutoRotationChangedCb);
+    return LogAndCreateResult(ErrorCode::UNKNOWN_ERR,
+                              "Failed to register orientation change event listener",
+                              ("sensord_register_event returned false"));
   }
 
   LoggerD("Added callback for DEVICE_ORIENTATION");
@@ -1060,11 +1060,11 @@ PlatformResult SysteminfoManager::UnregisterDeviceOrientationListener() {
   ScopeLogger();
   bool sensor_ret = sensord_unregister_event(GetSensorHandle(), AUTO_ROTATION_EVENT_CHANGE_STATE);
   if (!sensor_ret) {
-    SysteminfoUtils::UnregisterVconfCallback(
-        VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL, OnDeviceAutoRotationChangedCb);
-    return LogAndCreateResult(
-        ErrorCode::UNKNOWN_ERR, "Failed to unregister orientation change event listener",
-        ("sensord_unregister_event returned false"));
+    SysteminfoUtils::UnregisterVconfCallback(VCONFKEY_SETAPPL_AUTO_ROTATE_SCREEN_BOOL,
+                                             OnDeviceAutoRotationChangedCb);
+    return LogAndCreateResult(ErrorCode::UNKNOWN_ERR,
+                              "Failed to unregister orientation change event listener",
+                              ("sensord_unregister_event returned false"));
   }
   PlatformResult ret = PlatformResult(ErrorCode::NO_ERROR);
   CHECK_LISTENER_ERROR(SysteminfoUtils::UnregisterVconfCallback(
@@ -1223,9 +1223,8 @@ PlatformResult SysteminfoManager::UnregisterCellularNetworkListener() {
 
   // if there is no other ip-relateded listeners left, unregister
   if (!IsListenerRegistered(kPropertyIdCellularNetwork)) {
-    PlatformResult ret =
-        SysteminfoUtils::UnregisterVconfCallback(VCONFKEY_TELEPHONY_FLIGHT_MODE,
-                                                 OnCellularNetworkValueChangedCb);
+    PlatformResult ret = SysteminfoUtils::UnregisterVconfCallback(VCONFKEY_TELEPHONY_FLIGHT_MODE,
+                                                                  OnCellularNetworkValueChangedCb);
     if (ret.IsError()) {
       tapi_manager_->UnregisterCallbacks();
       if (IsIpChangeCallbackNotRegistered()) {