diff options
| author | Andreas Gampe <agampe@google.com> | 2018-10-11 11:11:13 -0700 |
|---|---|---|
| committer | Andreas Gampe <agampe@google.com> | 2018-10-17 12:17:28 -0700 |
| commit | 0de385f9eb5f8c066121ea2d43e8b8eea6a726fa (patch) | |
| tree | 918bee18727b0a8de4332db161d457c4241939b4 /libdexfile | |
| parent | 21ff4ad92e8d74cfe8d95ec64b177d47084ec374 (diff) | |
| download | art-0de385f9eb5f8c066121ea2d43e8b8eea6a726fa.tar.gz art-0de385f9eb5f8c066121ea2d43e8b8eea6a726fa.tar.bz2 art-0de385f9eb5f8c066121ea2d43e8b8eea6a726fa.zip | |
ART: Refactor for bugprone-argument-comment
Handles libartbase, libdexfile and libprofile.
Bug: 116054210
Test: WITH_TIDY=1 mmma art
Change-Id: Ibeee2446e2978af45402d9ca47c75ffc438de316
Diffstat (limited to 'libdexfile')
| -rw-r--r-- | libdexfile/dex/art_dex_file_loader.cc | 38 | ||||
| -rw-r--r-- | libdexfile/dex/art_dex_file_loader_test.cc | 28 | ||||
| -rw-r--r-- | libdexfile/dex/code_item_accessors_test.cc | 12 | ||||
| -rw-r--r-- | libdexfile/dex/compact_dex_file.cc | 2 | ||||
| -rw-r--r-- | libdexfile/dex/compact_dex_file_test.cc | 20 | ||||
| -rw-r--r-- | libdexfile/dex/dex_file_loader.cc | 20 | ||||
| -rw-r--r-- | libdexfile/dex/dex_file_loader_test.cc | 14 | ||||
| -rw-r--r-- | libdexfile/dex/dex_file_verifier.cc | 23 | ||||
| -rw-r--r-- | libdexfile/dex/dex_file_verifier_test.cc | 28 | ||||
| -rw-r--r-- | libdexfile/dex/dex_instruction_test.cc | 18 | ||||
| -rw-r--r-- | libdexfile/dex/type_lookup_table.cc | 2 |
11 files changed, 106 insertions, 99 deletions
diff --git a/libdexfile/dex/art_dex_file_loader.cc b/libdexfile/dex/art_dex_file_loader.cc index 4f73967353..20a519bf99 100644 --- a/libdexfile/dex/art_dex_file_loader.cc +++ b/libdexfile/dex/art_dex_file_loader.cc @@ -95,7 +95,7 @@ bool ArtDexFileLoader::GetMultiDexChecksums(const char* filename, File fd; if (zip_fd != -1) { if (ReadMagicAndReset(zip_fd, &magic, error_msg)) { - fd = File(DupCloexec(zip_fd), false /* check_usage */); + fd = File(DupCloexec(zip_fd), /* check_usage= */ false); } } else { fd = OpenAndReadMagic(filename, &magic, error_msg); @@ -142,9 +142,9 @@ bool ArtDexFileLoader::GetMultiDexChecksums(const char* filename, if (IsMagicValid(magic)) { std::unique_ptr<const DexFile> dex_file(OpenFile(fd.Release(), filename, - /* verify */ false, - /* verify_checksum */ false, - /* mmap_shared */ false, + /* verify= */ false, + /* verify_checksum= */ false, + /* mmap_shared= */ false, error_msg)); if (dex_file == nullptr) { return false; @@ -167,16 +167,16 @@ std::unique_ptr<const DexFile> ArtDexFileLoader::Open(const uint8_t* base, ScopedTrace trace(std::string("Open dex file from RAM ") + location); return OpenCommon(base, size, - /*data_base*/ nullptr, - /*data_size*/ 0u, + /*data_base=*/ nullptr, + /*data_size=*/ 0u, location, location_checksum, oat_dex_file, verify, verify_checksum, error_msg, - /*container*/ nullptr, - /*verify_result*/ nullptr); + /*container=*/ nullptr, + /*verify_result=*/ nullptr); } std::unique_ptr<const DexFile> ArtDexFileLoader::Open(const std::string& location, @@ -199,8 +199,8 @@ std::unique_ptr<const DexFile> ArtDexFileLoader::Open(const std::string& locatio uint8_t* begin = map.Begin(); std::unique_ptr<DexFile> dex_file = OpenCommon(begin, size, - /*data_base*/ nullptr, - /*data_size*/ 0u, + /*data_base=*/ nullptr, + /*data_size=*/ 0u, location, location_checksum, kNoOatDexFile, @@ -208,7 +208,7 @@ std::unique_ptr<const DexFile> ArtDexFileLoader::Open(const std::string& locatio verify_checksum, error_msg, std::make_unique<MemMapContainer>(std::move(map)), - /*verify_result*/ nullptr); + /*verify_result=*/ nullptr); // Opening CompactDex is only supported from vdex files. if (dex_file != nullptr && dex_file->IsCompactDexFile()) { *error_msg = StringPrintf("Opening CompactDex file '%s' is only supported from vdex files", @@ -240,7 +240,7 @@ bool ArtDexFileLoader::Open(const char* filename, location, verify, verify_checksum, - /* mmap_shared */ false, + /* mmap_shared= */ false, error_msg)); if (dex_file.get() != nullptr) { dex_files->push_back(std::move(dex_file)); @@ -290,7 +290,7 @@ std::unique_ptr<const DexFile> ArtDexFileLoader::OpenFile(int fd, CHECK(!location.empty()); MemMap map; { - File delayed_close(fd, /* check_usage */ false); + File delayed_close(fd, /* check_usage= */ false); struct stat sbuf; memset(&sbuf, 0, sizeof(sbuf)); if (fstat(fd, &sbuf) == -1) { @@ -308,7 +308,7 @@ std::unique_ptr<const DexFile> ArtDexFileLoader::OpenFile(int fd, mmap_shared ? MAP_SHARED : MAP_PRIVATE, fd, 0, - /*low_4gb*/false, + /*low_4gb=*/false, location.c_str(), error_msg); if (!map.IsValid()) { @@ -330,8 +330,8 @@ std::unique_ptr<const DexFile> ArtDexFileLoader::OpenFile(int fd, std::unique_ptr<DexFile> dex_file = OpenCommon(begin, size, - /*data_base*/ nullptr, - /*data_size*/ 0u, + /*data_base=*/ nullptr, + /*data_size=*/ 0u, location, dex_header->checksum_, kNoOatDexFile, @@ -339,7 +339,7 @@ std::unique_ptr<const DexFile> ArtDexFileLoader::OpenFile(int fd, verify_checksum, error_msg, std::make_unique<MemMapContainer>(std::move(map)), - /*verify_result*/ nullptr); + /*verify_result=*/ nullptr); // Opening CompactDex is only supported from vdex files. if (dex_file != nullptr && dex_file->IsCompactDexFile()) { @@ -407,8 +407,8 @@ std::unique_ptr<const DexFile> ArtDexFileLoader::OpenOneDexFileFromZip( size_t size = map.Size(); std::unique_ptr<DexFile> dex_file = OpenCommon(begin, size, - /*data_base*/ nullptr, - /*data_size*/ 0u, + /*data_base=*/ nullptr, + /*data_size=*/ 0u, location, zip_entry->GetCrc32(), kNoOatDexFile, diff --git a/libdexfile/dex/art_dex_file_loader_test.cc b/libdexfile/dex/art_dex_file_loader_test.cc index a7d03637b1..f7a20629f5 100644 --- a/libdexfile/dex/art_dex_file_loader_test.cc +++ b/libdexfile/dex/art_dex_file_loader_test.cc @@ -217,9 +217,9 @@ TEST_F(ArtDexFileLoaderTest, GetMethodSignature) { std::string plain_method = std::string("GetMethodSignature.") + r.name; ASSERT_EQ(plain_method, - raw->PrettyMethod(cur_method->GetIndex(), /* with_signature */ false)); + raw->PrettyMethod(cur_method->GetIndex(), /* with_signature= */ false)); ASSERT_EQ(r.pretty_method, - raw->PrettyMethod(cur_method->GetIndex(), /* with_signature */ true)); + raw->PrettyMethod(cur_method->GetIndex(), /* with_signature= */ true)); } } @@ -332,8 +332,8 @@ TEST_F(ArtDexFileLoaderTest, IsPlatformDexFile_DataDir) { std::string error_msg; bool success = loader.Open(data_location_path.c_str(), data_location_path, - /* verify */ false, - /* verify_checksum */ false, + /* verify= */ false, + /* verify_checksum= */ false, &error_msg, &dex_files); ASSERT_TRUE(success) << error_msg; @@ -360,8 +360,8 @@ TEST_F(ArtDexFileLoaderTest, IsPlatformDexFile_SystemDir) { std::string error_msg; bool success = loader.Open(system_location_path.c_str(), system_location_path, - /* verify */ false, - /* verify_checksum */ false, + /* verify= */ false, + /* verify_checksum= */ false, &error_msg, &dex_files); ASSERT_TRUE(success) << error_msg; @@ -388,8 +388,8 @@ TEST_F(ArtDexFileLoaderTest, IsPlatformDexFile_SystemFrameworkDir) { std::string error_msg; bool success = loader.Open(system_framework_location_path.c_str(), system_framework_location_path, - /* verify */ false, - /* verify_checksum */ false, + /* verify= */ false, + /* verify_checksum= */ false, &error_msg, &dex_files); ASSERT_TRUE(success) << error_msg; @@ -416,8 +416,8 @@ TEST_F(ArtDexFileLoaderTest, IsPlatformDexFile_DataDir_MultiDex) { std::string error_msg; bool success = loader.Open(data_multi_location_path.c_str(), data_multi_location_path, - /* verify */ false, - /* verify_checksum */ false, + /* verify= */ false, + /* verify_checksum= */ false, &error_msg, &dex_files); ASSERT_TRUE(success) << error_msg; @@ -445,8 +445,8 @@ TEST_F(ArtDexFileLoaderTest, IsPlatformDexFile_SystemDir_MultiDex) { std::string error_msg; bool success = loader.Open(system_multi_location_path.c_str(), system_multi_location_path, - /* verify */ false, - /* verify_checksum */ false, + /* verify= */ false, + /* verify_checksum= */ false, &error_msg, &dex_files); ASSERT_TRUE(success) << error_msg; @@ -474,8 +474,8 @@ TEST_F(ArtDexFileLoaderTest, IsPlatformDexFile_SystemFrameworkDir_MultiDex) { std::string error_msg; bool success = loader.Open(system_framework_multi_location_path.c_str(), system_framework_multi_location_path, - /* verify */ false, - /* verify_checksum */ false, + /* verify= */ false, + /* verify_checksum= */ false, &error_msg, &dex_files); ASSERT_TRUE(success) << error_msg; diff --git a/libdexfile/dex/code_item_accessors_test.cc b/libdexfile/dex/code_item_accessors_test.cc index 2bb4dde649..87f4bab672 100644 --- a/libdexfile/dex/code_item_accessors_test.cc +++ b/libdexfile/dex/code_item_accessors_test.cc @@ -45,10 +45,10 @@ std::unique_ptr<const DexFile> CreateFakeDex(bool compact_dex, std::vector<uint8 std::unique_ptr<const DexFile> dex(dex_file_loader.Open(data->data(), data->size(), "location", - /*location_checksum*/ 123, - /*oat_dex_file*/nullptr, - /*verify*/false, - /*verify_checksum*/false, + /*location_checksum=*/ 123, + /*oat_dex_file=*/nullptr, + /*verify=*/false, + /*verify_checksum=*/false, &error_msg)); CHECK(dex != nullptr) << error_msg; return dex; @@ -56,11 +56,11 @@ std::unique_ptr<const DexFile> CreateFakeDex(bool compact_dex, std::vector<uint8 TEST(CodeItemAccessorsTest, TestDexInstructionsAccessor) { std::vector<uint8_t> standard_dex_data; - std::unique_ptr<const DexFile> standard_dex(CreateFakeDex(/*compact_dex*/false, + std::unique_ptr<const DexFile> standard_dex(CreateFakeDex(/*compact_dex=*/false, &standard_dex_data)); ASSERT_TRUE(standard_dex != nullptr); std::vector<uint8_t> compact_dex_data; - std::unique_ptr<const DexFile> compact_dex(CreateFakeDex(/*compact_dex*/true, + std::unique_ptr<const DexFile> compact_dex(CreateFakeDex(/*compact_dex=*/true, &compact_dex_data)); ASSERT_TRUE(compact_dex != nullptr); static constexpr uint16_t kRegisterSize = 2; diff --git a/libdexfile/dex/compact_dex_file.cc b/libdexfile/dex/compact_dex_file.cc index 302b59ee91..641c523158 100644 --- a/libdexfile/dex/compact_dex_file.cc +++ b/libdexfile/dex/compact_dex_file.cc @@ -100,7 +100,7 @@ CompactDexFile::CompactDexFile(const uint8_t* base, location_checksum, oat_dex_file, std::move(container), - /*is_compact_dex*/ true), + /*is_compact_dex=*/ true), debug_info_offsets_(DataBegin() + GetHeader().debug_info_offsets_pos_, GetHeader().debug_info_base_, GetHeader().debug_info_offsets_table_offset_) {} diff --git a/libdexfile/dex/compact_dex_file_test.cc b/libdexfile/dex/compact_dex_file_test.cc index 517c5873ed..799967e255 100644 --- a/libdexfile/dex/compact_dex_file_test.cc +++ b/libdexfile/dex/compact_dex_file_test.cc @@ -68,11 +68,11 @@ TEST(CompactDexFileTest, CodeItemFields) { uint16_t out_outs_size; uint16_t out_tries_size; uint32_t out_insns_size_in_code_units; - code_item->DecodeFields</*kDecodeOnlyInstructionCount*/false>(&out_insns_size_in_code_units, - &out_registers_size, - &out_ins_size, - &out_outs_size, - &out_tries_size); + code_item->DecodeFields</*kDecodeOnlyInstructionCount=*/false>(&out_insns_size_in_code_units, + &out_registers_size, + &out_ins_size, + &out_outs_size, + &out_tries_size); ASSERT_EQ(registers_size, out_registers_size); ASSERT_EQ(ins_size, out_ins_size); ASSERT_EQ(outs_size, out_outs_size); @@ -80,11 +80,11 @@ TEST(CompactDexFileTest, CodeItemFields) { ASSERT_EQ(insns_size_in_code_units, out_insns_size_in_code_units); ++out_insns_size_in_code_units; // Force value to change. - code_item->DecodeFields</*kDecodeOnlyInstructionCount*/true>(&out_insns_size_in_code_units, - /*registers_size*/ nullptr, - /*ins_size*/ nullptr, - /*outs_size*/ nullptr, - /*tries_size*/ nullptr); + code_item->DecodeFields</*kDecodeOnlyInstructionCount=*/true>(&out_insns_size_in_code_units, + /*registers_size=*/ nullptr, + /*ins_size=*/ nullptr, + /*outs_size=*/ nullptr, + /*tries_size=*/ nullptr); ASSERT_EQ(insns_size_in_code_units, out_insns_size_in_code_units); }; static constexpr uint32_t kMax32 = std::numeric_limits<uint32_t>::max(); diff --git a/libdexfile/dex/dex_file_loader.cc b/libdexfile/dex/dex_file_loader.cc index 4aafc665ee..3667c8c289 100644 --- a/libdexfile/dex/dex_file_loader.cc +++ b/libdexfile/dex/dex_file_loader.cc @@ -222,16 +222,16 @@ std::unique_ptr<const DexFile> DexFileLoader::Open(const uint8_t* base, std::string* error_msg) const { return OpenCommon(base, size, - /*data_base*/ nullptr, - /*data_size*/ 0, + /*data_base=*/ nullptr, + /*data_size=*/ 0, location, location_checksum, oat_dex_file, verify, verify_checksum, error_msg, - /*container*/ nullptr, - /*verify_result*/ nullptr); + /*container=*/ nullptr, + /*verify_result=*/ nullptr); } std::unique_ptr<const DexFile> DexFileLoader::OpenWithDataSection( @@ -255,8 +255,8 @@ std::unique_ptr<const DexFile> DexFileLoader::OpenWithDataSection( verify, verify_checksum, error_msg, - /*container*/ nullptr, - /*verify_result*/ nullptr); + /*container=*/ nullptr, + /*verify_result=*/ nullptr); } bool DexFileLoader::OpenAll( @@ -290,7 +290,7 @@ bool DexFileLoader::OpenAll( size, location, dex_header->checksum_, - /*oat_dex_file*/ nullptr, + /*oat_dex_file=*/ nullptr, verify, verify_checksum, error_msg)); @@ -410,11 +410,11 @@ std::unique_ptr<const DexFile> DexFileLoader::OpenOneDexFileFromZip( std::unique_ptr<const DexFile> dex_file = OpenCommon( map.data(), map.size(), - /*data_base*/ nullptr, - /*data_size*/ 0u, + /*data_base=*/ nullptr, + /*data_size=*/ 0u, location, zip_entry->GetCrc32(), - /*oat_dex_file*/ nullptr, + /*oat_dex_file=*/ nullptr, verify, verify_checksum, error_msg, diff --git a/libdexfile/dex/dex_file_loader_test.cc b/libdexfile/dex/dex_file_loader_test.cc index 53786171cc..9c61d1ac5f 100644 --- a/libdexfile/dex/dex_file_loader_test.cc +++ b/libdexfile/dex/dex_file_loader_test.cc @@ -221,7 +221,7 @@ static bool OpenDexFilesBase64(const char* base64, bool success = dex_file_loader.OpenAll(dex_bytes->data(), dex_bytes->size(), location, - /* verify */ true, + /* verify= */ true, kVerifyChecksum, error_code, error_msg, @@ -256,9 +256,9 @@ static std::unique_ptr<const DexFile> OpenDexFileInMemoryBase64(const char* base dex_bytes->size(), location, location_checksum, - /* oat_dex_file */ nullptr, - /* verify */ true, - /* verify_checksum */ true, + /* oat_dex_file= */ nullptr, + /* verify= */ true, + /* verify_checksum= */ true, &error_message)); if (expect_success) { CHECK(dex_file != nullptr) << error_message; @@ -348,7 +348,7 @@ TEST_F(DexFileLoaderTest, Version40Rejected) { ASSERT_FALSE(dex_file_loader.OpenAll(dex_bytes.data(), dex_bytes.size(), kLocationString, - /* verify */ true, + /* verify= */ true, kVerifyChecksum, &error_code, &error_msg, @@ -367,7 +367,7 @@ TEST_F(DexFileLoaderTest, Version41Rejected) { ASSERT_FALSE(dex_file_loader.OpenAll(dex_bytes.data(), dex_bytes.size(), kLocationString, - /* verify */ true, + /* verify= */ true, kVerifyChecksum, &error_code, &error_msg, @@ -386,7 +386,7 @@ TEST_F(DexFileLoaderTest, ZeroLengthDexRejected) { ASSERT_FALSE(dex_file_loader.OpenAll(dex_bytes.data(), dex_bytes.size(), kLocationString, - /* verify */ true, + /* verify= */ true, kVerifyChecksum, &error_code, &error_msg, diff --git a/libdexfile/dex/dex_file_verifier.cc b/libdexfile/dex/dex_file_verifier.cc index f273c84027..499a89b2ab 100644 --- a/libdexfile/dex/dex_file_verifier.cc +++ b/libdexfile/dex/dex_file_verifier.cc @@ -341,42 +341,43 @@ bool DexFileVerifier::CheckHeader() { bool result = CheckValidOffsetAndSize(header_->link_off_, header_->link_size_, - 0 /* unaligned */, + /* alignment= */ 0, "link") && CheckValidOffsetAndSize(header_->map_off_, header_->map_off_, - 4, + /* alignment= */ 4, "map") && CheckValidOffsetAndSize(header_->string_ids_off_, header_->string_ids_size_, - 4, + /* alignment= */ 4, "string-ids") && CheckValidOffsetAndSize(header_->type_ids_off_, header_->type_ids_size_, - 4, + /* alignment= */ 4, "type-ids") && CheckSizeLimit(header_->type_ids_size_, DexFile::kDexNoIndex16, "type-ids") && CheckValidOffsetAndSize(header_->proto_ids_off_, header_->proto_ids_size_, - 4, + /* alignment= */ 4, "proto-ids") && CheckSizeLimit(header_->proto_ids_size_, DexFile::kDexNoIndex16, "proto-ids") && CheckValidOffsetAndSize(header_->field_ids_off_, header_->field_ids_size_, - 4, + /* alignment= */ 4, "field-ids") && CheckValidOffsetAndSize(header_->method_ids_off_, header_->method_ids_size_, - 4, + /* alignment= */ 4, "method-ids") && CheckValidOffsetAndSize(header_->class_defs_off_, header_->class_defs_size_, - 4, + /* alignment= */ 4, "class-defs") && CheckValidOffsetAndSize(header_->data_off_, header_->data_size_, - 0, // Unaligned, spec doesn't talk about it, even though size - // is supposed to be a multiple of 4. + // Unaligned, spec doesn't talk about it, even though size + // is supposed to be a multiple of 4. + /* alignment= */ 0, "data"); return result; } @@ -1197,7 +1198,7 @@ bool DexFileVerifier::CheckIntraClassDataItem() { ClassAccessor::Method method(*dex_file_, field.ptr_pos_); if (!CheckIntraClassDataItemMethods(&method, accessor.NumDirectMethods(), - nullptr /* direct_it */, + /* direct_method= */ nullptr, 0u, &have_class, &class_type_index, diff --git a/libdexfile/dex/dex_file_verifier_test.cc b/libdexfile/dex/dex_file_verifier_test.cc index a22a457dbe..c3180f0660 100644 --- a/libdexfile/dex/dex_file_verifier_test.cc +++ b/libdexfile/dex/dex_file_verifier_test.cc @@ -107,8 +107,8 @@ static std::unique_ptr<const DexFile> OpenDexFileBase64(const char* base64, bool success = dex_file_loader.OpenAll(dex_bytes.get(), length, location, - /* verify */ true, - /* verify_checksum */ true, + /* verify= */ true, + /* verify_checksum= */ true, &error_code, error_msg, &tmp); @@ -1621,13 +1621,13 @@ TEST_F(DexFileVerifierTest, Checksum) { dex_file->Begin(), dex_file->Size(), "good checksum, no verify", - /*verify_checksum*/ false, + /*verify_checksum=*/ false, &error_msg)); EXPECT_TRUE(DexFileVerifier::Verify(dex_file.get(), dex_file->Begin(), dex_file->Size(), "good checksum, verify", - /*verify_checksum*/ true, + /*verify_checksum=*/ true, &error_msg)); // Bad checksum: !verify_checksum passes verify_checksum fails. @@ -1638,13 +1638,13 @@ TEST_F(DexFileVerifierTest, Checksum) { dex_file->Begin(), dex_file->Size(), "bad checksum, no verify", - /*verify_checksum*/ false, + /*verify_checksum=*/ false, &error_msg)); EXPECT_FALSE(DexFileVerifier::Verify(dex_file.get(), dex_file->Begin(), dex_file->Size(), "bad checksum, verify", - /*verify_checksum*/ true, + /*verify_checksum=*/ true, &error_msg)); EXPECT_NE(error_msg.find("Bad checksum"), std::string::npos) << error_msg; } @@ -1691,7 +1691,7 @@ TEST_F(DexFileVerifierTest, BadStaticMethodName) { dex_file->Begin(), dex_file->Size(), "bad static method name", - /*verify_checksum*/ true, + /*verify_checksum=*/ true, &error_msg)); } @@ -1735,7 +1735,7 @@ TEST_F(DexFileVerifierTest, BadVirtualMethodName) { dex_file->Begin(), dex_file->Size(), "bad virtual method name", - /*verify_checksum*/ true, + /*verify_checksum=*/ true, &error_msg)); } @@ -1779,7 +1779,7 @@ TEST_F(DexFileVerifierTest, BadClinitSignature) { dex_file->Begin(), dex_file->Size(), "bad clinit signature", - /*verify_checksum*/ true, + /*verify_checksum=*/ true, &error_msg)); } @@ -1823,7 +1823,7 @@ TEST_F(DexFileVerifierTest, BadClinitSignatureAgain) { dex_file->Begin(), dex_file->Size(), "bad clinit signature", - /*verify_checksum*/ true, + /*verify_checksum=*/ true, &error_msg)); } @@ -1860,7 +1860,7 @@ TEST_F(DexFileVerifierTest, BadInitSignature) { dex_file->Begin(), dex_file->Size(), "bad init signature", - /*verify_checksum*/ true, + /*verify_checksum=*/ true, &error_msg)); } @@ -2063,7 +2063,7 @@ TEST_F(DexFileVerifierTest, InvokeCustomDexSamples) { dex_file->Begin(), dex_file->Size(), "good checksum, verify", - /*verify_checksum*/ true, + /*verify_checksum=*/ true, &error_msg)); // TODO(oth): Test corruptions (b/35308502) } @@ -2110,7 +2110,7 @@ TEST_F(DexFileVerifierTest, BadStaticFieldInitialValuesArray) { dex_file->Begin(), dex_file->Size(), "bad static field initial values array", - /*verify_checksum*/ true, + /*verify_checksum=*/ true, &error_msg)); } @@ -2166,7 +2166,7 @@ TEST_F(DexFileVerifierTest, GoodStaticFieldInitialValuesArray) { dex_file->Begin(), dex_file->Size(), "good static field initial values array", - /*verify_checksum*/ true, + /*verify_checksum=*/ true, &error_msg)); } diff --git a/libdexfile/dex/dex_instruction_test.cc b/libdexfile/dex/dex_instruction_test.cc index 6ce9dbafc8..02400f4a14 100644 --- a/libdexfile/dex/dex_instruction_test.cc +++ b/libdexfile/dex/dex_instruction_test.cc @@ -71,10 +71,13 @@ static void Build4rcc(uint16_t num_args, uint16_t method_idx, uint16_t proto_idx TEST(Instruction, PropertiesOf45cc) { uint16_t instruction[4]; - Build45cc(4u /* num_vregs */, 16u /* method_idx */, 32u /* proto_idx */, - 0xcafe /* arg_regs */, instruction); + Build45cc(/* num_args= */ 4u, + /* method_idx= */ 16u, + /* proto_idx= */ 32u, + /* arg_regs= */ 0xcafe, + instruction); - DexInstructionIterator ins(instruction, /*dex_pc*/ 0u); + DexInstructionIterator ins(instruction, /*dex_pc=*/ 0u); ASSERT_EQ(4u, ins->SizeInCodeUnits()); ASSERT_TRUE(ins->HasVRegA()); @@ -106,10 +109,13 @@ TEST(Instruction, PropertiesOf45cc) { TEST(Instruction, PropertiesOf4rcc) { uint16_t instruction[4]; - Build4rcc(4u /* num_vregs */, 16u /* method_idx */, 32u /* proto_idx */, - 0xcafe /* arg_regs */, instruction); + Build4rcc(/* num_args= */ 4u, + /* method_idx= */ 16u, + /* proto_idx= */ 32u, + /* arg_regs_start= */ 0xcafe, + instruction); - DexInstructionIterator ins(instruction, /*dex_pc*/ 0u); + DexInstructionIterator ins(instruction, /*dex_pc=*/ 0u); ASSERT_EQ(4u, ins->SizeInCodeUnits()); ASSERT_TRUE(ins->HasVRegA()); diff --git a/libdexfile/dex/type_lookup_table.cc b/libdexfile/dex/type_lookup_table.cc index 00ec358b02..7d80a2e7f7 100644 --- a/libdexfile/dex/type_lookup_table.cc +++ b/libdexfile/dex/type_lookup_table.cc @@ -94,7 +94,7 @@ TypeLookupTable TypeLookupTable::Open(const uint8_t* dex_data_pointer, DCHECK_ALIGNED(raw_data, alignof(Entry)); const Entry* entries = reinterpret_cast<const Entry*>(raw_data); size_t mask_bits = CalculateMaskBits(num_class_defs); - return TypeLookupTable(dex_data_pointer, mask_bits, entries, /* owned_entries */ nullptr); + return TypeLookupTable(dex_data_pointer, mask_bits, entries, /* owned_entries= */ nullptr); } uint32_t TypeLookupTable::Lookup(const char* str, uint32_t hash) const { |
