From 22072399de35aeaa24a81656c3deb87696f61b51 Mon Sep 17 00:00:00 2001 From: jakcron Date: Fri, 29 Jun 2018 15:09:05 +0800 Subject: [PATCH] [nx] Standardise const/enum ordering. --- lib/libnx/include/nx/fac.h | 6 +++--- lib/libnx/include/nx/nacp.h | 24 ++++++++++++------------ lib/libnx/include/nx/nro.h | 1 - lib/libnx/include/nx/nso.h | 5 ++--- lib/libnx/include/nx/romfs.h | 6 +++--- lib/libnx/include/nx/xci.h | 2 ++ 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/lib/libnx/include/nx/fac.h b/lib/libnx/include/nx/fac.h index 06ed970..886c930 100644 --- a/lib/libnx/include/nx/fac.h +++ b/lib/libnx/include/nx/fac.h @@ -5,6 +5,9 @@ namespace nx { namespace fac { + static const uint32_t kFacFormatVersion = 1; + static const size_t kSectionAlignSize = 4; + enum FsAccessFlag { FSA_APPLICATION_INFO, @@ -30,9 +33,6 @@ namespace nx FSA_DEBUG = 62, FSA_FULL_PERMISSION = 63, }; - - static const uint32_t kFacFormatVersion = 1; - static const size_t kSectionAlignSize = 4; } #pragma pack(push,1) diff --git a/lib/libnx/include/nx/nacp.h b/lib/libnx/include/nx/nacp.h index 67f0f3e..c319395 100644 --- a/lib/libnx/include/nx/nacp.h +++ b/lib/libnx/include/nx/nacp.h @@ -5,6 +5,18 @@ namespace nx { namespace nacp { + static const size_t kNameLength = 0x200; + static const size_t kPublisherLength = 0x100; + static const size_t kMaxLanguageCount = 16; + static const size_t kIsbnLength = 37; + static const size_t kRatingAgeCount = 32; + static const size_t kDisplayVersionLength = 16; + static const size_t kApplicationErrorCodeCategoryLength = 8; + static const size_t kLocalCommunicationIdCount = 8; + static const size_t kBcatPassphraseLength = 65; + static const size_t kPlayLogQueryableApplicationIdCount = 16; + static const int8_t kUnusedAgeRating = -1; + enum AocRegistrationType { AOC_AllOnLaunch, @@ -142,18 +154,6 @@ namespace nx VCAP_Manual, VCAP_Enable }; - - static const size_t kNameLength = 0x200; - static const size_t kPublisherLength = 0x100; - static const size_t kMaxLanguageCount = 16; - static const size_t kIsbnLength = 37; - static const size_t kRatingAgeCount = 32; - static const size_t kDisplayVersionLength = 16; - static const size_t kApplicationErrorCodeCategoryLength = 8; - static const size_t kLocalCommunicationIdCount = 8; - static const size_t kBcatPassphraseLength = 65; - static const size_t kPlayLogQueryableApplicationIdCount = 16; - static const int8_t kUnusedAgeRating = -1; } diff --git a/lib/libnx/include/nx/nro.h b/lib/libnx/include/nx/nro.h index 18d4daf..0424294 100644 --- a/lib/libnx/include/nx/nro.h +++ b/lib/libnx/include/nx/nro.h @@ -7,7 +7,6 @@ namespace nx namespace nro { static const uint32_t kNroStructMagic = _MAKE_STRUCT_MAGIC("NRO0"); - static const uint32_t kDefaultFormatVersion = 0; static const size_t kRoCrtSize = 8; static const size_t kModuleIdSize = 32; diff --git a/lib/libnx/include/nx/nso.h b/lib/libnx/include/nx/nso.h index 84698a5..77c215f 100644 --- a/lib/libnx/include/nx/nso.h +++ b/lib/libnx/include/nx/nso.h @@ -8,6 +8,8 @@ namespace nx namespace nso { static const uint32_t kNsoStructMagic = _MAKE_STRUCT_MAGIC("NSO0"); + static const uint32_t kDefaultFormatVersion = 0; + static const size_t kModuleIdSize = 32; enum HeaderFlags { @@ -18,9 +20,6 @@ namespace nx FLAG_RO_HASH, FLAG_DATA_HASH }; - - static const uint32_t kDefaultFormatVersion = 0; - static const size_t kModuleIdSize = 32; } #pragma pack(push,1) diff --git a/lib/libnx/include/nx/romfs.h b/lib/libnx/include/nx/romfs.h index 30a834e..1756425 100644 --- a/lib/libnx/include/nx/romfs.h +++ b/lib/libnx/include/nx/romfs.h @@ -5,6 +5,9 @@ namespace nx { namespace romfs { + static const uint64_t kRomfsHeaderAlign = 0x200; + static const uint32_t kInvalidAddr = 0xffffffff; + enum HeaderSectionIndex { DIR_HASHMAP_TABLE, @@ -13,9 +16,6 @@ namespace nx FILE_NODE_TABLE, SECTION_NUM }; - - static const uint64_t kRomfsHeaderAlign = 0x200; - static const uint32_t kInvalidAddr = 0xffffffff; } #pragma pack(push,1) diff --git a/lib/libnx/include/nx/xci.h b/lib/libnx/include/nx/xci.h index d03ba36..1eec6fb 100644 --- a/lib/libnx/include/nx/xci.h +++ b/lib/libnx/include/nx/xci.h @@ -15,12 +15,14 @@ namespace nx static const uint32_t kHeaderEncSize = 0x70; static const uint32_t kPageSize = 0x200; static const uint32_t kUppHashLen = 8; + /* static const uint32_t kCardKeyAreaPageCount = 8; static const uint32_t kCardHeaderPageCount = 1; static const uint32_t kReservedAreaPageCount = 55; static const uint32_t kCertAreaStartPageAddress = kCardHeaderPageCount + kReservedAreaPageCount + kCardKeyAreaPageCount; static const uint32_t kCertAreaPageCount = 64; static const uint32_t kNormalAreaStartPageAddress = kReservedAreaPageCount + kCertAreaPageCount + kCardHeaderPageCount + kCardKeyAreaPageCount; + */ const std::string kUpdatePartitionStr = "update"; const std::string kLogoPartitionStr = "logo";