Push version 2.0.0 to trunk.
Added support for VFP on ARM.
Added TryCatch::ReThrow method to the API.
Reduced the size of snapshots and improved the snapshot load time.
Improved heap profiler support.
64-bit version now supported on Windows.
Fixed a number of debugger issues.
Fixed bugs.
git-svn-id: http://v8.googlecode.com/svn/trunk@3333 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
diff --git a/src/utils.h b/src/utils.h
index f4a0598..c271ae1 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -66,7 +66,7 @@
// integral types.
template <typename T>
static inline T AddressFrom(intptr_t x) {
- return static_cast<T>(0) + x;
+ return static_cast<T>(static_cast<T>(0) + x);
}
@@ -137,6 +137,13 @@
}
+inline int StrLength(const char* string) {
+ size_t length = strlen(string);
+ ASSERT(length == static_cast<size_t>(static_cast<int>(length)));
+ return static_cast<int>(length);
+}
+
+
// ----------------------------------------------------------------------------
// BitField is a help template for encoding and decode bitfield with
// unsigned content.
@@ -449,15 +456,15 @@
inline Vector<const char> CStrVector(const char* data) {
- return Vector<const char>(data, static_cast<int>(strlen(data)));
+ return Vector<const char>(data, StrLength(data));
}
inline Vector<char> MutableCStrVector(char* data) {
- return Vector<char>(data, static_cast<int>(strlen(data)));
+ return Vector<char>(data, StrLength(data));
}
inline Vector<char> MutableCStrVector(char* data, int max) {
- int length = static_cast<int>(strlen(data));
+ int length = StrLength(data);
return Vector<char>(data, (length < max) ? length : max);
}