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

Unified Diff: runtime/bin/file.cc

Issue 63363010: Add support for working with large files, in dart:io. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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: runtime/bin/file.cc
diff --git a/runtime/bin/file.cc b/runtime/bin/file.cc
index 71e5325ea402858412272bf1ce7a29f9caece8a8..f0205fb8b5275af344212bbdd5feae9787cf7353 100644
--- a/runtime/bin/file.cc
+++ b/runtime/bin/file.cc
@@ -334,7 +334,7 @@ void FUNCTION_NAME(File_Truncate)(Dart_NativeArguments args) {
void FUNCTION_NAME(File_Length)(Dart_NativeArguments args) {
File* file = GetFilePointer(Dart_GetNativeArgument(args, 0));
ASSERT(file != NULL);
- intptr_t return_value = file->Length();
+ off64_t return_value = file->Length();
if (return_value >= 0) {
Dart_SetReturnValue(args, Dart_NewInteger(return_value));
} else {
@@ -348,7 +348,7 @@ void FUNCTION_NAME(File_Length)(Dart_NativeArguments args) {
void FUNCTION_NAME(File_LengthFromPath)(Dart_NativeArguments args) {
const char* path =
DartUtils::GetStringValue(Dart_GetNativeArgument(args, 0));
- intptr_t return_value = File::LengthFromPath(path);
+ off64_t return_value = File::LengthFromPath(path);
if (return_value >= 0) {
Dart_SetReturnValue(args, Dart_NewInteger(return_value));
} else {
@@ -760,7 +760,7 @@ CObject* File::SetPositionRequest(const CObjectArray& request) {
File* file = CObjectToFilePointer(request[0]);
ASSERT(file != NULL);
if (!file->IsClosed()) {
- int64_t position = CObjectInt32OrInt64ToInt64(request[1]);
+ off64_t position = CObjectInt32OrInt64ToInt64(request[1]);
if (file->SetPosition(position)) {
return CObject::True();
} else {
@@ -800,7 +800,7 @@ CObject* File::LengthRequest(const CObjectArray& request) {
File* file = CObjectToFilePointer(request[0]);
ASSERT(file != NULL);
if (!file->IsClosed()) {
- off_t return_value = file->Length();
+ off64_t return_value = file->Length();
if (return_value >= 0) {
return new CObjectInt64(CObject::NewInt64(return_value));
} else {
@@ -817,7 +817,7 @@ CObject* File::LengthRequest(const CObjectArray& request) {
CObject* File::LengthFromPathRequest(const CObjectArray& request) {
if (request.Length() == 1 && request[0]->IsString()) {
CObjectString filepath(request[0]);
- off_t return_value = File::LengthFromPath(filepath.CString());
+ off64_t return_value = File::LengthFromPath(filepath.CString());
if (return_value >= 0) {
return new CObjectInt64(CObject::NewInt64(return_value));
} else {
« no previous file with comments | « runtime/bin/file.h ('k') | runtime/bin/file_android.cc » ('j') | runtime/bin/file_android.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698