ART: Fix some types
Use better types and fix some typing issues exposed by clang-tidy's
readability-implicit-bool-conversion.
Bug: 32619234
Test: WITH_TIDY=1 mmma art
Change-Id: I787d291a4843a3192a84853d105d57377b774b23
diff --git a/dex2oat/linker/image_writer.cc b/dex2oat/linker/image_writer.cc
index 9626e21..305bf50 100644
--- a/dex2oat/linker/image_writer.cc
+++ b/dex2oat/linker/image_writer.cc
@@ -1356,10 +1356,6 @@
operator()(ref, mirror::Reference::ReferentOffset(), /* is_static */ false);
}
- ALWAYS_INLINE bool GetResult() const {
- return result_;
- }
-
private:
ImageWriter* image_writer_;
bool* early_exit_;
diff --git a/dexdump/dexdump_main.cc b/dexdump/dexdump_main.cc
index cf0d113..8b2b71c 100644
--- a/dexdump/dexdump_main.cc
+++ b/dexdump/dexdump_main.cc
@@ -144,7 +144,7 @@
while (optind < argc) {
result |= processFile(argv[optind++]);
} // while
- return result != 0;
+ return result != 0 ? 1 : 0;
}
} // namespace art
diff --git a/dexlayout/dexlayout_main.cc b/dexlayout/dexlayout_main.cc
index 2163f89..12674f5 100644
--- a/dexlayout/dexlayout_main.cc
+++ b/dexlayout/dexlayout_main.cc
@@ -222,7 +222,7 @@
fclose(out_file);
}
- return result != 0;
+ return result != 0 ? 1 : 0;
}
} // namespace art
diff --git a/dexlist/dexlist.cc b/dexlist/dexlist.cc
index dd32fae..9ef9ae9 100644
--- a/dexlist/dexlist.cc
+++ b/dexlist/dexlist.cc
@@ -273,7 +273,7 @@
} // while
free(gOptions.argCopy);
- return result != 0;
+ return result != 0 ? 1 : 0;
}
} // namespace art
diff --git a/imgdiag/imgdiag.cc b/imgdiag/imgdiag.cc
index 90563a1..d38f466 100644
--- a/imgdiag/imgdiag.cc
+++ b/imgdiag/imgdiag.cc
@@ -1737,7 +1737,7 @@
}
}
- return page_frame_number != page_frame_number_clean;
+ return (page_frame_number != page_frame_number_clean) ? 1 : 0;
}
void PrintPidLine(const std::string& kind, pid_t pid) {
diff --git a/libartbase/base/utils.cc b/libartbase/base/utils.cc
index 30423a4..bc60db9 100644
--- a/libartbase/base/utils.cc
+++ b/libartbase/base/utils.cc
@@ -135,14 +135,14 @@
}
void SetThreadName(const char* thread_name) {
- int hasAt = 0;
- int hasDot = 0;
+ bool hasAt = false;
+ bool hasDot = false;
const char* s = thread_name;
while (*s) {
if (*s == '.') {
- hasDot = 1;
+ hasDot = true;
} else if (*s == '@') {
- hasAt = 1;
+ hasAt = true;
}
s++;
}
diff --git a/libprofile/profile/profile_compilation_info.cc b/libprofile/profile/profile_compilation_info.cc
index 47b17ae..ccd3115 100644
--- a/libprofile/profile/profile_compilation_info.cc
+++ b/libprofile/profile/profile_compilation_info.cc
@@ -236,7 +236,7 @@
std::string error;
if (!IsEmpty()) {
- return kProfileLoadWouldOverwiteData;
+ return false;
}
#ifdef _WIN32
@@ -874,7 +874,7 @@
uint32_t unread_bytes_before_operation = buffer.CountUnreadBytes();
if (unread_bytes_before_operation < line_header.method_region_size_bytes) {
*error += "Profile EOF reached prematurely for ReadMethod";
- return kProfileLoadBadData;
+ return false;
}
size_t expected_unread_bytes_after_operation = buffer.CountUnreadBytes()
- line_header.method_region_size_bytes;
@@ -913,7 +913,7 @@
size_t unread_bytes_before_op = buffer.CountUnreadBytes();
if (unread_bytes_before_op < line_header.class_set_size) {
*error += "Profile EOF reached prematurely for ReadClasses";
- return kProfileLoadBadData;
+ return false;
}
uint16_t last_class_index = 0;
diff --git a/runtime/debugger.cc b/runtime/debugger.cc
index c5b111f..5c6d657 100644
--- a/runtime/debugger.cc
+++ b/runtime/debugger.cc
@@ -4433,16 +4433,16 @@
int Dbg::DdmHandleHpifChunk(HpifWhen when) {
if (when == HPIF_WHEN_NOW) {
DdmSendHeapInfo(when);
- return true;
+ return 1;
}
if (when != HPIF_WHEN_NEVER && when != HPIF_WHEN_NEXT_GC && when != HPIF_WHEN_EVERY_GC) {
LOG(ERROR) << "invalid HpifWhen value: " << static_cast<int>(when);
- return false;
+ return 0;
}
gDdmHpifWhen = when;
- return true;
+ return 1;
}
bool Dbg::DdmHandleHpsgNhsgChunk(Dbg::HpsgWhen when, Dbg::HpsgWhat what, bool native) {
diff --git a/runtime/gc/allocator/rosalloc.cc b/runtime/gc/allocator/rosalloc.cc
index d4b9fab..8786365 100644
--- a/runtime/gc/allocator/rosalloc.cc
+++ b/runtime/gc/allocator/rosalloc.cc
@@ -890,7 +890,7 @@
DCHECK(IsThreadLocal());
// Merge the thread local free list into the free list and clear the thread local free list.
const uint8_t idx = size_bracket_idx_;
- bool thread_local_free_list_size = thread_local_free_list_.Size();
+ size_t thread_local_free_list_size = thread_local_free_list_.Size();
const size_t size_before = free_list_.Size();
free_list_.Merge(&thread_local_free_list_);
const size_t size_after = free_list_.Size();
diff --git a/runtime/gc/allocator/rosalloc.h b/runtime/gc/allocator/rosalloc.h
index 0906295..c4bc76f 100644
--- a/runtime/gc/allocator/rosalloc.h
+++ b/runtime/gc/allocator/rosalloc.h
@@ -352,7 +352,8 @@
uint8_t magic_num_; // The magic number used for debugging.
uint8_t size_bracket_idx_; // The index of the size bracket of this run.
uint8_t is_thread_local_; // True if this run is used as a thread-local run.
- uint8_t to_be_bulk_freed_; // Used within BulkFree() to flag a run that's involved with a bulk free.
+ bool to_be_bulk_freed_; // Used within BulkFree() to flag a run that's involved with
+ // a bulk free.
uint32_t padding_ ATTRIBUTE_UNUSED;
// Use a tailless free list for free_list_ so that the alloc fast path does not manage the tail.
SlotFreeList<false> free_list_;
diff --git a/runtime/gc/space/dlmalloc_space.cc b/runtime/gc/space/dlmalloc_space.cc
index 7955ff9..3ef0f4e 100644
--- a/runtime/gc/space/dlmalloc_space.cc
+++ b/runtime/gc/space/dlmalloc_space.cc
@@ -154,7 +154,7 @@
// create mspace using our backing storage starting at begin and with a footprint of
// morecore_start. Don't use an internal dlmalloc lock (as we already hold heap lock). When
// morecore_start bytes of memory is exhaused morecore will be called.
- void* msp = create_mspace_with_base(begin, morecore_start, false /*locked*/);
+ void* msp = create_mspace_with_base(begin, morecore_start, 0 /*locked*/);
if (msp != nullptr) {
// Do not allow morecore requests to succeed beyond the initial size of the heap
mspace_set_footprint_limit(msp, initial_size);
diff --git a/runtime/interpreter/mterp/mterp.cc b/runtime/interpreter/mterp/mterp.cc
index 6a8f864..d4a1926 100644
--- a/runtime/interpreter/mterp/mterp.cc
+++ b/runtime/interpreter/mterp/mterp.cc
@@ -170,7 +170,7 @@
JValue* result_register = shadow_frame->GetResultRegister();
const Instruction* inst = Instruction::At(dex_pc_ptr);
return DoInvoke<kVirtual, /*is_range=*/ false, /*do_access_check=*/ false, /*is_mterp=*/ true>(
- self, *shadow_frame, inst, inst_data, result_register);
+ self, *shadow_frame, inst, inst_data, result_register) ? 1u : 0u;
}
extern "C" size_t MterpInvokeSuper(Thread* self,
@@ -181,7 +181,7 @@
JValue* result_register = shadow_frame->GetResultRegister();
const Instruction* inst = Instruction::At(dex_pc_ptr);
return DoInvoke<kSuper, /*is_range=*/ false, /*do_access_check=*/ false, /*is_mterp=*/ true>(
- self, *shadow_frame, inst, inst_data, result_register);
+ self, *shadow_frame, inst, inst_data, result_register) ? 1u : 0u;
}
extern "C" size_t MterpInvokeInterface(Thread* self,
@@ -192,7 +192,7 @@
JValue* result_register = shadow_frame->GetResultRegister();
const Instruction* inst = Instruction::At(dex_pc_ptr);
return DoInvoke<kInterface, /*is_range=*/ false, /*do_access_check=*/ false, /*is_mterp=*/ true>(
- self, *shadow_frame, inst, inst_data, result_register);
+ self, *shadow_frame, inst, inst_data, result_register) ? 1u : 0u;
}
extern "C" size_t MterpInvokeDirect(Thread* self,
@@ -203,7 +203,7 @@
JValue* result_register = shadow_frame->GetResultRegister();
const Instruction* inst = Instruction::At(dex_pc_ptr);
return DoInvoke<kDirect, /*is_range=*/ false, /*do_access_check=*/ false, /*is_mterp=*/ true>(
- self, *shadow_frame, inst, inst_data, result_register);
+ self, *shadow_frame, inst, inst_data, result_register) ? 1u : 0u;
}
extern "C" size_t MterpInvokeStatic(Thread* self,
@@ -214,7 +214,7 @@
JValue* result_register = shadow_frame->GetResultRegister();
const Instruction* inst = Instruction::At(dex_pc_ptr);
return DoInvoke<kStatic, /*is_range=*/ false, /*do_access_check=*/ false, /*is_mterp=*/ true>(
- self, *shadow_frame, inst, inst_data, result_register);
+ self, *shadow_frame, inst, inst_data, result_register) ? 1u : 0u;
}
extern "C" size_t MterpInvokeCustom(Thread* self,
@@ -225,7 +225,7 @@
JValue* result_register = shadow_frame->GetResultRegister();
const Instruction* inst = Instruction::At(dex_pc_ptr);
return DoInvokeCustom</* is_range= */ false>(
- self, *shadow_frame, inst, inst_data, result_register);
+ self, *shadow_frame, inst, inst_data, result_register) ? 1u : 0u;
}
extern "C" size_t MterpInvokePolymorphic(Thread* self,
@@ -236,7 +236,7 @@
JValue* result_register = shadow_frame->GetResultRegister();
const Instruction* inst = Instruction::At(dex_pc_ptr);
return DoInvokePolymorphic</* is_range= */ false>(
- self, *shadow_frame, inst, inst_data, result_register);
+ self, *shadow_frame, inst, inst_data, result_register) ? 1u : 0u;
}
extern "C" size_t MterpInvokeVirtualRange(Thread* self,
@@ -247,7 +247,7 @@
JValue* result_register = shadow_frame->GetResultRegister();
const Instruction* inst = Instruction::At(dex_pc_ptr);
return DoInvoke<kVirtual, /*is_range=*/ true, /*do_access_check=*/ false, /*is_mterp=*/ true>(
- self, *shadow_frame, inst, inst_data, result_register);
+ self, *shadow_frame, inst, inst_data, result_register) ? 1u : 0u;
}
extern "C" size_t MterpInvokeSuperRange(Thread* self,
@@ -258,7 +258,7 @@
JValue* result_register = shadow_frame->GetResultRegister();
const Instruction* inst = Instruction::At(dex_pc_ptr);
return DoInvoke<kSuper, /*is_range=*/ true, /*do_access_check=*/ false, /*is_mterp=*/ true>(
- self, *shadow_frame, inst, inst_data, result_register);
+ self, *shadow_frame, inst, inst_data, result_register) ? 1u : 0u;
}
extern "C" size_t MterpInvokeInterfaceRange(Thread* self,
@@ -269,7 +269,7 @@
JValue* result_register = shadow_frame->GetResultRegister();
const Instruction* inst = Instruction::At(dex_pc_ptr);
return DoInvoke<kInterface, /*is_range=*/ true, /*do_access_check=*/ false, /*is_mterp=*/ true>(
- self, *shadow_frame, inst, inst_data, result_register);
+ self, *shadow_frame, inst, inst_data, result_register) ? 1u : 0u;
}
extern "C" size_t MterpInvokeDirectRange(Thread* self,
@@ -280,7 +280,7 @@
JValue* result_register = shadow_frame->GetResultRegister();
const Instruction* inst = Instruction::At(dex_pc_ptr);
return DoInvoke<kDirect, /*is_range=*/ true, /*do_access_check=*/ false, /*is_mterp=*/ true>(
- self, *shadow_frame, inst, inst_data, result_register);
+ self, *shadow_frame, inst, inst_data, result_register) ? 1u : 0u;
}
extern "C" size_t MterpInvokeStaticRange(Thread* self,
@@ -291,7 +291,7 @@
JValue* result_register = shadow_frame->GetResultRegister();
const Instruction* inst = Instruction::At(dex_pc_ptr);
return DoInvoke<kStatic, /*is_range=*/ true, /*do_access_check=*/ false, /*is_mterp=*/ true>(
- self, *shadow_frame, inst, inst_data, result_register);
+ self, *shadow_frame, inst, inst_data, result_register) ? 1u : 0u;
}
extern "C" size_t MterpInvokeCustomRange(Thread* self,
@@ -301,7 +301,8 @@
REQUIRES_SHARED(Locks::mutator_lock_) {
JValue* result_register = shadow_frame->GetResultRegister();
const Instruction* inst = Instruction::At(dex_pc_ptr);
- return DoInvokeCustom</*is_range=*/ true>(self, *shadow_frame, inst, inst_data, result_register);
+ return DoInvokeCustom</*is_range=*/ true>(
+ self, *shadow_frame, inst, inst_data, result_register) ? 1u : 0u;
}
extern "C" size_t MterpInvokePolymorphicRange(Thread* self,
@@ -312,7 +313,7 @@
JValue* result_register = shadow_frame->GetResultRegister();
const Instruction* inst = Instruction::At(dex_pc_ptr);
return DoInvokePolymorphic</* is_range= */ true>(
- self, *shadow_frame, inst, inst_data, result_register);
+ self, *shadow_frame, inst, inst_data, result_register) ? 1u : 0u;
}
extern "C" size_t MterpInvokeVirtualQuick(Thread* self,
@@ -323,7 +324,7 @@
JValue* result_register = shadow_frame->GetResultRegister();
const Instruction* inst = Instruction::At(dex_pc_ptr);
return DoInvoke<kVirtual, /*is_range=*/ false, /*do_access_check=*/ false, /*is_mterp=*/ true,
- /*is_quick=*/ true>(self, *shadow_frame, inst, inst_data, result_register);
+ /*is_quick=*/ true>(self, *shadow_frame, inst, inst_data, result_register) ? 1u : 0u;
}
extern "C" size_t MterpInvokeVirtualQuickRange(Thread* self,
@@ -334,7 +335,7 @@
JValue* result_register = shadow_frame->GetResultRegister();
const Instruction* inst = Instruction::At(dex_pc_ptr);
return DoInvoke<kVirtual, /*is_range=*/ true, /*do_access_check=*/ false, /*is_mterp=*/ true,
- /*is_quick=*/ true>(self, *shadow_frame, inst, inst_data, result_register);
+ /*is_quick=*/ true>(self, *shadow_frame, inst, inst_data, result_register) ? 1u : 0u;
}
extern "C" void MterpThreadFenceForConstructor() {
@@ -348,10 +349,10 @@
REQUIRES_SHARED(Locks::mutator_lock_) {
ObjPtr<mirror::String> s = ResolveString(self, *shadow_frame, dex::StringIndex(index));
if (UNLIKELY(s == nullptr)) {
- return true;
+ return 1u;
}
shadow_frame->SetVRegReference(tgt_vreg, s);
- return false;
+ return 0u;
}
extern "C" size_t MterpConstClass(uint32_t index,
@@ -365,10 +366,10 @@
/* can_run_clinit= */ false,
/* verify_access= */ false);
if (UNLIKELY(c == nullptr)) {
- return true;
+ return 1u;
}
shadow_frame->SetVRegReference(tgt_vreg, c);
- return false;
+ return 0u;
}
extern "C" size_t MterpConstMethodHandle(uint32_t index,
@@ -378,10 +379,10 @@
REQUIRES_SHARED(Locks::mutator_lock_) {
ObjPtr<mirror::MethodHandle> mh = ResolveMethodHandle(self, index, shadow_frame->GetMethod());
if (UNLIKELY(mh == nullptr)) {
- return true;
+ return 1u;
}
shadow_frame->SetVRegReference(tgt_vreg, mh);
- return false;
+ return 0u;
}
extern "C" size_t MterpConstMethodType(uint32_t index,
@@ -392,10 +393,10 @@
ObjPtr<mirror::MethodType> mt =
ResolveMethodType(self, dex::ProtoIndex(index), shadow_frame->GetMethod());
if (UNLIKELY(mt == nullptr)) {
- return true;
+ return 1u;
}
shadow_frame->SetVRegReference(tgt_vreg, mt);
- return false;
+ return 0u;
}
extern "C" size_t MterpCheckCast(uint32_t index,
@@ -409,15 +410,15 @@
false,
false);
if (UNLIKELY(c == nullptr)) {
- return true;
+ return 1u;
}
// Must load obj from vreg following ResolveVerifyAndClinit due to moving gc.
ObjPtr<mirror::Object> obj = vreg_addr->AsMirrorPtr();
if (UNLIKELY(obj != nullptr && !obj->InstanceOf(c))) {
ThrowClassCastException(c, obj->GetClass());
- return true;
+ return 1u;
}
- return false;
+ return 0u;
}
extern "C" size_t MterpInstanceOf(uint32_t index,
@@ -431,17 +432,17 @@
false,
false);
if (UNLIKELY(c == nullptr)) {
- return false; // Caller will check for pending exception. Return value unimportant.
+ return 0u; // Caller will check for pending exception. Return value unimportant.
}
// Must load obj from vreg following ResolveVerifyAndClinit due to moving gc.
ObjPtr<mirror::Object> obj = vreg_addr->AsMirrorPtr();
- return (obj != nullptr) && obj->InstanceOf(c);
+ return (obj != nullptr) && obj->InstanceOf(c) ? 1u : 0u;
}
extern "C" size_t MterpFillArrayData(mirror::Object* obj,
const Instruction::ArrayDataPayload* payload)
REQUIRES_SHARED(Locks::mutator_lock_) {
- return FillArrayData(obj, payload);
+ return FillArrayData(obj, payload) ? 1u : 0u;
}
extern "C" size_t MterpNewInstance(ShadowFrame* shadow_frame, Thread* self, uint32_t inst_data)
@@ -464,11 +465,11 @@
}
}
if (UNLIKELY(obj == nullptr)) {
- return false;
+ return 0u;
}
obj->GetClass()->AssertInitializedOrInitializingInThread(self);
shadow_frame->SetVRegReference(inst->VRegA_21c(inst_data), obj);
- return true;
+ return 1u;
}
extern "C" size_t MterpIputObjectQuick(ShadowFrame* shadow_frame,
@@ -476,7 +477,7 @@
uint32_t inst_data)
REQUIRES_SHARED(Locks::mutator_lock_) {
const Instruction* inst = Instruction::At(dex_pc_ptr);
- return DoIPutQuick<Primitive::kPrimNot, false>(*shadow_frame, inst, inst_data);
+ return DoIPutQuick<Primitive::kPrimNot, false>(*shadow_frame, inst, inst_data) ? 1u : 0u;
}
extern "C" size_t MterpAputObject(ShadowFrame* shadow_frame,
@@ -486,16 +487,16 @@
const Instruction* inst = Instruction::At(dex_pc_ptr);
ObjPtr<mirror::Object> a = shadow_frame->GetVRegReference(inst->VRegB_23x());
if (UNLIKELY(a == nullptr)) {
- return false;
+ return 0u;
}
int32_t index = shadow_frame->GetVReg(inst->VRegC_23x());
ObjPtr<mirror::Object> val = shadow_frame->GetVRegReference(inst->VRegA_23x(inst_data));
ObjPtr<mirror::ObjectArray<mirror::Object>> array = a->AsObjectArray<mirror::Object>();
if (array->CheckIsValidIndex(index) && array->CheckAssignable(val)) {
array->SetWithoutChecks<false>(index, val);
- return true;
+ return 1u;
}
- return false;
+ return 0u;
}
extern "C" size_t MterpFilledNewArray(ShadowFrame* shadow_frame,
@@ -504,7 +505,7 @@
REQUIRES_SHARED(Locks::mutator_lock_) {
const Instruction* inst = Instruction::At(dex_pc_ptr);
return DoFilledNewArray<false, false, false>(inst, *shadow_frame, self,
- shadow_frame->GetResultRegister());
+ shadow_frame->GetResultRegister()) ? 1u : 0u;
}
extern "C" size_t MterpFilledNewArrayRange(ShadowFrame* shadow_frame,
@@ -513,7 +514,7 @@
REQUIRES_SHARED(Locks::mutator_lock_) {
const Instruction* inst = Instruction::At(dex_pc_ptr);
return DoFilledNewArray<true, false, false>(inst, *shadow_frame, self,
- shadow_frame->GetResultRegister());
+ shadow_frame->GetResultRegister()) ? 1u : 0u;
}
extern "C" size_t MterpNewArray(ShadowFrame* shadow_frame,
@@ -526,10 +527,10 @@
dex::TypeIndex(inst->VRegC_22c()), length, shadow_frame->GetMethod(), self,
Runtime::Current()->GetHeap()->GetCurrentAllocator());
if (UNLIKELY(obj == nullptr)) {
- return false;
+ return 0u;
}
shadow_frame->SetVRegReference(inst->VRegA_22c(inst_data), obj);
- return true;
+ return 1u;
}
extern "C" size_t MterpHandleException(Thread* self, ShadowFrame* shadow_frame)
@@ -537,7 +538,7 @@
DCHECK(self->IsExceptionPending());
const instrumentation::Instrumentation* const instrumentation =
Runtime::Current()->GetInstrumentation();
- return MoveToExceptionHandler(self, *shadow_frame, instrumentation);
+ return MoveToExceptionHandler(self, *shadow_frame, instrumentation) ? 1u : 0u;
}
struct MterpCheckHelper {
@@ -958,7 +959,7 @@
did_osr = jit::Jit::MaybeDoOnStackReplacement(self, method, dex_pc, offset, result);
}
shadow_frame->SetCachedHotnessCountdown(osr_countdown);
- return did_osr;
+ return did_osr ? 1u : 0u;
}
} // namespace interpreter
diff --git a/runtime/jdwp/jdwp.h b/runtime/jdwp/jdwp.h
index bf1d665..7b2bbd61 100644
--- a/runtime/jdwp/jdwp.h
+++ b/runtime/jdwp/jdwp.h
@@ -369,7 +369,7 @@
pthread_t pthread_;
Thread* thread_;
- volatile int32_t debug_thread_started_ GUARDED_BY(thread_start_lock_);
+ volatile bool debug_thread_started_ GUARDED_BY(thread_start_lock_);
ObjectId debug_thread_id_;
private:
diff --git a/runtime/parsed_options.cc b/runtime/parsed_options.cc
index dd62382..346ae26 100644
--- a/runtime/parsed_options.cc
+++ b/runtime/parsed_options.cc
@@ -580,7 +580,7 @@
MaybeOverrideVerbosity();
- SetRuntimeDebugFlagsEnabled(args.Get(M::SlowDebug));
+ SetRuntimeDebugFlagsEnabled(args.GetOrDefault(M::SlowDebug));
// -Xprofile:
Trace::SetDefaultClockSource(args.GetOrDefault(M::ProfileClock));
diff --git a/runtime/trace.cc b/runtime/trace.cc
index 0e28f29..0c31faa 100644
--- a/runtime/trace.cc
+++ b/runtime/trace.cc
@@ -336,7 +336,7 @@
Thread::Current()->ThrowNewException("Ljava/lang/RuntimeException;", msg.c_str());
return;
}
- std::unique_ptr<File> file(new File(trace_fd, "tracefile"));
+ std::unique_ptr<File> file(new File(trace_fd, /* path= */ "tracefile", /* check_usage= */ true));
Start(std::move(file), buffer_size, flags, output_mode, trace_mode, interval_us);
}
diff --git a/runtime/transaction.cc b/runtime/transaction.cc
index 62482fd..c534a42 100644
--- a/runtime/transaction.cc
+++ b/runtime/transaction.cc
@@ -460,11 +460,11 @@
if (UNLIKELY(field_value.is_volatile)) {
obj->SetFieldBooleanVolatile<false, kCheckTransaction>(
field_offset,
- static_cast<bool>(field_value.value));
+ field_value.value);
} else {
obj->SetFieldBoolean<false, kCheckTransaction>(
field_offset,
- static_cast<bool>(field_value.value));
+ field_value.value);
}
break;
case kByte:
diff --git a/tools/hiddenapi/hiddenapi.cc b/tools/hiddenapi/hiddenapi.cc
index 646e483..f6d599f 100644
--- a/tools/hiddenapi/hiddenapi.cc
+++ b/tools/hiddenapi/hiddenapi.cc
@@ -197,7 +197,7 @@
private:
inline uint32_t GetAccessFlags() const { return item_.GetAccessFlags(); }
- inline uint32_t HasAccessFlags(uint32_t mask) const { return (GetAccessFlags() & mask) == mask; }
+ inline bool HasAccessFlags(uint32_t mask) const { return (GetAccessFlags() & mask) == mask; }
inline std::string_view GetName() const {
return IsMethod() ? item_.GetDexFile().GetMethodName(GetMethodId())