Fix log function for potential overflow
On LP64 system, unsigned long can be 64bit
Also clean out unused static variables.
Test: flash on ARM64 device
Bug: 32181382
Change-Id: Ib91f157b7852cc98d0e4b8d914785ce5162303d8
diff --git a/IPCThreadState.cpp b/IPCThreadState.cpp
index 1437e5c..d3bc70d 100644
--- a/IPCThreadState.cpp
+++ b/IPCThreadState.cpp
@@ -66,10 +66,6 @@
namespace android {
namespace hardware {
-static const char* getReturnString(size_t idx);
-static const void* printReturnCommand(TextOutput& out, const void* _cmd);
-static const void* printCommand(TextOutput& out, const void* _cmd);
-
// Static const and functions will be optimized out if not used,
// when LOG_NDEBUG and references in IF_LOG_COMMANDS() are optimized out.
static const char *kReturnStrings[] = {
@@ -528,8 +524,8 @@
}
} while (result != -ECONNREFUSED && result != -EBADF);
- LOG_THREADPOOL("**** THREAD %p (PID %d) IS LEAVING THE THREAD POOL err=%p\n",
- (void*)pthread_self(), getpid(), (void*)result);
+ LOG_THREADPOOL("**** THREAD %p (PID %d) IS LEAVING THE THREAD POOL err=%d\n",
+ (void*)pthread_self(), getpid(), result);
mOut.writeInt32(BC_EXIT_LOOPER);
talkWithDriver(false);