diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 06:53:28 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 06:53:28 +0000 |
commit | 34b2b007db875a6acb853c5cd2a247fbb32c0f88 (patch) | |
tree | 6dc39bc9f10d6e8eedcdf14821ba9e96b5ccab51 /base/tracked_objects.cc | |
parent | 24b857793e27aded8d804a112a5fe6c77e28b081 (diff) | |
download | chromium_src-34b2b007db875a6acb853c5cd2a247fbb32c0f88.zip chromium_src-34b2b007db875a6acb853c5cd2a247fbb32c0f88.tar.gz chromium_src-34b2b007db875a6acb853c5cd2a247fbb32c0f88.tar.bz2 |
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
Diffstat (limited to 'base/tracked_objects.cc')
-rw-r--r-- | base/tracked_objects.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/base/tracked_objects.cc b/base/tracked_objects.cc index 1e7d293..0d68703 100644 --- a/base/tracked_objects.cc +++ b/base/tracked_objects.cc @@ -6,6 +6,7 @@ #include <math.h> +#include "base/format_macros.h" #include "base/message_loop.h" #include "base/string_util.h" @@ -551,22 +552,23 @@ void Aggregation::Write(std::string* output) const { if (locations_.size() == 1) { locations_.begin()->first.Write(true, true, output); } else { - StringAppendF(output, "%d Locations. ", locations_.size()); + StringAppendF(output, "%" PRIuS " Locations. ", locations_.size()); if (birth_files_.size() > 1) - StringAppendF(output, "%d Files. ", birth_files_.size()); + StringAppendF(output, "%" PRIuS " Files. ", birth_files_.size()); else StringAppendF(output, "All born in %s. ", birth_files_.begin()->first.c_str()); } if (birth_threads_.size() > 1) - StringAppendF(output, "%d BirthingThreads. ", birth_threads_.size()); + StringAppendF(output, "%" PRIuS " BirthingThreads. ", + birth_threads_.size()); else StringAppendF(output, "All born on %s. ", birth_threads_.begin()->first->ThreadName().c_str()); if (death_threads_.size() > 1) { - StringAppendF(output, "%d DeathThreads. ", death_threads_.size()); + StringAppendF(output, "%" PRIuS " DeathThreads. ", death_threads_.size()); } else { if (death_threads_.begin()->first) StringAppendF(output, "All deleted on %s. ", |