From b9e86b21bce2be5b3d3e7d20fe487d04ac626f71 Mon Sep 17 00:00:00 2001 From: jakcron Date: Fri, 29 Jun 2018 15:10:10 +0800 Subject: [PATCH] [nx] Rename macro _MAKE_STRUCT_MAGIC to _MAKE_STRUCT_MAGIC_U32 --- lib/libnx-hb/include/nx/aset.h | 2 +- lib/libnx/include/nx/aci.h | 4 ++-- lib/libnx/include/nx/hierarchicalintegrity.h | 2 +- lib/libnx/include/nx/macro.h | 2 +- lib/libnx/include/nx/nca.h | 4 ++-- lib/libnx/include/nx/npdm.h | 2 +- lib/libnx/include/nx/nro.h | 2 +- lib/libnx/include/nx/nrr.h | 2 +- lib/libnx/include/nx/nso.h | 2 +- lib/libnx/include/nx/pfs.h | 4 ++-- lib/libnx/include/nx/xci.h | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/libnx-hb/include/nx/aset.h b/lib/libnx-hb/include/nx/aset.h index 22b9817..9e821cb 100644 --- a/lib/libnx-hb/include/nx/aset.h +++ b/lib/libnx-hb/include/nx/aset.h @@ -6,7 +6,7 @@ namespace nx { namespace aset { - static const uint32_t kAssetStructMagic = _MAKE_STRUCT_MAGIC("ASET"); + static const uint32_t kAssetStructMagic = _MAKE_STRUCT_MAGIC_U32("ASET"); static const uint32_t kDefaultAssetFormatVersion = 0; } diff --git a/lib/libnx/include/nx/aci.h b/lib/libnx/include/nx/aci.h index a3340f3..b2755e5 100644 --- a/lib/libnx/include/nx/aci.h +++ b/lib/libnx/include/nx/aci.h @@ -7,8 +7,8 @@ namespace nx { namespace aci { - static const uint32_t kAciStructMagic = _MAKE_STRUCT_MAGIC("ACI0"); - static const uint32_t kAciDescStructMagic = _MAKE_STRUCT_MAGIC("ACID"); + static const uint32_t kAciStructMagic = _MAKE_STRUCT_MAGIC_U32("ACI0"); + static const uint32_t kAciDescStructMagic = _MAKE_STRUCT_MAGIC_U32("ACID"); static const size_t kSectionAlignSize = 0x10; enum Flag diff --git a/lib/libnx/include/nx/hierarchicalintegrity.h b/lib/libnx/include/nx/hierarchicalintegrity.h index 476783d..4c16d0d 100644 --- a/lib/libnx/include/nx/hierarchicalintegrity.h +++ b/lib/libnx/include/nx/hierarchicalintegrity.h @@ -6,7 +6,7 @@ namespace nx { namespace hierarchicalintegrity { - static const uint32_t kStructMagic = _MAKE_STRUCT_MAGIC("IVFC"); + static const uint32_t kStructMagic = _MAKE_STRUCT_MAGIC_U32("IVFC"); static const uint32_t kRomfsTypeId = 0x20000; static const size_t kDefaultLayerNum = 6; static const size_t kHeaderAlignLen = 0x20; diff --git a/lib/libnx/include/nx/macro.h b/lib/libnx/include/nx/macro.h index 235ca46..6e1431f 100644 --- a/lib/libnx/include/nx/macro.h +++ b/lib/libnx/include/nx/macro.h @@ -1,5 +1,5 @@ #pragma once #include -#define _MAKE_STRUCT_MAGIC(x) ((uint32_t)(x[3]) << 24 | (uint32_t)(x[2]) << 16 | (uint32_t)(x[1]) << 8 | (uint32_t)(x[0])) +#define _MAKE_STRUCT_MAGIC_U32(x) ((uint32_t)(x[3]) << 24 | (uint32_t)(x[2]) << 16 | (uint32_t)(x[1]) << 8 | (uint32_t)(x[0])) #define _MAKE_STRUCT_MAGIC_U64(x) ((uint64_t)(x[7]) << 56 | (uint64_t)(x[6]) << 48 | (uint64_t)(x[5]) << 40 | (uint64_t)(x[4]) << 32 | (uint64_t)(x[3]) << 24 | (uint64_t)(x[2]) << 16 | (uint64_t)(x[1]) << 8 | (uint64_t)(x[0])) diff --git a/lib/libnx/include/nx/nca.h b/lib/libnx/include/nx/nca.h index 651de32..e49e4a4 100644 --- a/lib/libnx/include/nx/nca.h +++ b/lib/libnx/include/nx/nca.h @@ -9,8 +9,8 @@ namespace nx { namespace nca { - static const uint32_t kNca2StructMagic = _MAKE_STRUCT_MAGIC("NCA2"); - static const uint32_t kNca3StructMagic = _MAKE_STRUCT_MAGIC("NCA3"); + static const uint32_t kNca2StructMagic = _MAKE_STRUCT_MAGIC_U32("NCA2"); + static const uint32_t kNca3StructMagic = _MAKE_STRUCT_MAGIC_U32("NCA3"); static const size_t kSectorSize = 0x200; static const size_t kPartitionNum = 4; static const size_t kHeaderSectorNum = 6; diff --git a/lib/libnx/include/nx/npdm.h b/lib/libnx/include/nx/npdm.h index 8271f39..b508ba8 100644 --- a/lib/libnx/include/nx/npdm.h +++ b/lib/libnx/include/nx/npdm.h @@ -6,7 +6,7 @@ namespace nx { namespace npdm { - static const uint32_t kNpdmStructMagic = _MAKE_STRUCT_MAGIC("META"); + static const uint32_t kNpdmStructMagic = _MAKE_STRUCT_MAGIC_U32("META"); static const size_t kNameMaxLen = 0x10; static const size_t kProductCodeMaxLen = 0x10; static const uint32_t kMaxPriority = BIT(6) - 1; diff --git a/lib/libnx/include/nx/nro.h b/lib/libnx/include/nx/nro.h index 0424294..c145e64 100644 --- a/lib/libnx/include/nx/nro.h +++ b/lib/libnx/include/nx/nro.h @@ -6,7 +6,7 @@ namespace nx { namespace nro { - static const uint32_t kNroStructMagic = _MAKE_STRUCT_MAGIC("NRO0"); + static const uint32_t kNroStructMagic = _MAKE_STRUCT_MAGIC_U32("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/nrr.h b/lib/libnx/include/nx/nrr.h index 9e9fe32..3931ad1 100644 --- a/lib/libnx/include/nx/nrr.h +++ b/lib/libnx/include/nx/nrr.h @@ -7,7 +7,7 @@ namespace nx { namespace nrr { - static const uint32_t kNrrStructMagic = _MAKE_STRUCT_MAGIC("NRR0"); + static const uint32_t kNrrStructMagic = _MAKE_STRUCT_MAGIC_U32("NRR0"); } #pragma pack(push,1) diff --git a/lib/libnx/include/nx/nso.h b/lib/libnx/include/nx/nso.h index 77c215f..d40c925 100644 --- a/lib/libnx/include/nx/nso.h +++ b/lib/libnx/include/nx/nso.h @@ -7,7 +7,7 @@ namespace nx { namespace nso { - static const uint32_t kNsoStructMagic = _MAKE_STRUCT_MAGIC("NSO0"); + static const uint32_t kNsoStructMagic = _MAKE_STRUCT_MAGIC_U32("NSO0"); static const uint32_t kDefaultFormatVersion = 0; static const size_t kModuleIdSize = 32; diff --git a/lib/libnx/include/nx/pfs.h b/lib/libnx/include/nx/pfs.h index 27258b8..9b1fde1 100644 --- a/lib/libnx/include/nx/pfs.h +++ b/lib/libnx/include/nx/pfs.h @@ -6,8 +6,8 @@ namespace nx { namespace pfs { - static const uint32_t kPfsStructMagic = _MAKE_STRUCT_MAGIC("PFS0"); - static const uint32_t kHashedPfsStructMagic = _MAKE_STRUCT_MAGIC("HFS0"); + static const uint32_t kPfsStructMagic = _MAKE_STRUCT_MAGIC_U32("PFS0"); + static const uint32_t kHashedPfsStructMagic = _MAKE_STRUCT_MAGIC_U32("HFS0"); static const size_t kHeaderAlign = 64; } diff --git a/lib/libnx/include/nx/xci.h b/lib/libnx/include/nx/xci.h index 1eec6fb..b7b0797 100644 --- a/lib/libnx/include/nx/xci.h +++ b/lib/libnx/include/nx/xci.h @@ -10,7 +10,7 @@ namespace nx { namespace xci { - static const uint32_t kXciStructMagic = _MAKE_STRUCT_MAGIC("HEAD"); + static const uint32_t kXciStructMagic = _MAKE_STRUCT_MAGIC_U32("HEAD"); static const uint32_t kHeaderEncOffset = 0x90; static const uint32_t kHeaderEncSize = 0x70; static const uint32_t kPageSize = 0x200;