From 34b2b007db875a6acb853c5cd2a247fbb32c0f88 Mon Sep 17 00:00:00 2001 From: "evan@chromium.org" Date: Fri, 20 Nov 2009 06:53:28 +0000 Subject: Add compiler-specific "examine printf format" attributes to printfs. Functions that take a printf-style format get a new annotation, which produces a bunch of compiler warnings when you use printf impoperly. This change adds the annotations and fixes the warnings. We now must use PRId64 for 64-bit numbers and the PRIsz for size_t. Review URL: http://codereview.chromium.org/339059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32600 0039d316-1c4b-4281-b951-d872f2087c98 --- base/trace_event.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'base/trace_event.cc') diff --git a/base/trace_event.cc b/base/trace_event.cc index be2fbaa..13c0c2c 100644 --- a/base/trace_event.cc +++ b/base/trace_event.cc @@ -133,10 +133,10 @@ void TraceLog::Trace(const std::string& name, int64 usec = delta.InMicroseconds(); std::string msg = StringPrintf("{'pid':'0x%lx', 'tid':'0x%lx', 'type':'%s', " - "'name':'%s', 'id':'0x%lx', 'extra':'%s', 'file':'%s', " + "'name':'%s', 'id':'%p', 'extra':'%s', 'file':'%s', " "'line_number':'%d', 'usec_begin': %" PRId64 "},\n", - base::GetCurrentProcId(), - PlatformThread::CurrentId(), + static_cast(base::GetCurrentProcId()), + static_cast(PlatformThread::CurrentId()), kEventTypeNames[type], name.c_str(), id, -- cgit v1.1