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

Side by Side Diff: samples/lineprocessor.cc

Issue 10536202: Fix a bunch of implicit casts detected by the Win64 compiler (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: fixed casts in d8.cc, updated copyright years Created 8 years, 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « preparser/preparser-process.cc ('k') | samples/process.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 FILE* file = fopen(name, "rb"); 340 FILE* file = fopen(name, "rb");
341 if (file == NULL) return v8::Handle<v8::String>(); 341 if (file == NULL) return v8::Handle<v8::String>();
342 342
343 fseek(file, 0, SEEK_END); 343 fseek(file, 0, SEEK_END);
344 int size = ftell(file); 344 int size = ftell(file);
345 rewind(file); 345 rewind(file);
346 346
347 char* chars = new char[size + 1]; 347 char* chars = new char[size + 1];
348 chars[size] = '\0'; 348 chars[size] = '\0';
349 for (int i = 0; i < size;) { 349 for (int i = 0; i < size;) {
350 int read = fread(&chars[i], 1, size - i, file); 350 int read = static_cast<int>(fread(&chars[i], 1, size - i, file));
351 i += read; 351 i += read;
352 } 352 }
353 fclose(file); 353 fclose(file);
354 v8::Handle<v8::String> result = v8::String::New(chars, size); 354 v8::Handle<v8::String> result = v8::String::New(chars, size);
355 delete[] chars; 355 delete[] chars;
356 return result; 356 return result;
357 } 357 }
358 358
359 359
360 void ReportException(v8::TryCatch* try_catch) { 360 void ReportException(v8::TryCatch* try_catch) {
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
438 } 438 }
439 // Remove newline char 439 // Remove newline char
440 for (char* pos = buffer; *pos != '\0'; pos++) { 440 for (char* pos = buffer; *pos != '\0'; pos++) {
441 if (*pos == '\n') { 441 if (*pos == '\n') {
442 *pos = '\0'; 442 *pos = '\0';
443 break; 443 break;
444 } 444 }
445 } 445 }
446 return v8::String::New(buffer); 446 return v8::String::New(buffer);
447 } 447 }
OLDNEW
« no previous file with comments | « preparser/preparser-process.cc ('k') | samples/process.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698