Fix build error 66/294466/1
authorChanggyu Choi <changyu.choi@samsung.com>
Tue, 20 Jun 2023 00:21:00 +0000 (09:21 +0900)
committerChanggyu Choi <changyu.choi@samsung.com>
Tue, 20 Jun 2023 00:21:00 +0000 (09:21 +0900)
In 64bit build system, uint64_t is mapped to unsigned long int.
Therefore, when printing uint64_t, it should be cast as unsigned long long.

Logs:
[  209s] /home/abuild/rpmbuild/BUILD/launchpad-0.34.0/src/app-defined-loader/app-defined-loader.cc: In member function 'void launchpad::loader::AppDefinedLoader::PreloadLib(tizen_base::Bundle)':
[  209s] /usr/include/dlog/dlog-internal.h:72:31: error: format '%llu' expects argument of type 'long long unsigned int', but argument 8 has type 'uint64_t' {aka 'long unsigned int'} [-Werror=format=]

Change-Id: Ia59a6f765d70040037a031a0715a7622166e19fb
Signed-off-by: Changgyu Choi <changyu.choi@samsung.com>
src/app-defined-loader/app-defined-loader.cc
src/launchpad-loader/launchpad_loader.cc

index cfef14a..8d621e1 100644 (file)
@@ -123,7 +123,9 @@ class AppDefinedLoader {
       uint64_t pss;
       launchpad::Procfs::GetPssMemory(getpid(), &pss);
       if (pss > threshold_) {
-        _W("Pss(%llu) is over threshold(%llu)", pss, threshold_);
+        _W("Pss(%llu) is over threshold(%llu)",
+            static_cast<unsigned long long>(pss),
+            static_cast<unsigned long long>(threshold_));
         break;
       }
     }
index 43a95c7..24981c0 100644 (file)
@@ -41,7 +41,7 @@ void PreloadLibraries(const tizen_base::Bundle& extra) {
 
   uint64_t mem_pss;
   launchpad::Procfs::GetPssMemory(getpid(), &mem_pss);
-  _W("PSS: %llu kB", mem_pss);
+  _W("PSS: %llu kB", static_cast<unsigned long long>(mem_pss));
   for (auto& lib : libs) {
     if (lib.empty())
       continue;
@@ -53,7 +53,8 @@ void PreloadLibraries(const tizen_base::Bundle& extra) {
     }
 
     launchpad::Procfs::GetPssMemory(getpid(), &mem_pss);
-    _W("Preload %s# - handle: %p, PSS: %llu kB", lib.c_str(), handle, mem_pss);
+    _W("Preload %s# - handle: %p, PSS: %llu kB", lib.c_str(), handle,
+        static_cast<unsigned long long>(mem_pss));
   }
 }