diff options
-rw-r--r-- | compiler/image_writer.cc | 5 | ||||
-rw-r--r-- | runtime/class_linker.cc | 5 | ||||
-rw-r--r-- | runtime/mirror/dex_cache-inl.h | 4 |
3 files changed, 8 insertions, 6 deletions
diff --git a/compiler/image_writer.cc b/compiler/image_writer.cc index 195949bf3c..bf32febabe 100644 --- a/compiler/image_writer.cc +++ b/compiler/image_writer.cc @@ -1006,7 +1006,7 @@ bool ImageWriter::CopyAndFixupIfDexCacheFieldArray(mirror::Object* dst, mirror:: // 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 @@ bool ImageWriter::CopyAndFixupIfDexCacheFieldArray(mirror::Object* dst, mirror:: 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 292f830764..7912629f35 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -1407,9 +1407,10 @@ mirror::DexCache* ClassLinker::AllocDexCache(Thread* self, const DexFile& dex_fi 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 @@ jobject ClassLinker::CreatePathClassLoader(Thread* self, std::vector<const DexFi 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 1cb437e8ea..bfb9eb52db 100644 --- a/runtime/mirror/dex_cache-inl.h +++ b/runtime/mirror/dex_cache-inl.h @@ -51,7 +51,7 @@ inline void DexCache::SetResolvedType(uint32_t type_idx, Class* resolved) { 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 ArtField* DexCache::GetResolvedField(uint32_t idx, size_t ptr_size) { } 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 { |