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

Unified Diff: runtime/vm/object.cc

Issue 415513002: - Fix a lot of warnings generated by -Wshorten-64-to-32 (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/os.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
===================================================================
--- runtime/vm/object.cc (revision 38492)
+++ runtime/vm/object.cc (working copy)
@@ -15213,8 +15213,8 @@
ASSERT(!BigintOperations::FitsIntoInt64(big));
return big.raw();
}
- if ((value <= Smi::kMaxValue) && (value >= Smi::kMinValue)) {
- return Smi::New(value);
+ if (Smi::IsValid(value)) {
+ return Smi::New(static_cast<intptr_t>(value));
}
return Mint::NewCanonical(value);
}
@@ -15228,16 +15228,17 @@
RawInteger* Integer::New(int64_t value, Heap::Space space, const bool silent) {
- const bool is_smi = (value <= Smi::kMaxValue) && (value >= Smi::kMinValue);
+ const bool is_smi = Smi::IsValid(value);
if (!silent &&
FLAG_throw_on_javascript_int_overflow &&
!IsJavascriptInt(value)) {
- const Integer& i = is_smi ? Integer::Handle(Smi::New(value))
- : Integer::Handle(Mint::New(value));
+ const Integer& i = is_smi ?
+ Integer::Handle(Smi::New(static_cast<intptr_t>(value))) :
+ Integer::Handle(Mint::New(value));
ThrowJavascriptIntegerOverflow(i);
}
if (is_smi) {
- return Smi::New(value);
+ return Smi::New(static_cast<intptr_t>(value));
}
return Mint::New(value, space);
}
@@ -15314,7 +15315,7 @@
Mint& mint = Mint::Handle();
mint ^= raw();
if (Smi::IsValid(mint.value())) {
- return Smi::New(mint.value());
+ return Smi::New(static_cast<intptr_t>(mint.value()));
} else {
return raw();
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/os.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698