Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(341)

Unified Diff: base/histogram.cc

Issue 339059: Add compiler-specific "examine printf format" attributes to printfs. (Closed)
Patch Set: cleanups Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/histogram.cc
diff --git a/base/histogram.cc b/base/histogram.cc
index 3d2cd9e97bb28f7d7db1b9fd335e22db789b9ad5..55af96dec994bd1ff27887acfe8313140e53a541 100644
--- a/base/histogram.cc
+++ b/base/histogram.cc
@@ -124,7 +124,10 @@ void Histogram::WriteAscii(bool graph_it, const std::string& newline,
if (!current && !PrintEmptyBucket(i))
continue;
remaining -= current;
- StringAppendF(output, "%#*s ", print_width, GetAsciiBucketRange(i).c_str());
+ std::string range = GetAsciiBucketRange(i);
+ output->append(range);
+ for (size_t j = 0; range.size() + j < print_width + 1; ++j)
+ output->push_back(' ');
if (0 == current && i < bucket_count() - 1 && 0 == snapshot.counts(i + 1)) {
while (i < bucket_count() - 1 && 0 == snapshot.counts(i + 1))
++i;
@@ -287,7 +290,7 @@ void Histogram::WriteAsciiHeader(const SampleSet& snapshot,
Count sample_count,
std::string* output) const {
StringAppendF(output,
- "Histogram: %s recorded %ld samples",
+ "Histogram: %s recorded %d samples",
histogram_name().c_str(),
sample_count);
if (0 == sample_count) {

Powered by Google App Engine
This is Rietveld 408576698