From 8ff519862c64aac94757ef13ce9a07e2896eb01e Mon Sep 17 00:00:00 2001 From: Szymon Jastrzebski Date: Mon, 6 Nov 2017 08:39:40 +0100 Subject: [PATCH] [Project] Fixing formatting + errors found by cpplint [Verification] Code compiles Change-Id: I9a501c568d7da8348284977ec5d1f58837170e70 --- src/archive/archive_file.cc | 3 ++- src/archive/archive_instance.cc | 3 ++- src/archive/un_zip.cc | 4 ++-- src/common/tools.cc | 3 ++- src/datacontrol/datacontrol_instance.cc | 2 +- src/exif/jpeg_file.cc | 14 ++++++++------ src/iotcon/iotcon_utils.cc | 1 - src/keymanager/keymanager_instance.cc | 1 - src/notification/common_notification.h | 4 ++-- src/sensor/sensor_service.cc | 1 - src/systeminfo/systeminfo_manager.cc | 25 ++++++++++++------------- 11 files changed, 31 insertions(+), 30 deletions(-) diff --git a/src/archive/archive_file.cc b/src/archive/archive_file.cc index 98df4f9c..0f911990 100644 --- a/src/archive/archive_file.cc +++ b/src/archive/archive_file.cc @@ -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(result.error_code()), result.message().c_str()); + LoggerE("taskManagerThread fails, %d: %s", static_cast(result.error_code()), + result.message().c_str()); callback->setError(result.error_code(), result.message().c_str()); if (!g_idle_add(callErrorCallback, static_cast(callback))) { LoggerE("g_idle_add fails"); diff --git a/src/archive/archive_instance.cc b/src/archive/archive_instance.cc index 77a2239f..ae2745cb 100644 --- a/src/archive/archive_instance.cc +++ b/src/archive/archive_instance.cc @@ -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(e.error_code()), e.message().c_str()); + LoggerE("Posting an error: %d, message: %s", static_cast(e.error_code()), + e.message().c_str()); picojson::value val = picojson::value(picojson::object()); picojson::object& obj = val.get(); diff --git a/src/archive/un_zip.cc b/src/archive/un_zip.cc index 46f96758..9689622f 100644 --- a/src/archive/un_zip.cc +++ b/src/archive/un_zip.cc @@ -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); diff --git a/src/common/tools.cc b/src/common/tools.cc index 44d9d6ab..c1d49984 100644 --- a/src/common/tools.cc +++ b/src/common/tools.cc @@ -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(error.error_code()), error.message().c_str()); + LoggerE("PlatformResult: %d, message: %s", static_cast(error.error_code()), + error.message().c_str()); out->insert(std::make_pair("status", picojson::value("error"))); out->insert(std::make_pair("error", error.ToJSON())); } diff --git a/src/datacontrol/datacontrol_instance.cc b/src/datacontrol/datacontrol_instance.cc index 77c916ae..c0cd6a81 100644 --- a/src/datacontrol/datacontrol_instance.cc +++ b/src/datacontrol/datacontrol_instance.cc @@ -20,10 +20,10 @@ #include #include +#include #include #include #include -#include #include "common/logger.h" #include "common/picojson.h" diff --git a/src/exif/jpeg_file.cc b/src/exif/jpeg_file.cc index 305dcc3f..4db14bfe 100644 --- a/src/exif/jpeg_file.cc +++ b/src/exif/jpeg_file.cc @@ -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); } } } diff --git a/src/iotcon/iotcon_utils.cc b/src/iotcon/iotcon_utils.cc index 70546a4e..a10e0c6c 100644 --- a/src/iotcon/iotcon_utils.cc +++ b/src/iotcon/iotcon_utils.cc @@ -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(user_data); diff --git a/src/keymanager/keymanager_instance.cc b/src/keymanager/keymanager_instance.cc index 0e055122..ef5aa08a 100644 --- a/src/keymanager/keymanager_instance.cc +++ b/src/keymanager/keymanager_instance.cc @@ -252,7 +252,6 @@ void KeyManagerInstance::SetPermission(const picojson::value& args, picojson::ob auto set_permissions = [data_name, id, permissions](const std::shared_ptr& response) -> void { - ScopeLogger("Entered into asynchronous function, set_permissions"); int ret = ckmc_set_permission(data_name.c_str(), id.c_str(), permissions); diff --git a/src/notification/common_notification.h b/src/notification/common_notification.h index 9ec9ed0f..7bb17c42 100644 --- a/src/notification/common_notification.h +++ b/src/notification/common_notification.h @@ -40,8 +40,8 @@ const std::string kProgressTypeByte = "BYTE"; typedef std::map InformationEnumMap; typedef std::map ImageEnumMap; -typedef std::function +typedef std::function GetHandleFromJsonFun; class CommonNotification { diff --git a/src/sensor/sensor_service.cc b/src/sensor/sensor_service.cc index 56dd2abe..8c652201 100644 --- a/src/sensor/sensor_service.cc +++ b/src/sensor/sensor_service.cc @@ -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& result) { - ScopeLogger("Entered into asynchronous function, start"); auto sensor_data = GetSensor(type_enum); if (!sensor_data) { diff --git a/src/systeminfo/systeminfo_manager.cc b/src/systeminfo/systeminfo_manager.cc index 35e80435..d4110918 100644 --- a/src/systeminfo/systeminfo_manager.cc +++ b/src/systeminfo/systeminfo_manager.cc @@ -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()) { -- 2.34.1