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

Unified Diff: runtime/vm/object.h

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/intermediate_language.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
===================================================================
--- runtime/vm/object.h (revision 38492)
+++ runtime/vm/object.h (working copy)
@@ -5,7 +5,6 @@
#ifndef VM_OBJECT_H_
#define VM_OBJECT_H_
-#include <limits>
#include "include/dart_api.h"
#include "platform/assert.h"
#include "platform/utils.h"
@@ -3003,9 +3002,9 @@
rec->set_pc(pc);
rec->set_kind(kind);
ASSERT(Utils::IsInt(32, deopt_id));
- rec->set_deopt_id(deopt_id);
+ rec->set_deopt_id(static_cast<int32_t>(deopt_id));
ASSERT(Utils::IsInt(32, token_pos));
- rec->set_token_pos(token_pos,
+ rec->set_token_pos(static_cast<int32_t>(token_pos),
RecordSizeInBytes() == RawPcDescriptors::kCompressedRecSize);
ASSERT(Utils::IsInt(16, try_index));
rec->set_try_index(try_index);
@@ -5078,7 +5077,7 @@
static intptr_t InstanceSize() { return 0; }
static RawSmi* New(intptr_t value) {
- word raw_smi = (value << kSmiTagShift) | kSmiTag;
+ intptr_t raw_smi = (value << kSmiTagShift) | kSmiTag;
ASSERT(ValueFromRaw(raw_smi) == value);
return reinterpret_cast<RawSmi*>(raw_smi);
}
@@ -5093,18 +5092,8 @@
return reinterpret_cast<intptr_t>(New(value));
}
- template <typename T>
- static bool IsValid(T value) {
- COMPILE_ASSERT(sizeof(kMinValue) == sizeof(kMaxValue));
- COMPILE_ASSERT(std::numeric_limits<T>::is_integer);
- if (sizeof(value) < sizeof(kMinValue)) {
- return true;
- }
-
- T min_value = std::numeric_limits<T>::is_signed
- ? static_cast<T>(kMinValue) : 0;
- return (value >= min_value)
- && (value <= static_cast<T>(kMaxValue));
+ static bool IsValid(int64_t value) {
+ return (value >= kMinValue) && (value <= kMaxValue);
}
RawInteger* ShiftOp(Token::Kind kind,
« no previous file with comments | « runtime/vm/intermediate_language.cc ('k') | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698