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

Side by Side Diff: src/flags.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, 8 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/d8-posix.cc ('k') | src/gdb-jit.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 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 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 <cctype> 5 #include <cctype>
6 #include <cstdlib> 6 #include <cstdlib>
7 #include <sstream> 7 #include <sstream>
8 8
9 #include "src/v8.h" 9 #include "src/v8.h"
10 10
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after
387 // set the flag 387 // set the flag
388 char* endp = const_cast<char*>(""); // *endp is only read 388 char* endp = const_cast<char*>(""); // *endp is only read
389 switch (flag->type()) { 389 switch (flag->type()) {
390 case Flag::TYPE_BOOL: 390 case Flag::TYPE_BOOL:
391 *flag->bool_variable() = !is_bool; 391 *flag->bool_variable() = !is_bool;
392 break; 392 break;
393 case Flag::TYPE_MAYBE_BOOL: 393 case Flag::TYPE_MAYBE_BOOL:
394 *flag->maybe_bool_variable() = MaybeBoolFlag::Create(true, !is_bool); 394 *flag->maybe_bool_variable() = MaybeBoolFlag::Create(true, !is_bool);
395 break; 395 break;
396 case Flag::TYPE_INT: 396 case Flag::TYPE_INT:
397 *flag->int_variable() = strtol(value, &endp, 10); // NOLINT 397 *flag->int_variable() = static_cast<int>(strtol(value, &endp, 10));
398 break; 398 break;
399 case Flag::TYPE_FLOAT: 399 case Flag::TYPE_FLOAT:
400 *flag->float_variable() = strtod(value, &endp); 400 *flag->float_variable() = strtod(value, &endp);
401 break; 401 break;
402 case Flag::TYPE_STRING: 402 case Flag::TYPE_STRING:
403 flag->set_string_value(value ? StrDup(value) : NULL, true); 403 flag->set_string_value(value ? StrDup(value) : NULL, true);
404 break; 404 break;
405 case Flag::TYPE_ARGS: { 405 case Flag::TYPE_ARGS: {
406 int start_pos = (value == NULL) ? i : i - 1; 406 int start_pos = (value == NULL) ? i : i - 1;
407 int js_argc = *argc - start_pos; 407 int js_argc = *argc - start_pos;
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
568 void FlagList::EnforceFlagImplications() { 568 void FlagList::EnforceFlagImplications() {
569 #define FLAG_MODE_DEFINE_IMPLICATIONS 569 #define FLAG_MODE_DEFINE_IMPLICATIONS
570 #include "src/flag-definitions.h" 570 #include "src/flag-definitions.h"
571 #undef FLAG_MODE_DEFINE_IMPLICATIONS 571 #undef FLAG_MODE_DEFINE_IMPLICATIONS
572 ComputeFlagListHash(); 572 ComputeFlagListHash();
573 } 573 }
574 574
575 575
576 uint32_t FlagList::Hash() { return flag_hash; } 576 uint32_t FlagList::Hash() { return flag_hash; }
577 } } // namespace v8::internal 577 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/d8-posix.cc ('k') | src/gdb-jit.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698