From a459d0b0e28d2e7026d9bb9f6e123de3768dfb51 Mon Sep 17 00:00:00 2001 From: Mark Salyzyn Date: Thu, 20 Mar 2014 13:02:57 -0700 Subject: cutils: trace 64-bit compile issues - switch format to PRId64 for int64_t - switch format to PRId32 for int32_t Change-Id: I1e66db06810000936d584ed49234550abd96cdff --- include/cutils/trace.h | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/cutils/trace.h b/include/cutils/trace.h index 1c8f107..dbd5e25 100644 --- a/include/cutils/trace.h +++ b/include/cutils/trace.h @@ -17,13 +17,14 @@ #ifndef _LIBS_CUTILS_TRACE_H #define _LIBS_CUTILS_TRACE_H +#include +#include +#include #include #include -#include -#include #include -#include +#include #ifdef ANDROID_SMP #include #else @@ -217,8 +218,8 @@ static inline void atrace_async_begin(uint64_t tag, const char* name, char buf[ATRACE_MESSAGE_LENGTH]; size_t len; - len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "S|%d|%s|%d", getpid(), - name, cookie); + len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "S|%d|%s|%" PRId32, + getpid(), name, cookie); write(atrace_marker_fd, buf, len); } } @@ -235,8 +236,8 @@ static inline void atrace_async_end(uint64_t tag, const char* name, char buf[ATRACE_MESSAGE_LENGTH]; size_t len; - len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "F|%d|%s|%d", getpid(), - name, cookie); + len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "F|%d|%s|%" PRId32, + getpid(), name, cookie); write(atrace_marker_fd, buf, len); } } @@ -253,7 +254,7 @@ static inline void atrace_int(uint64_t tag, const char* name, int32_t value) char buf[ATRACE_MESSAGE_LENGTH]; size_t len; - len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "C|%d|%s|%d", + len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "C|%d|%s|%" PRId32, getpid(), name, value); write(atrace_marker_fd, buf, len); } @@ -270,7 +271,7 @@ static inline void atrace_int64(uint64_t tag, const char* name, int64_t value) char buf[ATRACE_MESSAGE_LENGTH]; size_t len; - len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "C|%d|%s|%lld", + len = snprintf(buf, ATRACE_MESSAGE_LENGTH, "C|%d|%s|%" PRId64, getpid(), name, value); write(atrace_marker_fd, buf, len); } -- cgit v1.1