From 38f942adf5ceb075bd56700b2652a0f5df9f57b6 Mon Sep 17 00:00:00 2001 From: Michael Scire Date: Thu, 2 Jan 2020 01:52:13 -0800 Subject: [PATCH] strat: use util::FourCC where relevant --- .../include/stratosphere/ams/ams_types.hpp | 2 +- .../include/stratosphere/ldr/ldr_types.hpp | 8 ++++---- .../libstratosphere/include/stratosphere/ro/ro_types.hpp | 4 ++-- libraries/libstratosphere/source/ams/ams_emummc_api.cpp | 2 +- stratosphere/creport/source/creport_threads.cpp | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/libraries/libstratosphere/include/stratosphere/ams/ams_types.hpp b/libraries/libstratosphere/include/stratosphere/ams/ams_types.hpp index 9ac1fdd35..27f575a88 100644 --- a/libraries/libstratosphere/include/stratosphere/ams/ams_types.hpp +++ b/libraries/libstratosphere/include/stratosphere/ams/ams_types.hpp @@ -74,7 +74,7 @@ namespace ams { static constexpr u64 StdAbortMagicValue = 0xA55AF00DDEADCAFEul; static constexpr u32 StdAbortErrorDesc = 0xFFE; static constexpr u32 DataAbortErrorDesc = 0x101; - static constexpr u32 Magic = 0x31454641; + static constexpr u32 Magic = util::FourCC<'A', 'F', 'E', '1'>::Code; u32 magic; u32 error_desc; diff --git a/libraries/libstratosphere/include/stratosphere/ldr/ldr_types.hpp b/libraries/libstratosphere/include/stratosphere/ldr/ldr_types.hpp index 6bad2790d..b34aee318 100644 --- a/libraries/libstratosphere/include/stratosphere/ldr/ldr_types.hpp +++ b/libraries/libstratosphere/include/stratosphere/ldr/ldr_types.hpp @@ -77,7 +77,7 @@ namespace ams::ldr { /* NSO types. */ struct NsoHeader { - static constexpr u32 Magic = 0x304F534E; + static constexpr u32 Magic = util::FourCC<'N','S','O','0'>::Code; enum Segment : size_t { Segment_Text = 0, Segment_Ro = 1, @@ -145,7 +145,7 @@ namespace ams::ldr { /* NPDM types. */ struct Aci { - static constexpr u32 Magic = 0x30494341; + static constexpr u32 Magic = util::FourCC<'A','C','I','0'>::Code; u32 magic; u8 reserved_04[0xC]; @@ -162,7 +162,7 @@ namespace ams::ldr { static_assert(sizeof(Aci) == 0x40 && std::is_pod::value, "Aci definition!"); struct Acid { - static constexpr u32 Magic = 0x44494341; + static constexpr u32 Magic = util::FourCC<'A','C','I','D'>::Code; enum AcidFlag { AcidFlag_Production = (1 << 0), @@ -201,7 +201,7 @@ namespace ams::ldr { static_assert(sizeof(Acid) == 0x240 && std::is_pod::value, "Acid definition!"); struct Npdm { - static constexpr u32 Magic = 0x4154454D; + static constexpr u32 Magic = util::FourCC<'M','E','T','A'>::Code; enum MetaFlag { MetaFlag_Is64Bit = (1 << 0), diff --git a/libraries/libstratosphere/include/stratosphere/ro/ro_types.hpp b/libraries/libstratosphere/include/stratosphere/ro/ro_types.hpp index 15de65d8c..03c31c0d2 100644 --- a/libraries/libstratosphere/include/stratosphere/ro/ro_types.hpp +++ b/libraries/libstratosphere/include/stratosphere/ro/ro_types.hpp @@ -33,7 +33,7 @@ namespace ams::ro { class NrrHeader { public: - static constexpr u32 Magic = 0x3052524E; + static constexpr u32 Magic = util::FourCC<'N','R','R','0'>::Code; private: u32 magic; u8 reserved_04[0xC]; @@ -85,7 +85,7 @@ namespace ams::ro { class NroHeader { public: - static constexpr u32 Magic = 0x304F524E; + static constexpr u32 Magic = util::FourCC<'N','R','O','0'>::Code; private: u32 entrypoint_insn; u32 mod_offset; diff --git a/libraries/libstratosphere/source/ams/ams_emummc_api.cpp b/libraries/libstratosphere/source/ams/ams_emummc_api.cpp index 4cb1f126d..15a7d050d 100644 --- a/libraries/libstratosphere/source/ams/ams_emummc_api.cpp +++ b/libraries/libstratosphere/source/ams/ams_emummc_api.cpp @@ -21,7 +21,7 @@ namespace ams::emummc { namespace { /* Convenience Definitions. */ - constexpr u32 StorageMagic = 0x30534645; /* EFS0 */ + constexpr u32 StorageMagic = util::FourCC<'E','F','S','0'>::Code; constexpr size_t MaxDirLen = 0x7F; /* Types. */ diff --git a/stratosphere/creport/source/creport_threads.cpp b/stratosphere/creport/source/creport_threads.cpp index 0fb39a660..7ea622c7e 100644 --- a/stratosphere/creport/source/creport_threads.cpp +++ b/stratosphere/creport/source/creport_threads.cpp @@ -21,8 +21,8 @@ namespace ams::creport { namespace { /* Convenience definitions. */ - constexpr u32 LibnxThreadVarMagic = 0x21545624; /* !TV$ */ - constexpr u32 DumpedThreadInfoMagic = 0x32495444; /* DTI2 */ + constexpr u32 LibnxThreadVarMagic = util::FourCC<'!','T','V','$'>::Code; + constexpr u32 DumpedThreadInfoMagic = util::FourCC<'D','T','I','2'>::Code; /* Types. */ template