Fix a few literals and assertions.
Change-Id: I0a1e9db607ec7325e17568b034ba90e68d2298f9
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc
index 195949b..bf32feb 100644
--- a/compiler/image_writer.cc
+++ b/compiler/image_writer.cc
@@ -1006,7 +1006,7 @@
// Fixup int pointers for the field array.
CHECK(!arr->IsObjectArray());
const size_t num_elements = arr->GetLength();
- if (target_ptr_size_ == 4) {
+ if (target_ptr_size_ == 4u) {
// Will get fixed up by fixup object.
dst->SetClass(down_cast<mirror::Class*>(
GetImageAddress(mirror::IntArray::GetArrayClass())));
@@ -1026,10 +1026,11 @@
CHECK(it2 != art_field_reloc_.end()) << "No relocation for field " << PrettyField(field);
fixup_location = image_begin_ + it2->second;
}
- if (target_ptr_size_ == 4) {
+ if (target_ptr_size_ == 4u) {
down_cast<mirror::IntArray*>(dest_array)->SetWithoutChecks<kVerifyNone>(
i, static_cast<uint32_t>(reinterpret_cast<uint64_t>(fixup_location)));
} else {
+ DCHECK_EQ(target_ptr_size_, 8u);
down_cast<mirror::LongArray*>(dest_array)->SetWithoutChecks<kVerifyNone>(
i, reinterpret_cast<uint64_t>(fixup_location));
}
diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc
index 292f830..7912629 100644
--- a/runtime/class_linker.cc
+++ b/runtime/class_linker.cc
@@ -1407,9 +1407,10 @@
return nullptr;
}
Handle<mirror::Array> fields;
- if (image_pointer_size_ == 8) {
+ if (image_pointer_size_ == 8u) {
fields = hs.NewHandle<mirror::Array>(mirror::LongArray::Alloc(self, dex_file.NumFieldIds()));
} else {
+ DCHECK_EQ(image_pointer_size_, 4u);
fields = hs.NewHandle<mirror::Array>(mirror::IntArray::Alloc(self, dex_file.NumFieldIds()));
}
if (fields.Get() == nullptr) {
@@ -5666,7 +5667,7 @@
ArtField* const parent_field =
mirror::Class::FindField(self, hs.NewHandle(h_path_class_loader->GetClass()), "parent",
"Ljava/lang/ClassLoader;");
- DCHECK(parent_field!= nullptr);
+ DCHECK(parent_field != nullptr);
mirror::Object* boot_cl =
soa.Decode<mirror::Class*>(WellKnownClasses::java_lang_BootClassLoader)->AllocObject(self);
parent_field->SetObject<false>(h_path_class_loader.Get(), boot_cl);
diff --git a/runtime/mirror/dex_cache-inl.h b/runtime/mirror/dex_cache-inl.h
index 1cb437e..bfb9eb5 100644
--- a/runtime/mirror/dex_cache-inl.h
+++ b/runtime/mirror/dex_cache-inl.h
@@ -51,7 +51,7 @@
inline ArtField* DexCache::GetResolvedField(uint32_t idx, size_t ptr_size) {
ArtField* field = nullptr;
- if (ptr_size == 8) {
+ if (ptr_size == 8u) {
field = reinterpret_cast<ArtField*>(
static_cast<uintptr_t>(GetResolvedFields()->AsLongArray()->GetWithoutChecks(idx)));
} else {
@@ -66,7 +66,7 @@
}
inline void DexCache::SetResolvedField(uint32_t idx, ArtField* field, size_t ptr_size) {
- if (ptr_size == 8) {
+ if (ptr_size == 8u) {
GetResolvedFields()->AsLongArray()->Set(
idx, static_cast<uint64_t>(reinterpret_cast<uintptr_t>(field)));
} else {