From: Android Tools Maintainers Date: Tue, 2 Aug 2022 15:23:27 +0000 (+0100) Subject: Add standard namespace scope resolution X-Git-Tag: archive/raspbian/29.0.6-21+rpi1^2~8 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=dffd8747c35cb47082872560750c10f7251f1ab5;p=android-platform-tools.git Add standard namespace scope resolution Forwarded: not-needed Gbp-Pq: Topic art Gbp-Pq: Name method-reference-std-ns.patch --- diff --git a/art/libdexfile/dex/method_reference.h b/art/libdexfile/dex/method_reference.h index ba69984b..6a2ea9c9 100644 --- a/art/libdexfile/dex/method_reference.h +++ b/art/libdexfile/dex/method_reference.h @@ -53,20 +53,20 @@ struct MethodReferenceValueComparator { // Compare the class descriptors first. const dex::MethodId& mid1 = mr1.GetMethodId(); const dex::MethodId& mid2 = mr2.GetMethodId(); - int descriptor_diff = strcmp(mr1.dex_file->StringByTypeIdx(mid1.class_idx_), + int descriptor_diff = std::strcmp(mr1.dex_file->StringByTypeIdx(mid1.class_idx_), mr2.dex_file->StringByTypeIdx(mid2.class_idx_)); if (descriptor_diff != 0) { return descriptor_diff < 0; } // Compare names second. - int name_diff = strcmp(mr1.dex_file->GetMethodName(mid1), mr2.dex_file->GetMethodName(mid2)); + int name_diff = std::strcmp(mr1.dex_file->GetMethodName(mid1), mr2.dex_file->GetMethodName(mid2)); if (name_diff != 0) { return name_diff < 0; } // And then compare proto ids, starting with return type comparison. const dex::ProtoId& prid1 = mr1.dex_file->GetProtoId(mid1.proto_idx_); const dex::ProtoId& prid2 = mr2.dex_file->GetProtoId(mid2.proto_idx_); - int return_type_diff = strcmp(mr1.dex_file->StringByTypeIdx(prid1.return_type_idx_), + int return_type_diff = std::strcmp(mr1.dex_file->StringByTypeIdx(prid1.return_type_idx_), mr2.dex_file->StringByTypeIdx(prid2.return_type_idx_)); if (return_type_diff != 0) { return return_type_diff < 0; @@ -77,7 +77,7 @@ struct MethodReferenceValueComparator { const dex::TypeList* params2 = mr2.dex_file->GetProtoParameters(prid2); size_t param2_size = (params2 != nullptr) ? params2->Size() : 0u; for (size_t i = 0, num = std::min(param1_size, param2_size); i != num; ++i) { - int param_diff = strcmp(mr1.dex_file->StringByTypeIdx(params1->GetTypeItem(i).type_idx_), + int param_diff = std::strcmp(mr1.dex_file->StringByTypeIdx(params1->GetTypeItem(i).type_idx_), mr2.dex_file->StringByTypeIdx(params2->GetTypeItem(i).type_idx_)); if (param_diff != 0) { return param_diff < 0;