Perform code style checking fixes 86/143786/2
authorBartlomiej Kunikowski <b.kunikowski@partner.samsung.com>
Fri, 11 Aug 2017 08:42:09 +0000 (10:42 +0200)
committerBartlomiej Kunikowski <b.kunikowski@partner.samsung.com>
Fri, 11 Aug 2017 08:45:15 +0000 (10:45 +0200)
Change-Id: I72e8d7149aa46e028851f77f04c1b8b301bb675d

src/common/pkgmgr_interface.cc
src/common/request.cc
src/common/security_registration.cc
src/common/step/configuration/step_switch_readonly_mode.cc
src/common/step/filesystem/step_move_installed_storage.cc
src/common/utils/file_util.cc

index 24f5234..a62ae64 100644 (file)
@@ -20,7 +20,6 @@
 #include "common/utils/file_util.h"
 #include "common/utils/manifest_util.h"
 #include "common/utils/user_util.h"
-#include "pkgmgr_registration.h"
 
 namespace bf = boost::filesystem;
 namespace ci = common_installer;
index 848740e..5fec4b5 100644 (file)
@@ -3,10 +3,12 @@
 // found in the LICENSE file.
 
 #include "common/request.h"
-#include "common/utils/user_util.h"
+
 #include <tzplatform_config.h>
 #include <unistd.h>
 
+#include "common/utils/user_util.h"
+
 namespace bf = boost::filesystem;
 
 namespace common_installer {
index 35a430c..c936096 100644 (file)
@@ -361,14 +361,14 @@ bool UnregisterSecurityContext(const std::string& app_id,
 }
 
 void PrepareAppDefinedPrivilegeData(GList *privileges,
-    AppDefinedPrivInfo& tpk_priv_vec, AppDefinedPrivInfo& wgt_priv_vec) {
+    AppDefinedPrivInfo* tpk_priv_vec, AppDefinedPrivInfo* wgt_priv_vec) {
 
   for (auto& priv : GListRange<appdefined_privilege_x*>(privileges)) {
     if (strcmp(priv->type, kWebPrivilegeType) == 0)
-      wgt_priv_vec.emplace_back(std::make_pair(priv->value, priv->license ?
+      wgt_priv_vec->emplace_back(std::make_pair(priv->value, priv->license ?
           priv->license : std::string()));
     else
-      tpk_priv_vec.emplace_back(std::make_pair(priv->value, priv->license ?
+      tpk_priv_vec->emplace_back(std::make_pair(priv->value, priv->license ?
           priv->license : std::string()));
   }
 }
@@ -393,9 +393,9 @@ bool RegisterSecurityContextForManifest(
   AppDefinedPrivInfo tpk_provides_appdef_vec, wgt_provides_appdef_vec;
 
   PrepareAppDefinedPrivilegeData(manifest->appdefined_privileges,
-      tpk_appdef_vec, wgt_appdef_vec);
+      &tpk_appdef_vec, &wgt_appdef_vec);
   PrepareAppDefinedPrivilegeData(manifest->provides_appdefined_privileges,
-      tpk_provides_appdef_vec, wgt_provides_appdef_vec);
+      &tpk_provides_appdef_vec, &wgt_provides_appdef_vec);
 
   for (application_x* app : GListRange<application_x*>(manifest->application)) {
     if (!app->appid) {
index dd4f0bc..286e621 100644 (file)
@@ -4,6 +4,8 @@
 
 #include "common/step/configuration/step_switch_readonly_mode.h"
 
+#include <string>
+
 namespace common_installer {
 namespace configuration {
 
index f0fb8b7..6499275 100644 (file)
@@ -90,8 +90,8 @@ void StepMoveInstalledStorage::SetTepPaths() {
                                        context_->uid.get());
     new_tep_location_ /= old_tep_location_.filename();
   } else {
-    new_tep_location_ =
-        GetInternalTepPath(context_->pkg_path.get()) / old_tep_location_.filename();
+    new_tep_location_ = GetInternalTepPath(context_->pkg_path.get()) /
+        old_tep_location_.filename();
   }
 }
 
index f9a70b7..93a6374 100644 (file)
@@ -175,7 +175,7 @@ bool SetDirOwnershipAndPermissions(const boost::filesystem::path& path,
 
 bool CopyOwnershipAndPermissions(const boost::filesystem::path& src,
                                  const boost::filesystem::path& dst) {
-  if(!bf::exists(src)) {
+  if (!bf::exists(src)) {
     LOG(ERROR) << "Failed to copy ownership and permissions"
                << " from " << src << " to " << dst;
     return false;
@@ -183,7 +183,7 @@ bool CopyOwnershipAndPermissions(const boost::filesystem::path& src,
   bf::perms permissions = bf::status(src).permissions();
   struct stat stats;
   stat(src.c_str(), &stats);
-  if(!SetDirOwnershipAndPermissions(dst, permissions, stats.st_uid,
+  if (!SetDirOwnershipAndPermissions(dst, permissions, stats.st_uid,
                                     stats.st_gid)) {
     LOG(ERROR) << "Failed to copy ownership and permissions"
                << " from " << src << " to " << dst;