freebsd-ports/lang/v8/files/patch-src-objects.h
Sunpoet Po-Chuan Hsieh 202993b050 - Fix warnings generated by recent snapshot of Clang 3.7.0, including:
- Printing non-void pointers with %p.
  - Left-shifting negative numbers.

PR:		202530
Submitted by:	dim
2015-09-20 20:17:28 +00:00

23 lines
1.0 KiB
C

--- src/objects.h.orig 2013-05-01 12:56:29 UTC
+++ src/objects.h
@@ -5573,7 +5573,7 @@ class Map: public HeapObject {
static const int kElementsKindBitCount = 5;
// Derived values from bit field 2
- static const int kElementsKindMask = (-1 << kElementsKindShift) &
+ static const int kElementsKindMask = -(1 << kElementsKindShift) &
((1 << (kElementsKindShift + kElementsKindBitCount)) - 1);
static const int8_t kMaximumBitField2FastElementValue = static_cast<int8_t>(
(FAST_ELEMENTS + 1) << Map::kElementsKindShift) - 1;
@@ -7580,8 +7580,8 @@ class Name: public HeapObject {
STATIC_CHECK(IS_POWER_OF_TWO(kMaxCachedArrayIndexLength + 1));
static const int kContainsCachedArrayIndexMask =
- (~kMaxCachedArrayIndexLength << kArrayIndexHashLengthShift) |
- kIsNotArrayIndexMask;
+ (~static_cast<unsigned>(kMaxCachedArrayIndexLength) <<
+ kArrayIndexHashLengthShift) | kIsNotArrayIndexMask;
// Value of empty hash field indicating that the hash is not computed.
static const int kEmptyHashField =