Fix clang++ warnings on -Wtautological-constant-out-of-range-compare
authorhalton.huo <halton.huo@intel.com>
Mon, 1 Dec 2014 09:17:24 +0000 (01:17 -0800)
committerCommit bot <commit-bot@chromium.org>
Mon, 1 Dec 2014 09:17:32 +0000 (09:17 +0000)
BUG=v8:3730
LOG=N
R=dslomov@chromium.org

Review URL: https://codereview.chromium.org/750093003

Cr-Commit-Position: refs/heads/master@{#25579}

src/elements.h
src/objects.h

index 9d86bbd657b5fde617ec05381de9e51cc06e1202..05354eaccf1359509ac6189fd5208b94620a0f09 100644 (file)
@@ -179,7 +179,7 @@ class ElementsAccessor {
 
   // Returns a shared ElementsAccessor for the specified ElementsKind.
   static ElementsAccessor* ForKind(ElementsKind elements_kind) {
-    DCHECK(elements_kind < kElementsKindCount);
+    DCHECK(static_cast<int>(elements_kind) < kElementsKindCount);
     return elements_accessors_[elements_kind];
   }
 
index c284a49ea6dc5e56a96e077d41d48efdc6c9717c..d17d0d1ef1c851e08dca8eb5b1cfa8a812f04660 100644 (file)
@@ -5739,7 +5739,7 @@ class Map: public HeapObject {
   inline bool is_prototype_map();
 
   inline void set_elements_kind(ElementsKind elements_kind) {
-    DCHECK(elements_kind < kElementsKindCount);
+    DCHECK(static_cast<int>(elements_kind) < kElementsKindCount);
     DCHECK(kElementsKindCount <= (1 << Map::ElementsKindBits::kSize));
     set_bit_field2(Map::ElementsKindBits::update(bit_field2(), elements_kind));
     DCHECK(this->elements_kind() == elements_kind);