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

Side by Side Diff: src/utils.cc

Issue 1111733002: [clang] Use -Wshorten-64-to-32 to enable warnings about 64bit to 32bit truncations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix Win warnings. Created 5 years, 7 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
« no previous file with comments | « src/snapshot/mksnapshot.cc ('k') | test/cctest/compiler/call-tester.h » ('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 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stdarg.h> 5 #include <stdarg.h>
6 #include <sys/stat.h> 6 #include <sys/stat.h>
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/base/functional.h" 10 #include "src/base/functional.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 bool verbose, 196 bool verbose,
197 const char* filename) { 197 const char* filename) {
198 if (file == NULL || fseek(file, 0, SEEK_END) != 0) { 198 if (file == NULL || fseek(file, 0, SEEK_END) != 0) {
199 if (verbose) { 199 if (verbose) {
200 base::OS::PrintError("Cannot read from file %s.\n", filename); 200 base::OS::PrintError("Cannot read from file %s.\n", filename);
201 } 201 }
202 return NULL; 202 return NULL;
203 } 203 }
204 204
205 // Get the size of the file and rewind it. 205 // Get the size of the file and rewind it.
206 *size = ftell(file); 206 *size = static_cast<int>(ftell(file));
207 rewind(file); 207 rewind(file);
208 208
209 char* result = NewArray<char>(*size + extra_space); 209 char* result = NewArray<char>(*size + extra_space);
210 for (int i = 0; i < *size && feof(file) == 0;) { 210 for (int i = 0; i < *size && feof(file) == 0;) {
211 int read = static_cast<int>(fread(&result[i], 1, *size - i, file)); 211 int read = static_cast<int>(fread(&result[i], 1, *size - i, file));
212 if (read != (*size - i) && ferror(file) != 0) { 212 if (read != (*size - i) && ferror(file) != 0) {
213 fclose(file); 213 fclose(file);
214 DeleteArray(result); 214 DeleteArray(result);
215 return NULL; 215 return NULL;
216 } 216 }
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
420 } 420 }
421 if (u.bits.exp == 0) { 421 if (u.bits.exp == 0) {
422 // Detect +0, and -0 for IEEE double precision floating point. 422 // Detect +0, and -0 for IEEE double precision floating point.
423 if ((u.bits.man_low | u.bits.man_high) == 0) return false; 423 if ((u.bits.man_low | u.bits.man_high) == 0) return false;
424 } 424 }
425 return true; 425 return true;
426 } 426 }
427 427
428 428
429 } } // namespace v8::internal 429 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/snapshot/mksnapshot.cc ('k') | test/cctest/compiler/call-tester.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698