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

Unified Diff: runtime/bin/dartutils.cc

Issue 11414293: Fix a number of int type issues in dart:io File implementation to avoid implicit conversions that c… (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years 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/bin/dartutils.h ('k') | runtime/bin/file.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/bin/dartutils.cc
diff --git a/runtime/bin/dartutils.cc b/runtime/bin/dartutils.cc
index f185437479360de525c7ab9d4407920311fe8c6b..309b5dfdf8f90ffe6e5307cb2f6d9110136de766 100644
--- a/runtime/bin/dartutils.cc
+++ b/runtime/bin/dartutils.cc
@@ -65,6 +65,15 @@ int64_t DartUtils::GetIntegerValue(Dart_Handle value_obj) {
}
+intptr_t DartUtils::GetIntptrValue(Dart_Handle value_obj) {
+ ASSERT(Dart_IsInteger(value_obj));
+ int64_t value = 0;
+ Dart_Handle result = Dart_IntegerToInt64(value_obj, &value);
+ ASSERT(!Dart_IsError(result));
+ return static_cast<intptr_t>(value);
+}
+
+
bool DartUtils::GetInt64Value(Dart_Handle value_obj, int64_t* value) {
bool valid = Dart_IsInteger(value_obj);
if (valid) {
@@ -644,7 +653,7 @@ Dart_CObject* CObject::NewUint8Array(int length) {
}
-Dart_CObject* CObject::NewExternalUint8Array(int length,
+Dart_CObject* CObject::NewExternalUint8Array(int64_t length,
uint8_t* data,
void* peer,
Dart_PeerFinalizer callback) {
« no previous file with comments | « runtime/bin/dartutils.h ('k') | runtime/bin/file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698