diff options
author | 2018-09-20 15:05:17 +0000 | |
---|---|---|
committer | 2018-09-20 15:05:17 +0000 | |
commit | ee07743e03042c2ca36e0c9513847a9e7d2509f1 (patch) | |
tree | 66867d7443a3798f6d882ef2715ddeb7baf3e771 | |
parent | 9a20ff06f7ccee08a742c315ec6d351ab56ba1cd (diff) |
Revert "ART: Refactor typedef to using"
This reverts commit 9a20ff06f7ccee08a742c315ec6d351ab56ba1cd.
Reason for revert: Attributes on the wrong side.
Bug: 32619234
Change-Id: I8fd2abef619b22c02ccfbf5ae629339f1a60918b
46 files changed, 153 insertions, 151 deletions
diff --git a/build/Android.bp b/build/Android.bp index 3eb4aaff79..5f64c2d9f7 100644 --- a/build/Android.bp +++ b/build/Android.bp @@ -23,7 +23,6 @@ art_clang_tidy_errors = [ "bugprone-virtual-near-miss", "modernize-use-bool-literals", "modernize-use-nullptr", - "modernize-use-using", "performance-faster-string-find", "performance-for-range-copy", "performance-implicit-conversion-in-loop", @@ -38,7 +37,6 @@ art_clang_tidy_errors_str = "bugprone-lambda-function-name" + ",modernize-redundant-void-arg" + ",modernize-use-bool-literals" + ",modernize-use-nullptr" - + ",modernize-use-using" + ",performance-faster-string-find" + ",performance-for-range-copy" + ",performance-implicit-conversion-in-loop" diff --git a/compiler/dex/inline_method_analyser.cc b/compiler/dex/inline_method_analyser.cc index 183173b298..fe8b766d0f 100644 --- a/compiler/dex/inline_method_analyser.cc +++ b/compiler/dex/inline_method_analyser.cc @@ -41,7 +41,7 @@ namespace { // anonymous namespace class Matcher { public: // Match function type. - using MatchFn = bool(Matcher*); + typedef bool MatchFn(Matcher* matcher); template <size_t size> static bool Match(const CodeItemDataAccessor* code_item, MatchFn* const (&pattern)[size]); diff --git a/compiler/optimizing/code_generator_x86.cc b/compiler/optimizing/code_generator_x86.cc index 7b8f18873d..6a27081dab 100644 --- a/compiler/optimizing/code_generator_x86.cc +++ b/compiler/optimizing/code_generator_x86.cc @@ -8301,7 +8301,7 @@ void CodeGeneratorX86::PatchJitRootUse(uint8_t* code, uint32_t code_offset = info.label.Position() - kLabelPositionToLiteralOffsetAdjustment; uintptr_t address = reinterpret_cast<uintptr_t>(roots_data) + index_in_table * sizeof(GcRoot<mirror::Object>); - using unaligned_uint32_t = __attribute__((__aligned__(1))) uint32_t; + typedef __attribute__((__aligned__(1))) uint32_t unaligned_uint32_t; reinterpret_cast<unaligned_uint32_t*>(code + code_offset)[0] = dchecked_integral_cast<uint32_t>(address); } diff --git a/compiler/optimizing/code_generator_x86_64.cc b/compiler/optimizing/code_generator_x86_64.cc index bed4ccb3cf..489652b85b 100644 --- a/compiler/optimizing/code_generator_x86_64.cc +++ b/compiler/optimizing/code_generator_x86_64.cc @@ -7542,7 +7542,7 @@ void CodeGeneratorX86_64::PatchJitRootUse(uint8_t* code, uint32_t code_offset = info.label.Position() - kLabelPositionToLiteralOffsetAdjustment; uintptr_t address = reinterpret_cast<uintptr_t>(roots_data) + index_in_table * sizeof(GcRoot<mirror::Object>); - using unaligned_uint32_t = __attribute__((__aligned__(1))) uint32_t; + typedef __attribute__((__aligned__(1))) uint32_t unaligned_uint32_t; reinterpret_cast<unaligned_uint32_t*>(code + code_offset)[0] = dchecked_integral_cast<uint32_t>(address); } diff --git a/compiler/optimizing/graph_visualizer.cc b/compiler/optimizing/graph_visualizer.cc index d45653c6e4..31db8c205f 100644 --- a/compiler/optimizing/graph_visualizer.cc +++ b/compiler/optimizing/graph_visualizer.cc @@ -106,7 +106,8 @@ std::ostream& operator<<(std::ostream& os, const StringList& list) { } } -using create_disasm_prototype = Disassembler*(InstructionSet, DisassemblerOptions*); +typedef Disassembler* create_disasm_prototype(InstructionSet instruction_set, + DisassemblerOptions* options); class HGraphVisualizerDisassembler { public: HGraphVisualizerDisassembler(InstructionSet instruction_set, diff --git a/compiler/optimizing/parallel_move_test.cc b/compiler/optimizing/parallel_move_test.cc index a8ab6cdd0c..399a6d8cbd 100644 --- a/compiler/optimizing/parallel_move_test.cc +++ b/compiler/optimizing/parallel_move_test.cc @@ -174,8 +174,8 @@ class ParallelMoveTest : public ::testing::Test { template<> const bool ParallelMoveTest<TestParallelMoveResolverWithSwap>::has_swap = true; template<> const bool ParallelMoveTest<TestParallelMoveResolverNoSwap>::has_swap = false; -using ParallelMoveResolverTestTypes = - ::testing::Types<TestParallelMoveResolverWithSwap, TestParallelMoveResolverNoSwap>; +typedef ::testing::Types<TestParallelMoveResolverWithSwap, TestParallelMoveResolverNoSwap> + ParallelMoveResolverTestTypes; TYPED_TEST_CASE(ParallelMoveTest, ParallelMoveResolverTestTypes); diff --git a/compiler/utils/mips/assembler_mips.cc b/compiler/utils/mips/assembler_mips.cc index 65d3031b67..c0b6f988d4 100644 --- a/compiler/utils/mips/assembler_mips.cc +++ b/compiler/utils/mips/assembler_mips.cc @@ -179,7 +179,7 @@ void MipsAssembler::PatchCFI(size_t number_of_delayed_adjust_pcs) { return; } - using DelayedAdvancePC = DebugFrameOpCodeWriterForAssembler::DelayedAdvancePC; + typedef DebugFrameOpCodeWriterForAssembler::DelayedAdvancePC DelayedAdvancePC; const auto data = cfi().ReleaseStreamAndPrepareForDelayedAdvancePC(); const std::vector<uint8_t>& old_stream = data.first; const std::vector<DelayedAdvancePC>& advances = data.second; diff --git a/compiler/utils/mips/assembler_mips32r5_test.cc b/compiler/utils/mips/assembler_mips32r5_test.cc index 98fc44ba5d..bd73c12dc5 100644 --- a/compiler/utils/mips/assembler_mips32r5_test.cc +++ b/compiler/utils/mips/assembler_mips32r5_test.cc @@ -38,12 +38,12 @@ class AssemblerMIPS32r5Test : public AssemblerTest<mips::MipsAssembler, uint32_t, mips::VectorRegister> { public: - using Base = AssemblerTest<mips::MipsAssembler, - mips::MipsLabel, - mips::Register, - mips::FRegister, - uint32_t, - mips::VectorRegister>; + typedef AssemblerTest<mips::MipsAssembler, + mips::MipsLabel, + mips::Register, + mips::FRegister, + uint32_t, + mips::VectorRegister> Base; // These tests were taking too long, so we hide the DriverStr() from AssemblerTest<> // and reimplement it without the verification against `assembly_string`. b/73903608 diff --git a/compiler/utils/mips/assembler_mips32r6_test.cc b/compiler/utils/mips/assembler_mips32r6_test.cc index 723c489f21..9637c25e7e 100644 --- a/compiler/utils/mips/assembler_mips32r6_test.cc +++ b/compiler/utils/mips/assembler_mips32r6_test.cc @@ -38,12 +38,12 @@ class AssemblerMIPS32r6Test : public AssemblerTest<mips::MipsAssembler, uint32_t, mips::VectorRegister> { public: - using Base = AssemblerTest<mips::MipsAssembler, - mips::MipsLabel, - mips::Register, - mips::FRegister, - uint32_t, - mips::VectorRegister>; + typedef AssemblerTest<mips::MipsAssembler, + mips::MipsLabel, + mips::Register, + mips::FRegister, + uint32_t, + mips::VectorRegister> Base; // These tests were taking too long, so we hide the DriverStr() from AssemblerTest<> // and reimplement it without the verification against `assembly_string`. b/73903608 diff --git a/compiler/utils/mips/assembler_mips_test.cc b/compiler/utils/mips/assembler_mips_test.cc index 4f8ccee2c2..f137c60eb8 100644 --- a/compiler/utils/mips/assembler_mips_test.cc +++ b/compiler/utils/mips/assembler_mips_test.cc @@ -37,11 +37,11 @@ class AssemblerMIPSTest : public AssemblerTest<mips::MipsAssembler, mips::FRegister, uint32_t> { public: - using Base = AssemblerTest<mips::MipsAssembler, - mips::MipsLabel, - mips::Register, - mips::FRegister, - uint32_t>; + typedef AssemblerTest<mips::MipsAssembler, + mips::MipsLabel, + mips::Register, + mips::FRegister, + uint32_t> Base; // These tests were taking too long, so we hide the DriverStr() from AssemblerTest<> // and reimplement it without the verification against `assembly_string`. b/73903608 diff --git a/compiler/utils/mips64/assembler_mips64.cc b/compiler/utils/mips64/assembler_mips64.cc index a6f807d1e5..5b1c5d9e01 100644 --- a/compiler/utils/mips64/assembler_mips64.cc +++ b/compiler/utils/mips64/assembler_mips64.cc @@ -52,7 +52,7 @@ void Mips64Assembler::PatchCFI() { return; } - using DelayedAdvancePC = DebugFrameOpCodeWriterForAssembler::DelayedAdvancePC; + typedef DebugFrameOpCodeWriterForAssembler::DelayedAdvancePC DelayedAdvancePC; const auto data = cfi().ReleaseStreamAndPrepareForDelayedAdvancePC(); const std::vector<uint8_t>& old_stream = data.first; const std::vector<DelayedAdvancePC>& advances = data.second; diff --git a/compiler/utils/mips64/assembler_mips64_test.cc b/compiler/utils/mips64/assembler_mips64_test.cc index 66711c3210..3218ae3a90 100644 --- a/compiler/utils/mips64/assembler_mips64_test.cc +++ b/compiler/utils/mips64/assembler_mips64_test.cc @@ -41,12 +41,12 @@ class AssemblerMIPS64Test : public AssemblerTest<mips64::Mips64Assembler, uint32_t, mips64::VectorRegister> { public: - using Base = AssemblerTest<mips64::Mips64Assembler, - mips64::Mips64Label, - mips64::GpuRegister, - mips64::FpuRegister, - uint32_t, - mips64::VectorRegister>; + typedef AssemblerTest<mips64::Mips64Assembler, + mips64::Mips64Label, + mips64::GpuRegister, + mips64::FpuRegister, + uint32_t, + mips64::VectorRegister> Base; // These tests were taking too long, so we hide the DriverStr() from AssemblerTest<> // and reimplement it without the verification against `assembly_string`. b/73903608 diff --git a/compiler/utils/x86/assembler_x86_test.cc b/compiler/utils/x86/assembler_x86_test.cc index ad75174d23..b03c40aa3e 100644 --- a/compiler/utils/x86/assembler_x86_test.cc +++ b/compiler/utils/x86/assembler_x86_test.cc @@ -44,11 +44,11 @@ class AssemblerX86Test : public AssemblerTest<x86::X86Assembler, x86::XmmRegister, x86::Immediate> { public: - using Base = AssemblerTest<x86::X86Assembler, - x86::Address, - x86::Register, - x86::XmmRegister, - x86::Immediate>; + typedef AssemblerTest<x86::X86Assembler, + x86::Address, + x86::Register, + x86::XmmRegister, + x86::Immediate> Base; protected: std::string GetArchitectureString() override { diff --git a/compiler/utils/x86_64/assembler_x86_64_test.cc b/compiler/utils/x86_64/assembler_x86_64_test.cc index fe42f9b19b..65711e0855 100644 --- a/compiler/utils/x86_64/assembler_x86_64_test.cc +++ b/compiler/utils/x86_64/assembler_x86_64_test.cc @@ -137,11 +137,11 @@ class AssemblerX86_64Test : public AssemblerTest<x86_64::X86_64Assembler, x86_64::XmmRegister, x86_64::Immediate> { public: - using Base = AssemblerTest<x86_64::X86_64Assembler, - x86_64::Address, - x86_64::CpuRegister, - x86_64::XmmRegister, - x86_64::Immediate>; + typedef AssemblerTest<x86_64::X86_64Assembler, + x86_64::Address, + x86_64::CpuRegister, + x86_64::XmmRegister, + x86_64::Immediate> Base; protected: // Get the typically used name for this architecture, e.g., aarch64, x86-64, ... diff --git a/dex2oat/linker/elf_writer_test.cc b/dex2oat/linker/elf_writer_test.cc index e7db70c49e..ef85fd16ff 100644 --- a/dex2oat/linker/elf_writer_test.cc +++ b/dex2oat/linker/elf_writer_test.cc @@ -164,7 +164,7 @@ TEST_F(ElfWriterTest, EncodeDecodeOatPatches) { // Patch manually. std::vector<uint8_t> expected = initial_data; for (uintptr_t location : patch_locations) { - using UnalignedAddress = __attribute__((__aligned__(1))) uint32_t; + typedef __attribute__((__aligned__(1))) uint32_t UnalignedAddress; *reinterpret_cast<UnalignedAddress*>(expected.data() + location) += delta; } diff --git a/dex2oat/linker/oat_writer.cc b/dex2oat/linker/oat_writer.cc index 7e8346b760..e89de84739 100644 --- a/dex2oat/linker/oat_writer.cc +++ b/dex2oat/linker/oat_writer.cc @@ -92,10 +92,10 @@ static constexpr bool kOatWriterForceOatCodeLayout = false; static constexpr bool kOatWriterDebugOatCodeLayout = false; -using UnalignedDexFileHeader = __attribute__((aligned(1))) DexFile::Header; +typedef DexFile::Header __attribute__((aligned(1))) UnalignedDexFileHeader; const UnalignedDexFileHeader* AsUnalignedDexFileHeader(const uint8_t* raw_data) { - return reinterpret_cast<const UnalignedDexFileHeader*>(raw_data); + return reinterpret_cast<const UnalignedDexFileHeader*>(raw_data); } class ChecksumUpdatingOutputStream : public OutputStream { diff --git a/dex2oat/linker/x86/relative_patcher_x86_base.cc b/dex2oat/linker/x86/relative_patcher_x86_base.cc index 0b24e83073..6a9690d768 100644 --- a/dex2oat/linker/x86/relative_patcher_x86_base.cc +++ b/dex2oat/linker/x86/relative_patcher_x86_base.cc @@ -50,7 +50,7 @@ void X86BaseRelativePatcher::PatchCall(std::vector<uint8_t>* code, uint32_t displacement = target_offset - patch_offset; displacement -= kPcDisplacement; // The base PC is at the end of the 4-byte patch. - using unaligned_int32_t = __attribute__((__aligned__(1))) int32_t; + typedef __attribute__((__aligned__(1))) int32_t unaligned_int32_t; reinterpret_cast<unaligned_int32_t*>(&(*code)[literal_offset])[0] = displacement; } diff --git a/dex2oat/linker/x86_64/relative_patcher_x86_64.cc b/dex2oat/linker/x86_64/relative_patcher_x86_64.cc index d391ba3687..9633564999 100644 --- a/dex2oat/linker/x86_64/relative_patcher_x86_64.cc +++ b/dex2oat/linker/x86_64/relative_patcher_x86_64.cc @@ -31,7 +31,7 @@ void X86_64RelativePatcher::PatchPcRelativeReference(std::vector<uint8_t>* code, uint32_t displacement = target_offset - patch_offset; displacement -= kPcDisplacement; // The base PC is at the end of the 4-byte patch. - using unaligned_int32_t = __attribute__((__aligned__(1))) int32_t; + typedef __attribute__((__aligned__(1))) int32_t unaligned_int32_t; reinterpret_cast<unaligned_int32_t*>(&(*code)[patch.LiteralOffset()])[0] = displacement; } diff --git a/dexdump/dexdump.cc b/dexdump/dexdump.cc index 1d6112f2e8..2cf05678c6 100644 --- a/dexdump/dexdump.cc +++ b/dexdump/dexdump.cc @@ -69,14 +69,14 @@ FILE* gOutFile = stdout; /* * Data types that match the definitions in the VM specification. */ -using u1 = uint8_t; -using u2 = uint16_t; -using u4 = uint32_t; -using u8 = uint64_t; -using s1 = int8_t; -using s2 = int16_t; -using s4 = int32_t; -using s8 = int64_t; +typedef uint8_t u1; +typedef uint16_t u2; +typedef uint32_t u4; +typedef uint64_t u8; +typedef int8_t s1; +typedef int16_t s2; +typedef int32_t s4; +typedef int64_t s8; /* * Basic information about a field or a method. diff --git a/dexlist/dexlist.cc b/dexlist/dexlist.cc index 067daa7842..23be19dd2e 100644 --- a/dexlist/dexlist.cc +++ b/dexlist/dexlist.cc @@ -55,9 +55,9 @@ static FILE* gOutFile = stdout; /* * Data types that match the definitions in the VM specification. */ -using u1 = uint8_t; -using u4 = uint32_t; -using u8 = uint64_t; +typedef uint8_t u1; +typedef uint32_t u4; +typedef uint64_t u8; /* * Returns a newly-allocated string for the "dot version" of the class diff --git a/disassembler/disassembler_arm.cc b/disassembler/disassembler_arm.cc index 4a0c027f61..c1a6f59341 100644 --- a/disassembler/disassembler_arm.cc +++ b/disassembler/disassembler_arm.cc @@ -137,12 +137,12 @@ class DisassemblerArm::CustomDisassembler final : public PrintDisassembler { void DisassemblerArm::CustomDisassembler::CustomDisassemblerStream::PrintLiteral(LocationType type, int32_t offset) { // Literal offsets are not required to be aligned, so we may need unaligned access. - using unaligned_int16_t = const int16_t __attribute__ ((aligned (1))); - using unaligned_uint16_t = const uint16_t __attribute__ ((aligned (1))); - using unaligned_int32_t = const int32_t __attribute__ ((aligned (1))); - using unaligned_int64_t = const int64_t __attribute__ ((aligned (1))); - using unaligned_float = const float __attribute__ ((aligned (1))); - using unaligned_double = const double __attribute__ ((aligned (1))); + typedef const int16_t unaligned_int16_t __attribute__ ((aligned (1))); + typedef const uint16_t unaligned_uint16_t __attribute__ ((aligned (1))); + typedef const int32_t unaligned_int32_t __attribute__ ((aligned (1))); + typedef const int64_t unaligned_int64_t __attribute__ ((aligned (1))); + typedef const float unaligned_float __attribute__ ((aligned (1))); + typedef const double unaligned_double __attribute__ ((aligned (1))); // Zeros are used for the LocationType values this function does not care about. const size_t literal_size[kVst4Location + 1] = { diff --git a/libdexfile/dex/dex_file_loader.cc b/libdexfile/dex/dex_file_loader.cc index 4aafc665ee..400c32b519 100644 --- a/libdexfile/dex/dex_file_loader.cc +++ b/libdexfile/dex/dex_file_loader.cc @@ -25,6 +25,10 @@ #include "standard_dex_file.h" #include "ziparchive/zip_archive.h" +// system/core/zip_archive definitions. +struct ZipEntry; +typedef void* ZipArchiveHandle; + namespace art { namespace { diff --git a/oatdump/oatdump.cc b/oatdump/oatdump.cc index d30ec3157d..707fc1c9ed 100644 --- a/oatdump/oatdump.cc +++ b/oatdump/oatdump.cc @@ -419,7 +419,7 @@ class OatDumper { return instruction_set_; } - using DexFileUniqV = std::vector<std::unique_ptr<const DexFile>>; + typedef std::vector<std::unique_ptr<const DexFile>> DexFileUniqV; bool Dump(std::ostream& os) { bool success = true; @@ -2480,7 +2480,7 @@ class ImageDumper { size_t bytes; size_t count; }; - using SizeAndCountTable = SafeMap<std::string, SizeAndCount>; + typedef SafeMap<std::string, SizeAndCount> SizeAndCountTable; SizeAndCountTable sizes_and_counts; void Update(const char* descriptor, size_t object_bytes_in) { diff --git a/runtime/base/mutex.cc b/runtime/base/mutex.cc index b2ddff3f6a..28b29125cd 100644 --- a/runtime/base/mutex.cc +++ b/runtime/base/mutex.cc @@ -227,15 +227,18 @@ void BaseMutex::DumpAll(std::ostream& os) { // No mutexes have been created yet during at startup. return; } + typedef std::set<BaseMutex*>::const_iterator It; os << "(Contended)\n"; - for (const BaseMutex* mutex : *all_mutexes) { + for (It it = all_mutexes->begin(); it != all_mutexes->end(); ++it) { + BaseMutex* mutex = *it; if (mutex->HasEverContended()) { mutex->Dump(os); os << "\n"; } } os << "(Never contented)\n"; - for (const BaseMutex* mutex : *all_mutexes) { + for (It it = all_mutexes->begin(); it != all_mutexes->end(); ++it) { + BaseMutex* mutex = *it; if (!mutex->HasEverContended()) { mutex->Dump(os); os << "\n"; diff --git a/runtime/class_linker.cc b/runtime/class_linker.cc index d9daae7b21..befeea463a 100644 --- a/runtime/class_linker.cc +++ b/runtime/class_linker.cc @@ -307,7 +307,7 @@ struct FieldGapsComparator { return lhs.size < rhs.size || (lhs.size == rhs.size && lhs.start_offset > rhs.start_offset); } }; -using FieldGaps = std::priority_queue<FieldGap, std::vector<FieldGap>, FieldGapsComparator>; +typedef std::priority_queue<FieldGap, std::vector<FieldGap>, FieldGapsComparator> FieldGaps; // Adds largest aligned gaps to queue of gaps. static void AddFieldGap(uint32_t gap_start, uint32_t gap_end, FieldGaps* gaps) { @@ -2301,7 +2301,7 @@ ObjPtr<mirror::Class> ClassLinker::EnsureResolved(Thread* self, return klass; } -using ClassPathEntry = std::pair<const DexFile*, const DexFile::ClassDef*>; +typedef std::pair<const DexFile*, const DexFile::ClassDef*> ClassPathEntry; // Search a collection of DexFiles for a descriptor ClassPathEntry FindInClassPath(const char* descriptor, diff --git a/runtime/elf_file.cc b/runtime/elf_file.cc index 4277f0093f..e7715c4934 100644 --- a/runtime/elf_file.cc +++ b/runtime/elf_file.cc @@ -1417,7 +1417,7 @@ template <typename ElfTypes> void ElfFileImpl<ElfTypes>::ApplyOatPatches( const uint8_t* patches, const uint8_t* patches_end, Elf_Addr delta, uint8_t* to_patch, const uint8_t* to_patch_end) { - using UnalignedAddress = __attribute__((__aligned__(1))) Elf_Addr; + typedef __attribute__((__aligned__(1))) Elf_Addr UnalignedAddress; while (patches < patches_end) { to_patch += DecodeUnsignedLeb128(&patches); DCHECK_LE(patches, patches_end) << "Unexpected end of patch list."; diff --git a/runtime/hprof/hprof.cc b/runtime/hprof/hprof.cc index 9467c4c952..e8a47d1087 100644 --- a/runtime/hprof/hprof.cc +++ b/runtime/hprof/hprof.cc @@ -148,11 +148,11 @@ enum HprofBasicType { hprof_basic_long = 11, }; -using HprofStringId = uint32_t; -using HprofClassObjectId = uint32_t; -using HprofClassSerialNumber = uint32_t; -using HprofStackTraceSerialNumber = uint32_t; -using HprofStackFrameId = uint32_t; +typedef uint32_t HprofStringId; +typedef uint32_t HprofClassObjectId; +typedef uint32_t HprofClassSerialNumber; +typedef uint32_t HprofStackTraceSerialNumber; +typedef uint32_t HprofStackFrameId; static constexpr HprofStackTraceSerialNumber kHprofNullStackTrace = 0; class EndianOutput { diff --git a/runtime/interpreter/interpreter.cc b/runtime/interpreter/interpreter.cc index df66061d01..048c6e4d66 100644 --- a/runtime/interpreter/interpreter.cc +++ b/runtime/interpreter/interpreter.cc @@ -56,7 +56,7 @@ static void InterpreterJni(Thread* self, ScopedObjectAccessUnchecked soa(self); if (method->IsStatic()) { if (shorty == "L") { - using fntype = jobject(JNIEnv*, jclass); + typedef jobject (fntype)(JNIEnv*, jclass); fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni()); ScopedLocalRef<jclass> klass(soa.Env(), soa.AddLocalReference<jclass>(method->GetDeclaringClass())); @@ -67,35 +67,35 @@ static void InterpreterJni(Thread* self, } result->SetL(soa.Decode<mirror::Object>(jresult)); } else if (shorty == "V") { - using fntype = void(JNIEnv*, jclass); + typedef void (fntype)(JNIEnv*, jclass); fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni()); ScopedLocalRef<jclass> klass(soa.Env(), soa.AddLocalReference<jclass>(method->GetDeclaringClass())); ScopedThreadStateChange tsc(self, kNative); fn(soa.Env(), klass.get()); } else if (shorty == "Z") { - using fntype = jboolean(JNIEnv*, jclass); + typedef jboolean (fntype)(JNIEnv*, jclass); fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni()); ScopedLocalRef<jclass> klass(soa.Env(), soa.AddLocalReference<jclass>(method->GetDeclaringClass())); ScopedThreadStateChange tsc(self, kNative); result->SetZ(fn(soa.Env(), klass.get())); } else if (shorty == "BI") { - using fntype = jbyte(JNIEnv*, jclass, jint); + typedef jbyte (fntype)(JNIEnv*, jclass, jint); fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni()); ScopedLocalRef<jclass> klass(soa.Env(), soa.AddLocalReference<jclass>(method->GetDeclaringClass())); ScopedThreadStateChange tsc(self, kNative); result->SetB(fn(soa.Env(), klass.get(), args[0])); } else if (shorty == "II") { - using fntype = jint(JNIEnv*, jclass, jint); + typedef jint (fntype)(JNIEnv*, jclass, jint); fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni()); ScopedLocalRef<jclass> klass(soa.Env(), soa.AddLocalReference<jclass>(method->GetDeclaringClass())); ScopedThreadStateChange tsc(self, kNative); result->SetI(fn(soa.Env(), klass.get(), args[0])); } else if (shorty == "LL") { - using fntype = jobject(JNIEnv*, jclass, jobject); + typedef jobject (fntype)(JNIEnv*, jclass, jobject); fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni()); ScopedLocalRef<jclass> klass(soa.Env(), soa.AddLocalReference<jclass>(method->GetDeclaringClass())); @@ -108,14 +108,14 @@ static void InterpreterJni(Thread* self, } result->SetL(soa.Decode<mirror::Object>(jresult)); } else if (shorty == "IIZ") { - using fntype = jint(JNIEnv*, jclass, jint, jboolean); + typedef jint (fntype)(JNIEnv*, jclass, jint, jboolean); fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni()); ScopedLocalRef<jclass> klass(soa.Env(), soa.AddLocalReference<jclass>(method->GetDeclaringClass())); ScopedThreadStateChange tsc(self, kNative); result->SetI(fn(soa.Env(), klass.get(), args[0], args[1])); } else if (shorty == "ILI") { - using fntype = jint(JNIEnv*, jclass, jobject, jint); + typedef jint (fntype)(JNIEnv*, jclass, jobject, jint); fntype* const fn = reinterpret_cast<fntype*>(const_cast<void*>( method->GetEntryPointFromJni())); ScopedLocalRef<jclass> klass(soa.Env(), @@ -125,7 +125,7 @@ static void InterpreterJni(Thread* self, ScopedThreadStateChange tsc(self, kNative); result->SetI(fn(soa.Env(), klass.get(), arg0.get(), args[1])); } else if (shorty == "SIZ") { - using fntype = jshort(JNIEnv*, jclass, jint, jboolean); + typedef jshort (fntype)(JNIEnv*, jclass, jint, jboolean); fntype* const fn = reinterpret_cast<fntype*>(const_cast<void*>(method->GetEntryPointFromJni())); ScopedLocalRef<jclass> klass(soa.Env(), @@ -133,14 +133,14 @@ static void InterpreterJni(Thread* self, ScopedThreadStateChange tsc(self, kNative); result->SetS(fn(soa.Env(), klass.get(), args[0], args[1])); } else if (shorty == "VIZ") { - using fntype = void(JNIEnv*, jclass, jint, jboolean); + typedef void (fntype)(JNIEnv*, jclass, jint, jboolean); fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni()); ScopedLocalRef<jclass> klass(soa.Env(), soa.AddLocalReference<jclass>(method->GetDeclaringClass())); ScopedThreadStateChange tsc(self, kNative); fn(soa.Env(), klass.get(), args[0], args[1]); } else if (shorty == "ZLL") { - using fntype = jboolean(JNIEnv*, jclass, jobject, jobject); + typedef jboolean (fntype)(JNIEnv*, jclass, jobject, jobject); fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni()); ScopedLocalRef<jclass> klass(soa.Env(), soa.AddLocalReference<jclass>(method->GetDeclaringClass())); @@ -151,7 +151,7 @@ static void InterpreterJni(Thread* self, ScopedThreadStateChange tsc(self, kNative); result->SetZ(fn(soa.Env(), klass.get(), arg0.get(), arg1.get())); } else if (shorty == "ZILL") { - using fntype = jboolean(JNIEnv*, jclass, jint, jobject, jobject); + typedef jboolean (fntype)(JNIEnv*, jclass, jint, jobject, jobject); fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni()); ScopedLocalRef<jclass> klass(soa.Env(), soa.AddLocalReference<jclass>(method->GetDeclaringClass())); @@ -162,7 +162,7 @@ static void InterpreterJni(Thread* self, ScopedThreadStateChange tsc(self, kNative); result->SetZ(fn(soa.Env(), klass.get(), args[0], arg1.get(), arg2.get())); } else if (shorty == "VILII") { - using fntype = void(JNIEnv*, jclass, jint, jobject, jint, jint); + typedef void (fntype)(JNIEnv*, jclass, jint, jobject, jint, jint); fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni()); ScopedLocalRef<jclass> klass(soa.Env(), soa.AddLocalReference<jclass>(method->GetDeclaringClass())); @@ -171,7 +171,7 @@ static void InterpreterJni(Thread* self, ScopedThreadStateChange tsc(self, kNative); fn(soa.Env(), klass.get(), args[0], arg1.get(), args[2], args[3]); } else if (shorty == "VLILII") { - using fntype = void(JNIEnv*, jclass, jobject, jint, jobject, jint, jint); + typedef void (fntype)(JNIEnv*, jclass, jobject, jint, jobject, jint, jint); fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni()); ScopedLocalRef<jclass> klass(soa.Env(), soa.AddLocalReference<jclass>(method->GetDeclaringClass())); @@ -187,7 +187,7 @@ static void InterpreterJni(Thread* self, } } else { if (shorty == "L") { - using fntype = jobject(JNIEnv*, jobject); + typedef jobject (fntype)(JNIEnv*, jobject); fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni()); ScopedLocalRef<jobject> rcvr(soa.Env(), soa.AddLocalReference<jobject>(receiver)); @@ -198,14 +198,14 @@ static void InterpreterJni(Thread* self, } result->SetL(soa.Decode<mirror::Object>(jresult)); } else if (shorty == "V") { - using fntype = void(JNIEnv*, jobject); + typedef void (fntype)(JNIEnv*, jobject); fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni()); ScopedLocalRef<jobject> rcvr(soa.Env(), soa.AddLocalReference<jobject>(receiver)); ScopedThreadStateChange tsc(self, kNative); fn(soa.Env(), rcvr.get()); } else if (shorty == "LL") { - using fntype = jobject(JNIEnv*, jobject, jobject); + typedef jobject (fntype)(JNIEnv*, jobject, jobject); fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni()); ScopedLocalRef<jobject> rcvr(soa.Env(), soa.AddLocalReference<jobject>(receiver)); @@ -219,7 +219,7 @@ static void InterpreterJni(Thread* self, result->SetL(soa.Decode<mirror::Object>(jresult)); ScopedThreadStateChange tsc(self, kNative); } else if (shorty == "III") { - using fntype = jint(JNIEnv*, jobject, jint, jint); + typedef jint (fntype)(JNIEnv*, jobject, jint, jint); fntype* const fn = reinterpret_cast<fntype*>(method->GetEntryPointFromJni()); ScopedLocalRef<jobject> rcvr(soa.Env(), soa.AddLocalReference<jobject>(receiver)); diff --git a/runtime/interpreter/unstarted_runtime.cc b/runtime/interpreter/unstarted_runtime.cc index 78cb649f5c..d4b51af903 100644 --- a/runtime/interpreter/unstarted_runtime.cc +++ b/runtime/interpreter/unstarted_runtime.cc @@ -1180,19 +1180,19 @@ static void UnstartedMemoryPeek( } case Primitive::kPrimShort: { - using unaligned_short = int16_t __attribute__ ((aligned (1))); + typedef int16_t unaligned_short __attribute__ ((aligned (1))); result->SetS(*reinterpret_cast<unaligned_short*>(static_cast<intptr_t>(address))); return; } case Primitive::kPrimInt: { - using unaligned_int = int32_t __attribute__ ((aligned (1))); + typedef int32_t unaligned_int __attribute__ ((aligned (1))); result->SetI(*reinterpret_cast<unaligned_int*>(static_cast<intptr_t>(address))); return; } case Primitive::kPrimLong: { - using unaligned_long = int64_t __attribute__ ((aligned (1))); + typedef int64_t unaligned_long __attribute__ ((aligned (1))); result->SetJ(*reinterpret_cast<unaligned_long*>(static_cast<intptr_t>(address))); return; } @@ -1919,16 +1919,11 @@ void UnstartedRuntime::UnstartedJNIUnsafeGetArrayIndexScaleForComponentType( result->SetI(Primitive::ComponentSize(primitive_type)); } -using InvokeHandler = void(*)(Thread* self, - ShadowFrame* shadow_frame, - JValue* result, - size_t arg_size); +typedef void (*InvokeHandler)(Thread* self, ShadowFrame* shadow_frame, JValue* result, + size_t arg_size); -using JNIHandler = void(*)(Thread* self, - ArtMethod* method, - mirror::Object* receiver, - uint32_t* args, - JValue* result); +typedef void (*JNIHandler)(Thread* self, ArtMethod* method, mirror::Object* receiver, + uint32_t* args, JValue* result); static bool tables_initialized_ = false; static std::unordered_map<std::string, InvokeHandler> invoke_handlers_; diff --git a/runtime/interpreter/unstarted_runtime_test.cc b/runtime/interpreter/unstarted_runtime_test.cc index 38195b4911..200fc5b334 100644 --- a/runtime/interpreter/unstarted_runtime_test.cc +++ b/runtime/interpreter/unstarted_runtime_test.cc @@ -261,7 +261,7 @@ TEST_F(UnstartedRuntimeTest, MemoryPeekShort) { UnstartedMemoryPeekShort(self, tmp.get(), &result, 0); - using unaligned_short = int16_t __attribute__ ((aligned (1))); + typedef int16_t unaligned_short __attribute__ ((aligned (1))); const unaligned_short* short_ptr = reinterpret_cast<const unaligned_short*>(base_ptr + i); EXPECT_EQ(result.GetS(), *short_ptr); } @@ -284,7 +284,7 @@ TEST_F(UnstartedRuntimeTest, MemoryPeekInt) { UnstartedMemoryPeekInt(self, tmp.get(), &result, 0); - using unaligned_int = int32_t __attribute__ ((aligned (1))); + typedef int32_t unaligned_int __attribute__ ((aligned (1))); const unaligned_int* int_ptr = reinterpret_cast<const unaligned_int*>(base_ptr + i); EXPECT_EQ(result.GetI(), *int_ptr); } @@ -307,7 +307,7 @@ TEST_F(UnstartedRuntimeTest, MemoryPeekLong) { UnstartedMemoryPeekLong(self, tmp.get(), &result, 0); - using unaligned_long = int64_t __attribute__ ((aligned (1))); + typedef int64_t unaligned_long __attribute__ ((aligned (1))); const unaligned_long* long_ptr = reinterpret_cast<const unaligned_long*>(base_ptr + i); EXPECT_EQ(result.GetJ(), *long_ptr); } diff --git a/runtime/jdwp/jdwp_handler.cc b/runtime/jdwp/jdwp_handler.cc index 0a54e38698..1e61ba0f2d 100644 --- a/runtime/jdwp/jdwp_handler.cc +++ b/runtime/jdwp/jdwp_handler.cc @@ -1432,7 +1432,7 @@ static JdwpError DDM_Chunk(JdwpState* state, Request* request, ExpandBuf* pReply /* * Handler map decl. */ -using JdwpRequestHandler = JdwpError(*)(JdwpState* state, Request* request, ExpandBuf* reply); +typedef JdwpError (*JdwpRequestHandler)(JdwpState* state, Request* request, ExpandBuf* reply); struct JdwpHandlerMap { uint8_t cmdSet; diff --git a/runtime/jit/debugger_interface.cc b/runtime/jit/debugger_interface.cc index 6cd719a55c..63fb22cfce 100644 --- a/runtime/jit/debugger_interface.cc +++ b/runtime/jit/debugger_interface.cc @@ -77,11 +77,11 @@ namespace art { extern "C" { - enum JITAction { + typedef enum { JIT_NOACTION = 0, JIT_REGISTER_FN, JIT_UNREGISTER_FN - }; + } JITAction; struct JITCodeEntry { // Atomic to ensure the reader can always iterate over the linked list diff --git a/runtime/jni/java_vm_ext.cc b/runtime/jni/java_vm_ext.cc index 6769368ee4..42406cf73c 100644 --- a/runtime/jni/java_vm_ext.cc +++ b/runtime/jni/java_vm_ext.cc @@ -333,7 +333,7 @@ class Libraries { } ScopedThreadSuspension sts(self, kNative); // Do this without holding the jni libraries lock to prevent possible deadlocks. - using JNI_OnUnloadFn = void(*)(JavaVM*, void*); + typedef void (*JNI_OnUnloadFn)(JavaVM*, void*); for (auto library : unload_libraries) { void* const sym = library->FindSymbol("JNI_OnUnload", nullptr); if (sym == nullptr) { @@ -1026,7 +1026,7 @@ bool JavaVMExt::LoadNativeLibrary(JNIEnv* env, self->SetClassLoaderOverride(class_loader); VLOG(jni) << "[Calling JNI_OnLoad in \"" << path << "\"]"; - using JNI_OnLoadFn = int(*)(JavaVM*, void*); + typedef int (*JNI_OnLoadFn)(JavaVM*, void*); JNI_OnLoadFn jni_on_load = reinterpret_cast<JNI_OnLoadFn>(sym); int version = (*jni_on_load)(this, nullptr); diff --git a/runtime/mirror/object_test.cc b/runtime/mirror/object_test.cc index cf6543fa26..0b615a6b9a 100644 --- a/runtime/mirror/object_test.cc +++ b/runtime/mirror/object_test.cc @@ -204,7 +204,7 @@ TEST_F(ObjectTest, AllocArray_FillUsable) { template<typename ArrayT> void TestPrimitiveArray(ClassLinker* cl) { ScopedObjectAccess soa(Thread::Current()); - using T = typename ArrayT::ElementType; + typedef typename ArrayT::ElementType T; StackHandleScope<2> hs(soa.Self()); Handle<ArrayT> a = hs.NewHandle(ArrayT::Alloc(soa.Self(), 2)); @@ -252,9 +252,9 @@ TEST_F(ObjectTest, PrimitiveArray_Short_Alloc) { } TEST_F(ObjectTest, PrimitiveArray_Double_Alloc) { - using ArrayT = DoubleArray; + typedef DoubleArray ArrayT; ScopedObjectAccess soa(Thread::Current()); - using T = typename ArrayT::ElementType; + typedef typename ArrayT::ElementType T; StackHandleScope<2> hs(soa.Self()); Handle<ArrayT> a = hs.NewHandle(ArrayT::Alloc(soa.Self(), 2)); @@ -283,9 +283,9 @@ TEST_F(ObjectTest, PrimitiveArray_Double_Alloc) { } TEST_F(ObjectTest, PrimitiveArray_Float_Alloc) { - using ArrayT = FloatArray; + typedef FloatArray ArrayT; ScopedObjectAccess soa(Thread::Current()); - using T = typename ArrayT::ElementType; + typedef typename ArrayT::ElementType T; StackHandleScope<2> hs(soa.Self()); Handle<ArrayT> a = hs.NewHandle(ArrayT::Alloc(soa.Self(), 2)); diff --git a/runtime/mirror/var_handle.cc b/runtime/mirror/var_handle.cc index ce794084d1..864e1eab73 100644 --- a/runtime/mirror/var_handle.cc +++ b/runtime/mirror/var_handle.cc @@ -691,7 +691,7 @@ class TypeAdaptorAccessor : public Object::Accessor<T> { template <typename T> class FieldAccessViaAccessor { public: - using Accessor = Object::Accessor<T>; + typedef Object::Accessor<T> Accessor; // Apply an Accessor to get a field in an object. static void Get(ObjPtr<Object> obj, diff --git a/runtime/native/dalvik_system_VMRuntime.cc b/runtime/native/dalvik_system_VMRuntime.cc index b18a048c60..0e619407e5 100644 --- a/runtime/native/dalvik_system_VMRuntime.cc +++ b/runtime/native/dalvik_system_VMRuntime.cc @@ -325,7 +325,7 @@ static void VMRuntime_runHeapTasks(JNIEnv* env, jobject) { Runtime::Current()->GetHeap()->GetTaskProcessor()->RunAllTasks(ThreadForEnv(env)); } -using StringTable = std::map<std::string, ObjPtr<mirror::String>>; +typedef std::map<std::string, ObjPtr<mirror::String>> StringTable; class PreloadDexCachesStringsVisitor : public SingleRootVisitor { public: diff --git a/runtime/oat_file.cc b/runtime/oat_file.cc index 731e4a503a..0579b6e39d 100644 --- a/runtime/oat_file.cc +++ b/runtime/oat_file.cc @@ -410,7 +410,7 @@ inline static bool ReadOatDexFileData(const OatFile& oat_file, return false; } static_assert(std::is_trivial<T>::value, "T must be a trivial type"); - using unaligned_type = __attribute__((__aligned__(1))) T; + typedef __attribute__((__aligned__(1))) T unaligned_type; *value = *reinterpret_cast<const unaligned_type*>(*oat); *oat += sizeof(T); return true; diff --git a/runtime/transaction.cc b/runtime/transaction.cc index 1e5b2bbd4c..c9766bc9ca 100644 --- a/runtime/transaction.cc +++ b/runtime/transaction.cc @@ -320,7 +320,7 @@ void Transaction::VisitRoots(RootVisitor* visitor) { void Transaction::VisitObjectLogs(RootVisitor* visitor) { // List of moving roots. - using ObjectPair = std::pair<mirror::Object*, mirror::Object*>; + typedef std::pair<mirror::Object*, mirror::Object*> ObjectPair; std::list<ObjectPair> moving_roots; // Visit roots. @@ -348,7 +348,7 @@ void Transaction::VisitObjectLogs(RootVisitor* visitor) { void Transaction::VisitArrayLogs(RootVisitor* visitor) { // List of moving roots. - using ArrayPair = std::pair<mirror::Array*, mirror::Array*>; + typedef std::pair<mirror::Array*, mirror::Array*> ArrayPair; std::list<ArrayPair> moving_roots; for (auto& it : array_logs_) { diff --git a/sigchainlib/sigchain_test.cc b/sigchainlib/sigchain_test.cc index bb997877a1..53e1e40454 100644 --- a/sigchainlib/sigchain_test.cc +++ b/sigchainlib/sigchain_test.cc @@ -38,7 +38,7 @@ #include "sigchain.h" #if !defined(__BIONIC__) -using sigset64_t = sigset_t; +typedef sigset_t sigset64_t; static int sigemptyset64(sigset64_t* set) { return sigemptyset(set); diff --git a/simulator/code_simulator_container.cc b/simulator/code_simulator_container.cc index dc553dfe5d..3206bc7844 100644 --- a/simulator/code_simulator_container.cc +++ b/simulator/code_simulator_container.cc @@ -34,13 +34,13 @@ CodeSimulatorContainer::CodeSimulatorContainer(InstructionSet target_isa) if (libart_simulator_handle_ == nullptr) { VLOG(simulator) << "Could not load " << libart_simulator_so_name << ": " << dlerror(); } else { - using CreateCodeSimulatorPtr = CodeSimulator*(*)(InstructionSet); - CreateCodeSimulatorPtr create_code_simulator = - reinterpret_cast<CreateCodeSimulatorPtr>( + typedef CodeSimulator* (*create_code_simulator_ptr_)(InstructionSet target_isa); + create_code_simulator_ptr_ create_code_simulator_ = + reinterpret_cast<create_code_simulator_ptr_>( dlsym(libart_simulator_handle_, "CreateCodeSimulator")); - DCHECK(create_code_simulator != nullptr) << "Fail to find symbol of CreateCodeSimulator: " + DCHECK(create_code_simulator_ != nullptr) << "Fail to find symbol of CreateCodeSimulator: " << dlerror(); - simulator_ = create_code_simulator(target_isa); + simulator_ = create_code_simulator_(target_isa); } } diff --git a/test/004-JniTest/jni_test.cc b/test/004-JniTest/jni_test.cc index d82c526ee3..33a8f5bba2 100644 --- a/test/004-JniTest/jni_test.cc +++ b/test/004-JniTest/jni_test.cc @@ -62,7 +62,7 @@ static void* AttachHelper(void* arg) { int attach_result = jvm->AttachCurrentThread(&env, &args); CHECK_EQ(attach_result, 0); - using Fn = void(*)(JNIEnv*); + typedef void (*Fn)(JNIEnv*); Fn fn = reinterpret_cast<Fn>(arg); fn(env); diff --git a/test/115-native-bridge/nativebridge.cc b/test/115-native-bridge/nativebridge.cc index cc7e806ba5..a74f7638bd 100644 --- a/test/115-native-bridge/nativebridge.cc +++ b/test/115-native-bridge/nativebridge.cc @@ -45,7 +45,7 @@ static const android::NativeBridgeRuntimeCallbacks* gNativeBridgeArtCallbacks; static jint trampoline_JNI_OnLoad(JavaVM* vm, void* reserved) { JNIEnv* env = nullptr; - using FnPtr_t = jint(*)(JavaVM*, void*); + typedef jint (*FnPtr_t)(JavaVM*, void*); FnPtr_t fnPtr = reinterpret_cast<FnPtr_t>(find_native_bridge_method("JNI_OnLoad")->fnPtr); vm->GetEnv(reinterpret_cast<void **>(&env), JNI_VERSION_1_6); @@ -91,8 +91,9 @@ static jint trampoline_JNI_OnLoad(JavaVM* vm, void* reserved) { return fnPtr(vm, reserved); } -static void trampoline_Java_Main_testFindClassOnAttachedNativeThread(JNIEnv* env, jclass klass) { - using FnPtr_t = void(*)(JNIEnv*, jclass); +static void trampoline_Java_Main_testFindClassOnAttachedNativeThread(JNIEnv* env, + jclass klass) { + typedef void (*FnPtr_t)(JNIEnv*, jclass); FnPtr_t fnPtr = reinterpret_cast<FnPtr_t> (find_native_bridge_method("testFindClassOnAttachedNativeThread")->fnPtr); printf("%s called!\n", __FUNCTION__); @@ -101,7 +102,7 @@ static void trampoline_Java_Main_testFindClassOnAttachedNativeThread(JNIEnv* env static void trampoline_Java_Main_testFindFieldOnAttachedNativeThreadNative(JNIEnv* env, jclass klass) { - using FnPtr_t = void(*)(JNIEnv*, jclass); + typedef void (*FnPtr_t)(JNIEnv*, jclass); FnPtr_t fnPtr = reinterpret_cast<FnPtr_t> (find_native_bridge_method("testFindFieldOnAttachedNativeThreadNative")->fnPtr); printf("%s called!\n", __FUNCTION__); @@ -110,7 +111,7 @@ static void trampoline_Java_Main_testFindFieldOnAttachedNativeThreadNative(JNIEn static void trampoline_Java_Main_testCallStaticVoidMethodOnSubClassNative(JNIEnv* env, jclass klass) { - using FnPtr_t = void(*)(JNIEnv*, jclass); + typedef void (*FnPtr_t)(JNIEnv*, jclass); FnPtr_t fnPtr = reinterpret_cast<FnPtr_t> (find_native_bridge_method("testCallStaticVoidMethodOnSubClassNative")->fnPtr); printf("%s called!\n", __FUNCTION__); @@ -118,7 +119,7 @@ static void trampoline_Java_Main_testCallStaticVoidMethodOnSubClassNative(JNIEnv } static jobject trampoline_Java_Main_testGetMirandaMethodNative(JNIEnv* env, jclass klass) { - using FnPtr_t = jobject(*)(JNIEnv*, jclass); + typedef jobject (*FnPtr_t)(JNIEnv*, jclass); FnPtr_t fnPtr = reinterpret_cast<FnPtr_t> (find_native_bridge_method("testGetMirandaMethodNative")->fnPtr); printf("%s called!\n", __FUNCTION__); @@ -126,7 +127,7 @@ static jobject trampoline_Java_Main_testGetMirandaMethodNative(JNIEnv* env, jcla } static void trampoline_Java_Main_testNewStringObject(JNIEnv* env, jclass klass) { - using FnPtr_t = void(*)(JNIEnv*, jclass); + typedef void (*FnPtr_t)(JNIEnv*, jclass); FnPtr_t fnPtr = reinterpret_cast<FnPtr_t> (find_native_bridge_method("testNewStringObject")->fnPtr); printf("%s called!\n", __FUNCTION__); @@ -134,7 +135,7 @@ static void trampoline_Java_Main_testNewStringObject(JNIEnv* env, jclass klass) } static void trampoline_Java_Main_testZeroLengthByteBuffers(JNIEnv* env, jclass klass) { - using FnPtr_t = void(*)(JNIEnv*, jclass); + typedef void (*FnPtr_t)(JNIEnv*, jclass); FnPtr_t fnPtr = reinterpret_cast<FnPtr_t> (find_native_bridge_method("testZeroLengthByteBuffers")->fnPtr); printf("%s called!\n", __FUNCTION__); @@ -144,8 +145,8 @@ static void trampoline_Java_Main_testZeroLengthByteBuffers(JNIEnv* env, jclass k static jbyte trampoline_Java_Main_byteMethod(JNIEnv* env, jclass klass, jbyte b1, jbyte b2, jbyte b3, jbyte b4, jbyte b5, jbyte b6, jbyte b7, jbyte b8, jbyte b9, jbyte b10) { - using FnPtr_t = jbyte(*)(JNIEnv*, jclass, jbyte, jbyte, jbyte, jbyte, jbyte, jbyte, jbyte, jbyte, - jbyte, jbyte); + typedef jbyte (*FnPtr_t)(JNIEnv*, jclass, jbyte, jbyte, jbyte, jbyte, jbyte, + jbyte, jbyte, jbyte, jbyte, jbyte); FnPtr_t fnPtr = reinterpret_cast<FnPtr_t>(find_native_bridge_method("byteMethod")->fnPtr); printf("%s called!\n", __FUNCTION__); return fnPtr(env, klass, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10); @@ -154,8 +155,8 @@ static jbyte trampoline_Java_Main_byteMethod(JNIEnv* env, jclass klass, jbyte b1 static jshort trampoline_Java_Main_shortMethod(JNIEnv* env, jclass klass, jshort s1, jshort s2, jshort s3, jshort s4, jshort s5, jshort s6, jshort s7, jshort s8, jshort s9, jshort s10) { - using FnPtr_t = jshort(*)(JNIEnv*, jclass, jshort, jshort, jshort, jshort, jshort, jshort, jshort, - jshort, jshort, jshort); + typedef jshort (*FnPtr_t)(JNIEnv*, jclass, jshort, jshort, jshort, jshort, jshort, + jshort, jshort, jshort, jshort, jshort); FnPtr_t fnPtr = reinterpret_cast<FnPtr_t>(find_native_bridge_method("shortMethod")->fnPtr); printf("%s called!\n", __FUNCTION__); return fnPtr(env, klass, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10); @@ -165,7 +166,7 @@ static jboolean trampoline_Java_Main_booleanMethod(JNIEnv* env, jclass klass, jb jboolean b2, jboolean b3, jboolean b4, jboolean b5, jboolean b6, jboolean b7, jboolean b8, jboolean b9, jboolean b10) { - using FnPtr_t = jboolean(*)(JNIEnv*, jclass, jboolean, jboolean, jboolean, jboolean, jboolean, + typedef jboolean (*FnPtr_t)(JNIEnv*, jclass, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean, jboolean); FnPtr_t fnPtr = reinterpret_cast<FnPtr_t>(find_native_bridge_method("booleanMethod")->fnPtr); printf("%s called!\n", __FUNCTION__); @@ -175,8 +176,8 @@ static jboolean trampoline_Java_Main_booleanMethod(JNIEnv* env, jclass klass, jb static jchar trampoline_Java_Main_charMethod(JNIEnv* env, jclass klass, jchar c1, jchar c2, jchar c3, jchar c4, jchar c5, jchar c6, jchar c7, jchar c8, jchar c9, jchar c10) { - using FnPtr_t = jchar(*)(JNIEnv*, jclass, jchar, jchar, jchar, jchar, jchar, jchar, jchar, jchar, - jchar, jchar); + typedef jchar (*FnPtr_t)(JNIEnv*, jclass, jchar, jchar, jchar, jchar, jchar, + jchar, jchar, jchar, jchar, jchar); FnPtr_t fnPtr = reinterpret_cast<FnPtr_t>(find_native_bridge_method("charMethod")->fnPtr); printf("%s called!\n", __FUNCTION__); return fnPtr(env, klass, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10); diff --git a/test/1900-track-alloc/alloc.cc b/test/1900-track-alloc/alloc.cc index f2096111da..db5617c54c 100644 --- a/test/1900-track-alloc/alloc.cc +++ b/test/1900-track-alloc/alloc.cc @@ -24,7 +24,7 @@ namespace art { namespace Test1900TrackAlloc { -using GetGlobalState = jvmtiError(*)(jvmtiEnv* env, jlong* allocated); +typedef jvmtiError (*GetGlobalState)(jvmtiEnv* env, jlong* allocated); struct AllocTrackingData { GetGlobalState get_global_state; diff --git a/test/1940-ddms-ext/ddm_ext.cc b/test/1940-ddms-ext/ddm_ext.cc index 452187bdcb..cc29df9a49 100644 --- a/test/1940-ddms-ext/ddm_ext.cc +++ b/test/1940-ddms-ext/ddm_ext.cc @@ -25,7 +25,7 @@ namespace art { namespace Test1940DdmExt { -using DdmHandleChunk = jvmtiError(*)(jvmtiEnv* env, +typedef jvmtiError (*DdmHandleChunk)(jvmtiEnv* env, jint type_in, jint len_in, const jbyte* data_in, diff --git a/test/1946-list-descriptors/descriptors.cc b/test/1946-list-descriptors/descriptors.cc index 07fee6141b..01b306dea5 100644 --- a/test/1946-list-descriptors/descriptors.cc +++ b/test/1946-list-descriptors/descriptors.cc @@ -24,7 +24,7 @@ namespace art { namespace Test1946Descriptors { -using GetDescriptorList = jvmtiError(*)(jvmtiEnv* env, jobject loader, jint* cnt, char*** descs); +typedef jvmtiError (*GetDescriptorList)(jvmtiEnv* env, jobject loader, jint* cnt, char*** descs); struct DescriptorData { GetDescriptorList get_descriptor_list; diff --git a/test/1951-monitor-enter-no-suspend/raw_monitor.cc b/test/1951-monitor-enter-no-suspend/raw_monitor.cc index efd02b6ae4..0425e350fd 100644 --- a/test/1951-monitor-enter-no-suspend/raw_monitor.cc +++ b/test/1951-monitor-enter-no-suspend/raw_monitor.cc @@ -26,7 +26,7 @@ namespace art { namespace Test1951MonitorEnterNoSuspend { -using RawMonitorEnterNoSuspend = jvmtiError(*)(jvmtiEnv* env, jrawMonitorID mon); +typedef jvmtiError (*RawMonitorEnterNoSuspend)(jvmtiEnv* env, jrawMonitorID mon); template <typename T> static void Dealloc(T* t) { |