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

Unified Diff: courgette/adjustment_method_2.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: courgette/adjustment_method_2.cc
diff --git a/courgette/adjustment_method_2.cc b/courgette/adjustment_method_2.cc
index 49fcf49a5bdd86f23746fe83446e7a43ee6fdc4d..9cb9dbd300c85af5cb1dfd66c5eff8546bade409 100644
--- a/courgette/adjustment_method_2.cc
+++ b/courgette/adjustment_method_2.cc
@@ -15,6 +15,7 @@
#include <iostream>
#include "base/basictypes.h"
+#include "base/format_macros.h"
#include "base/logging.h"
#include "base/string_util.h"
@@ -461,8 +462,8 @@ std::string ToString(const Shingle* instance) {
s += ToString(instance->at(i));
sep = ", ";
}
- StringAppendF(&s, ">(%u)@{%d}", instance->exemplar_position_,
- static_cast<int>(instance->position_count()));
+ StringAppendF(&s, ">(%" PRIuS ")@{%" PRIuS "}", instance->exemplar_position_,
+ instance->position_count());
return s;
}
@@ -578,7 +579,7 @@ std::string HistogramToString(const ShinglePattern::Histogram& histogram,
s += " ...";
break;
}
- StringAppendF(&s, " %d", p->count());
+ StringAppendF(&s, " %" PRIuS, p->count());
}
return s;
}
@@ -598,7 +599,7 @@ std::string HistogramToStringFull(const ShinglePattern::Histogram& histogram,
s += "...\n";
break;
}
- StringAppendF(&s, "(%d) ", p->count());
+ StringAppendF(&s, "(%" PRIuS ") ", p->count());
s += ToString(&(*p->instance()));
s += "\n";
}
@@ -633,9 +634,9 @@ std::string ShinglePatternToStringFull(const ShinglePattern* pattern,
s += "\n";
size_t model_size = pattern->model_histogram_.size();
size_t program_size = pattern->program_histogram_.size();
- StringAppendF(&s, " model shingles %u\n", model_size);
+ StringAppendF(&s, " model shingles %" PRIuS "\n", model_size);
s += HistogramToStringFull(pattern->model_histogram_, " ", max);
- StringAppendF(&s, " program shingles %u\n", program_size);
+ StringAppendF(&s, " program shingles %" PRIuS "\n", program_size);
s += HistogramToStringFull(pattern->program_histogram_, " ", max);
return s;
}

Powered by Google App Engine
This is Rietveld 408576698