Fix BitVector::IndexIterator::operator*() to return uint32_t.
Change-Id: I3cfc028b1c3744ec85ea00eadcbccfdde6fd51d3
diff --git a/runtime/base/bit_vector-inl.h b/runtime/base/bit_vector-inl.h
index dc13dd5..39b19e5 100644
--- a/runtime/base/bit_vector-inl.h
+++ b/runtime/base/bit_vector-inl.h
@@ -29,7 +29,7 @@
return bit_index_ == other.bit_index_;
}
-inline int BitVector::IndexIterator::operator*() const {
+inline uint32_t BitVector::IndexIterator::operator*() const {
DCHECK_LT(bit_index_, BitSize());
return bit_index_;
}
diff --git a/runtime/base/bit_vector.h b/runtime/base/bit_vector.h
index 1e28a27..557a2ec 100644
--- a/runtime/base/bit_vector.h
+++ b/runtime/base/bit_vector.h
@@ -52,7 +52,7 @@
return !(*this == other);
}
- int operator*() const;
+ uint32_t operator*() const;
IndexIterator& operator++();
diff --git a/runtime/base/bit_vector_test.cc b/runtime/base/bit_vector_test.cc
index 31fd0e7..fe3313d1 100644
--- a/runtime/base/bit_vector_test.cc
+++ b/runtime/base/bit_vector_test.cc
@@ -57,10 +57,10 @@
BitVector::IndexIterator iterator = bv.Indexes().begin();
EXPECT_TRUE(iterator != bv.Indexes().end());
- EXPECT_EQ(0, *iterator);
+ EXPECT_EQ(0u, *iterator);
++iterator;
EXPECT_TRUE(iterator != bv.Indexes().end());
- EXPECT_EQ(static_cast<int>(kBits - 1), *iterator);
+ EXPECT_EQ(kBits - 1u, *iterator);
++iterator;
EXPECT_TRUE(iterator == bv.Indexes().end());
}