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/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);