system/core LP64 cleanup.
Fixes -Wint-to-pointer and -Wpointer-to-int warnings, plus various -Wformat
warnings.
Change-Id: I6c5eea6b4273d82d28b8e5d2925f3e5457511b17
diff --git a/liblog/tests/benchmark_main.cpp b/liblog/tests/benchmark_main.cpp
index 02df460..090394c 100644
--- a/liblog/tests/benchmark_main.cpp
+++ b/liblog/tests/benchmark_main.cpp
@@ -16,6 +16,7 @@
#include <benchmark.h>
+#include <inttypes.h>
#include <regex.h>
#include <stdio.h>
#include <stdlib.h>
@@ -158,10 +159,10 @@
sdev = (sqrt((double)nXvariance) / gBenchmarkNum / gBenchmarkNum) + 0.5;
}
if (mean > (10000 * sdev)) {
- printf("%-25s %10llu %10llu%s\n", full_name,
+ printf("%-25s %10" PRIu64 " %10" PRIu64 "%s\n", full_name,
static_cast<uint64_t>(iterations), mean, throughput);
} else {
- printf("%-25s %10llu %10llu(\317\203%llu)%s\n", full_name,
+ printf("%-25s %10" PRIu64 " %10" PRIu64 "(\317\203%" PRIu64 ")%s\n", full_name,
static_cast<uint64_t>(iterations), mean, sdev, throughput);
}
fflush(stdout);
diff --git a/liblog/tests/liblog_test.cpp b/liblog/tests/liblog_test.cpp
index 9ae8f22..d71d97a 100644
--- a/liblog/tests/liblog_test.cpp
+++ b/liblog/tests/liblog_test.cpp
@@ -15,6 +15,7 @@
*/
#include <fcntl.h>
+#include <inttypes.h>
#include <signal.h>
#include <gtest/gtest.h>
#include <log/log.h>
@@ -85,8 +86,8 @@
static void* ConcurrentPrintFn(void *arg) {
int ret = __android_log_buf_print(LOG_ID_MAIN, ANDROID_LOG_INFO,
- "TEST__android_log_print", "Concurrent %d",
- reinterpret_cast<int>(arg));
+ "TEST__android_log_print", "Concurrent %" PRIuPTR,
+ reinterpret_cast<uintptr_t>(arg));
return reinterpret_cast<void*>(ret);
}
@@ -106,8 +107,9 @@
for (i=0; i < NUM_CONCURRENT; i++) {
void* result;
ASSERT_EQ(0, pthread_join(t[i], &result));
- if ((0 == ret) && (0 != reinterpret_cast<int>(result))) {
- ret = reinterpret_cast<int>(result);
+ int this_result = reinterpret_cast<uintptr_t>(result);
+ if ((0 == ret) && (0 != this_result)) {
+ ret = this_result;
}
}
ASSERT_LT(0, ret);