Fix coding rule and supress build warning 74/160474/1
authorJunghyun Yeon <jungh.yeon@samsung.com>
Mon, 23 Oct 2017 10:07:35 +0000 (19:07 +0900)
committerJunghyun Yeon <jungh.yeon@samsung.com>
Thu, 16 Nov 2017 07:52:52 +0000 (16:52 +0900)
Change-Id: I8ca81a25867bea6d5a7955bf3e470412f349bd8b
Signed-off-by: Junghyun Yeon <jungh.yeon@samsung.com>
src/common/app2ext_dynamic_service.h
src/common/certificate_validation.cc
src/common/certificate_validation.h
src/common/paths.cc
src/common/step/pkgmgr/step_register_app.cc
src/common/step/security/step_privacy_privilege.cc
src/common/step/security/step_register_trust_anchor.h

index ea0acac..646b2f3 100644 (file)
@@ -12,7 +12,7 @@
 #include <dlfcn.h>
 
 #include <memory>
-
+#include <string>
 
 namespace common_installer {
 
index cb60490..3526af4 100644 (file)
@@ -238,7 +238,7 @@ bool ValidateSignatures(const bf::path& base_path,
   return true;
 }
 
-bool CheckPrivLevelFromFile(std::string& pkgid, PrivilegeLevel* level) {
+bool CheckPrivLevelFromFile(const std::string& pkgid, PrivilegeLevel* level) {
   CertSvcInstance instance;
   CertSvcCertificate certificate;
   CertSvcVisibility visibility = CERTSVC_VISIBILITY_DEVELOPER;
@@ -263,8 +263,8 @@ bool CheckPrivLevelFromFile(std::string& pkgid, PrivilegeLevel* level) {
     return false;
   }
   ret = certsvc_certificate_new_from_memory(instance,
-      (const unsigned char *)dist_root.c_str(),
-      strlen((char* )dist_root.c_str()),
+      reinterpret_cast<const unsigned char *>(dist_root.c_str()),
+      strlen(dist_root.c_str()),
       CERTSVC_FORM_DER_BASE64,
       &certificate);
   if (ret != CERTSVC_SUCCESS) {
index 356ce61..de5db7f 100644 (file)
@@ -41,7 +41,7 @@ bool ValidatePrivilegeLevel(common_installer::PrivilegeLevel level,
     uid_t uid, const char* api_version, GList* privileges,
     std::string* error_message);
 
-bool CheckPrivLevelFromFile(std::string& pkgid, PrivilegeLevel* level);
+bool CheckPrivLevelFromFile(const std::string& pkgid, PrivilegeLevel* level);
 
 bool ValidateMetadataPrivilege(common_installer::PrivilegeLevel level,
     const char* api_version, GList* metadata_list,
index 71733cb..32690e0 100644 (file)
@@ -30,7 +30,7 @@ boost::filesystem::path GetBackupPath(const boost::filesystem::path& pkg_path) {
   return backup_path;
 }
 
-bool DeviceSupportedCallback(int storage_id, storage_type_e type,
+bool DeviceSupportedCallback(int, storage_type_e type,
     storage_state_e state, const char* path, void* user_data) {
   if (type != STORAGE_TYPE_EXTENDED_INTERNAL)
     return true;
index 5297471..a30dbc4 100644 (file)
@@ -2,14 +2,14 @@
 
 #include "common/step/pkgmgr/step_register_app.h"
 
+#include <boost/filesystem.hpp>
+
 #include <unistd.h>
 #include <cassert>
 #include <cstring>
 #include <cstdio>
 #include <string>
 
-#include <boost/filesystem.hpp>
-
 #include "common/pkgmgr_registration.h"
 #include "common/utils/file_util.h"
 
index d588236..99b09d8 100644 (file)
@@ -6,6 +6,8 @@
 
 #include <boost/scope_exit.hpp>
 
+#include <vector>
+
 #include "common/privileges.h"
 
 namespace ci = common_installer;
@@ -14,8 +16,7 @@ namespace common_installer {
 namespace security {
 
 GList* StepPrivacyPrivilege::GetPrivilege(
-    GList* privileges, privilege_manager_package_type_e type)
-{
+    GList* privileges, privilege_manager_package_type_e type) {
   GList* privilege = NULL;
   if (type == PRVMGR_PACKAGE_TYPE_CORE)
     privilege = ci::PrivilegeXToPrivilege(privileges,
@@ -35,7 +36,7 @@ bool StepPrivacyPrivilege::SetPrivacyPrivilege(
     {PRVMGR_PACKAGE_TYPE_WRT}
   };
 
-  for (auto& type :pType) {
+  for (auto& type : pType) {
     GList *privilege = GetPrivilege(privileges, type);
     if (privilege) {
       int ret = privilege_package_info_set_privacy_privilege(uid, pkgid,
index 0822e5d..8fb898d 100644 (file)
@@ -15,8 +15,8 @@ namespace security {
 class StepRegisterTrustAnchor : public Step {
  public:
   enum class RegisterType {
-    INSTALL, // Register trust anchor with new package
-    UPDATE   // Update trust anchor with existing package
+    INSTALL,  // Register trust anchor with new package
+    UPDATE    // Update trust anchor with existing package
   };
 
   explicit StepRegisterTrustAnchor(common_installer::InstallerContext* context,