From 396a8d91a4423d9c793eeff0798d544613647511 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Sun, 18 Sep 2016 18:01:46 -0700 Subject: Manually tweak source formatting and then re-run clang-format --- src/core/hle/service/ldr_ro/cro_helper.cpp | 47 ++++++++++++++++-------------- src/core/hle/service/ldr_ro/cro_helper.h | 9 ++---- src/core/hle/service/ldr_ro/ldr_ro.cpp | 14 ++++++--- 3 files changed, 38 insertions(+), 32 deletions(-) (limited to 'src/core/hle/service/ldr_ro') diff --git a/src/core/hle/service/ldr_ro/cro_helper.cpp b/src/core/hle/service/ldr_ro/cro_helper.cpp index 5757a4e64..b5da9a960 100644 --- a/src/core/hle/service/ldr_ro/cro_helper.cpp +++ b/src/core/hle/service/ldr_ro/cro_helper.cpp @@ -22,21 +22,23 @@ static ResultCode CROFormatError(u32 description) { ErrorSummary::WrongArgument, ErrorLevel::Permanent); } -const std::array CROHelper::ENTRY_SIZE{ - {1, // code - 1, // data - 1, // module name - sizeof(SegmentEntry), sizeof(ExportNamedSymbolEntry), sizeof(ExportIndexedSymbolEntry), - 1, // export strings - sizeof(ExportTreeEntry), sizeof(ImportModuleEntry), sizeof(ExternalRelocationEntry), - sizeof(ImportNamedSymbolEntry), sizeof(ImportIndexedSymbolEntry), - sizeof(ImportAnonymousSymbolEntry), - 1, // import strings - sizeof(StaticAnonymousSymbolEntry), sizeof(InternalRelocationEntry), - sizeof(StaticRelocationEntry)}}; - -const std::array CROHelper::FIX_BARRIERS{ - {Fix0Barrier, Fix1Barrier, Fix2Barrier, Fix3Barrier}}; +const std::array CROHelper::ENTRY_SIZE{{ + 1, // code + 1, // data + 1, // module name + sizeof(SegmentEntry), sizeof(ExportNamedSymbolEntry), sizeof(ExportIndexedSymbolEntry), + 1, // export strings + sizeof(ExportTreeEntry), sizeof(ImportModuleEntry), sizeof(ExternalRelocationEntry), + sizeof(ImportNamedSymbolEntry), sizeof(ImportIndexedSymbolEntry), + sizeof(ImportAnonymousSymbolEntry), + 1, // import strings + sizeof(StaticAnonymousSymbolEntry), sizeof(InternalRelocationEntry), + sizeof(StaticRelocationEntry), +}}; + +const std::array CROHelper::FIX_BARRIERS{{ + Fix0Barrier, Fix1Barrier, Fix2Barrier, Fix3Barrier, +}}; VAddr CROHelper::SegmentTagToAddress(SegmentTag segment_tag) const { u32 segment_num = GetField(SegmentNum); @@ -204,13 +206,14 @@ ResultCode CROHelper::RebaseHeader(u32 cro_size) { return error; // verifies that all offsets are in the correct order - constexpr std::array OFFSET_ORDER = { - {CodeOffset, ModuleNameOffset, SegmentTableOffset, ExportNamedSymbolTableOffset, - ExportTreeTableOffset, ExportIndexedSymbolTableOffset, ExportStringsOffset, - ImportModuleTableOffset, ExternalRelocationTableOffset, ImportNamedSymbolTableOffset, - ImportIndexedSymbolTableOffset, ImportAnonymousSymbolTableOffset, ImportStringsOffset, - StaticAnonymousSymbolTableOffset, InternalRelocationTableOffset, - StaticRelocationTableOffset, DataOffset, FileSize}}; + constexpr std::array OFFSET_ORDER = {{ + CodeOffset, ModuleNameOffset, SegmentTableOffset, ExportNamedSymbolTableOffset, + ExportTreeTableOffset, ExportIndexedSymbolTableOffset, ExportStringsOffset, + ImportModuleTableOffset, ExternalRelocationTableOffset, ImportNamedSymbolTableOffset, + ImportIndexedSymbolTableOffset, ImportAnonymousSymbolTableOffset, ImportStringsOffset, + StaticAnonymousSymbolTableOffset, InternalRelocationTableOffset, + StaticRelocationTableOffset, DataOffset, FileSize, + }}; u32 prev_offset = GetField(OFFSET_ORDER[0]); u32 cur_offset; diff --git a/src/core/hle/service/ldr_ro/cro_helper.h b/src/core/hle/service/ldr_ro/cro_helper.h index e4457d4be..e1b8221bd 100644 --- a/src/core/hle/service/ldr_ro/cro_helper.h +++ b/src/core/hle/service/ldr_ro/cro_helper.h @@ -40,8 +40,7 @@ static constexpr u32 CRO_HASH_SIZE = 0x80; /// Represents a loaded module (CRO) with interfaces manipulating it. class CROHelper final { public: - explicit CROHelper(VAddr cro_address) : module_address(cro_address) { - } + explicit CROHelper(VAddr cro_address) : module_address(cro_address) {} std::string ModuleName() const { return Memory::ReadCString(GetField(ModuleNameOffset), GetField(ModuleNameSize)); @@ -152,8 +151,7 @@ private: /** * Each item in this enum represents a u32 field in the header begin from address+0x80, - * successively. - * We don't directly use a struct here, to avoid GetPointer, reinterpret_cast, or + * successively. We don't directly use a struct here, to avoid GetPointer, reinterpret_cast, or * Read/WriteBlock repeatedly. */ enum HeaderField { @@ -234,8 +232,7 @@ private: BitField<4, 28, u32_le> offset_into_segment; SegmentTag() = default; - explicit SegmentTag(u32 raw_) : raw(raw_) { - } + explicit SegmentTag(u32 raw_) : raw(raw_) {} }; /// Information of a segment in this module. diff --git a/src/core/hle/service/ldr_ro/ldr_ro.cpp b/src/core/hle/service/ldr_ro/ldr_ro.cpp index ae5d3921f..a8fc2c015 100644 --- a/src/core/hle/service/ldr_ro/ldr_ro.cpp +++ b/src/core/hle/service/ldr_ro/ldr_ro.cpp @@ -750,11 +750,17 @@ static void Shutdown(Service::Interface* self) { } const Interface::FunctionInfo FunctionTable[] = { - {0x000100C2, Initialize, "Initialize"}, {0x00020082, LoadCRR, "LoadCRR"}, - {0x00030042, UnloadCRR, "UnloadCRR"}, {0x000402C2, LoadCRO, "LoadCRO"}, - {0x000500C2, UnloadCRO, "UnloadCRO"}, {0x00060042, LinkCRO, "LinkCRO"}, - {0x00070042, UnlinkCRO, "UnlinkCRO"}, {0x00080042, Shutdown, "Shutdown"}, + // clang-format off + {0x000100C2, Initialize, "Initialize"}, + {0x00020082, LoadCRR, "LoadCRR"}, + {0x00030042, UnloadCRR, "UnloadCRR"}, + {0x000402C2, LoadCRO, "LoadCRO"}, + {0x000500C2, UnloadCRO, "UnloadCRO"}, + {0x00060042, LinkCRO, "LinkCRO"}, + {0x00070042, UnlinkCRO, "UnlinkCRO"}, + {0x00080042, Shutdown, "Shutdown"}, {0x000902C2, LoadCRO, "LoadCRO_New"}, + // clang-format on }; //////////////////////////////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3