summaryrefslogtreecommitdiffstats
path: root/liblog
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2012-02-27 16:48:18 -0800
committerAndrew Hsieh <andrewhsieh@google.com>2012-02-29 17:00:46 -0800
commitd2c8f52189f8c2a13b88a107c6495f9d83196d2d (patch)
tree2175cb5d16e0e2bc9970ae336f8be94a33c8bb09 /liblog
parentc958a7f4988f3dd98135b23619cdf55ec55bd1f6 (diff)
downloadsystem_core-d2c8f52189f8c2a13b88a107c6495f9d83196d2d.zip
system_core-d2c8f52189f8c2a13b88a107c6495f9d83196d2d.tar.gz
system_core-d2c8f52189f8c2a13b88a107c6495f9d83196d2d.tar.bz2
Fixed two 64-bit porting issues; Make pid/tid type consistent
1. In printf, use "%zu" for variable of type size_t 2. Print tid in %5d 3. Make type of pid/tid in AndroidLogEntry and logger_entry consistent Change-Id: I3e3d9536ee58823f349a4734ae093d30eabe1bfe
Diffstat (limited to 'liblog')
-rw-r--r--liblog/fake_log_device.c6
-rw-r--r--liblog/logprint.c10
2 files changed, 8 insertions, 8 deletions
diff --git a/liblog/fake_log_device.c b/liblog/fake_log_device.c
index f8b7254..df43299 100644
--- a/liblog/fake_log_device.c
+++ b/liblog/fake_log_device.c
@@ -398,7 +398,7 @@ static void showLog(LogState *state,
break;
case FORMAT_THREAD:
prefixLen = snprintf(prefixBuf, sizeof(prefixBuf),
- "%c(%5d:%p) ", priChar, pid, (void*)tid);
+ "%c(%5d:%5d) ", priChar, pid, tid);
strcpy(suffixBuf, "\n"); suffixLen = 1;
break;
case FORMAT_RAW:
@@ -417,8 +417,8 @@ static void showLog(LogState *state,
break;
case FORMAT_LONG:
prefixLen = snprintf(prefixBuf, sizeof(prefixBuf),
- "[ %s %5d:%p %c/%-8s ]\n",
- timeBuf, pid, (void*)tid, priChar, tag);
+ "[ %s %5d:%5d %c/%-8s ]\n",
+ timeBuf, pid, tid, priChar, tag);
strcpy(suffixBuf, "\n\n"); suffixLen = 2;
break;
default:
diff --git a/liblog/logprint.c b/liblog/logprint.c
index 8366c94..6fac84b 100644
--- a/liblog/logprint.c
+++ b/liblog/logprint.c
@@ -673,7 +673,7 @@ int android_log_processBinaryLogBuffer(struct logger_entry *buf,
if (inCount != 0) {
fprintf(stderr,
- "Warning: leftover binary log data (%d bytes)\n", inCount);
+ "Warning: leftover binary log data (%zu bytes)\n", inCount);
}
/*
@@ -753,7 +753,7 @@ char *android_log_formatLogLine (
break;
case FORMAT_THREAD:
prefixLen = snprintf(prefixBuf, sizeof(prefixBuf),
- "%c(%5d:%p) ", priChar, entry->pid, (void*)entry->tid);
+ "%c(%5d:%5d) ", priChar, entry->pid, entry->tid);
strcpy(suffixBuf, "\n");
suffixLen = 1;
break;
@@ -773,15 +773,15 @@ char *android_log_formatLogLine (
case FORMAT_THREADTIME:
prefixLen = snprintf(prefixBuf, sizeof(prefixBuf),
"%s.%03ld %5d %5d %c %-8s: ", timeBuf, entry->tv_nsec / 1000000,
- (int)entry->pid, (int)entry->tid, priChar, entry->tag);
+ entry->pid, entry->tid, priChar, entry->tag);
strcpy(suffixBuf, "\n");
suffixLen = 1;
break;
case FORMAT_LONG:
prefixLen = snprintf(prefixBuf, sizeof(prefixBuf),
- "[ %s.%03ld %5d:%p %c/%-8s ]\n",
+ "[ %s.%03ld %5d:%5d %c/%-8s ]\n",
timeBuf, entry->tv_nsec / 1000000, entry->pid,
- (void*)entry->tid, priChar, entry->tag);
+ entry->tid, priChar, entry->tag);
strcpy(suffixBuf, "\n\n");
suffixLen = 2;
prefixSuffixIsHeaderFooter = 1;