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

Unified Diff: runtime/lib/byte_array.cc

Issue 10869063: Add attributions so printf like functions can have their arguments checked. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebased Created 8 years, 3 months 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
« no previous file with comments | « runtime/lib/array.cc ('k') | runtime/platform/assert.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/byte_array.cc
diff --git a/runtime/lib/byte_array.cc b/runtime/lib/byte_array.cc
index 6af0956ad25a82585944c661e57903b9c26701e7..bda6fd1c5cdd0f9acd8742fee7dd5d978dc0e580 100644
--- a/runtime/lib/byte_array.cc
+++ b/runtime/lib/byte_array.cc
@@ -21,7 +21,7 @@ static void RangeCheck(const ByteArray& array,
intptr_t num_bytes) {
if (!Utils::RangeCheck(index, num_bytes, array.ByteLength())) {
const String& error = String::Handle(String::NewFormatted(
- "index (%ld) must be in the range [0..%ld)",
+ "index (%"Pd") must be in the range [0..%"Pd")",
index, (array.ByteLength() / num_bytes)));
GrowableArray<const Object*> args;
args.Add(&error);
@@ -35,7 +35,7 @@ static void RangeCheck(const ByteArray& array,
static void LengthCheck(intptr_t len, intptr_t max) {
if (len < 0 || len > max) {
const String& error = String::Handle(String::NewFormatted(
- "length (%ld) must be in the range [0..%ld]", len, max));
+ "length (%"Pd") must be in the range [0..%"Pd"]", len, max));
GrowableArray<const Object*> args;
args.Add(&error);
Exceptions::ThrowByType(Exceptions::kIllegalArgument, args);
@@ -263,7 +263,7 @@ DEFINE_NATIVE_ENTRY(ByteArray_setRange, 5) {
intptr_t dst_start_value = dst_start.Value();
if (length_value < 0) {
const String& error = String::Handle(String::NewFormatted(
- "length (%ld) must be non-negative", length_value));
+ "length (%"Pd") must be non-negative", length_value));
GrowableArray<const Object*> args;
args.Add(&error);
Exceptions::ThrowByType(Exceptions::kIllegalArgument, args);
« no previous file with comments | « runtime/lib/array.cc ('k') | runtime/platform/assert.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698