apply c++ type cast 90/83190/2 accepted/tizen/common/20160809.183948 accepted/tizen/ivi/20160809.232613 accepted/tizen/mobile/20160809.232352 accepted/tizen/tv/20160809.232502 accepted/tizen/wearable/20160809.232708 submit/tizen/20160809.051427
authorjongmyeongko <jongmyeong.ko@samsung.com>
Tue, 9 Aug 2016 10:20:08 +0000 (19:20 +0900)
committerjongmyeongko <jongmyeong.ko@samsung.com>
Tue, 9 Aug 2016 10:35:30 +0000 (19:35 +0900)
Change-Id: I60f3b97fc586457a2e45cb544a759502ae17a8f0
Signed-off-by: jongmyeongko <jongmyeong.ko@samsung.com>
src/common/shared_dirs.cc

index 499cc6c..ec4c6f9 100644 (file)
@@ -318,7 +318,7 @@ bool PerformExternalDirectoryCreationForAllUsers(const std::string& pkgid) {
 }
 
 int PrivilegeCallback(const pkgmgrinfo_pkginfo_h handle, void* user_data) {
-  uid_t uid = (uid_t)(uintptr_t)user_data;
+  uid_t uid = static_cast<uid_t>(reinterpret_cast<uintptr_t>(user_data));
   char* pkgid = nullptr;
 
   int ret = pkgmgrinfo_pkginfo_get_pkgid(handle, &pkgid);
@@ -346,7 +346,8 @@ bool PerformExternalDirectoryCreationForAllPkgs() {
     }
 
     ret = pkgmgrinfo_pkginfo_filter_foreach_pkginfo(filter_handle,
-        PrivilegeCallback, reinterpret_cast<void*>((uintptr_t)uid));
+        PrivilegeCallback,
+        reinterpret_cast<void*>(static_cast<uintptr_t>(uid)));
     if (ret != PMINFO_R_OK) {
       LOG(DEBUG) << "Failed to create external directoy";
       pkgmgrinfo_pkginfo_filter_destroy(filter_handle);