diff --git a/libraries/libstratosphere/include/stratosphere/ncm/ncm_types.hpp b/libraries/libstratosphere/include/stratosphere/ncm/ncm_types.hpp index 280a5d63c..5e8238817 100644 --- a/libraries/libstratosphere/include/stratosphere/ncm/ncm_types.hpp +++ b/libraries/libstratosphere/include/stratosphere/ncm/ncm_types.hpp @@ -20,45 +20,45 @@ namespace ams::ncm { enum class ContentMetaType : u8 { - Unknown = 0x0, - SystemProgram = 0x1, - SystemData = 0x2, - SystemUpdate = 0x3, - BootImagePackage = 0x4, - BootImagePackageSafe = 0x5, - Application = 0x80, - Patch = 0x81, - AddOnContent = 0x82, - Delta = 0x83, + Unknown = 0x0, + SystemProgram = 0x1, + SystemData = 0x2, + SystemUpdate = 0x3, + BootImagePackage = 0x4, + BootImagePackageSafe = 0x5, + Application = 0x80, + Patch = 0x81, + AddOnContent = 0x82, + Delta = 0x83, }; enum class ContentType : u8 { - Meta = 0, - Program = 1, - Data = 2, - Control = 3, - HtmlDocument = 4, - LegalInformation = 5, - DeltaFragment = 6, + Meta = 0, + Program = 1, + Data = 2, + Control = 3, + HtmlDocument = 4, + LegalInformation = 5, + DeltaFragment = 6, }; enum class ContentMetaAttribute : u8 { - None = 0, - IncludesExFatDriver = 1, - Rebootless = 2, + None = 0, + IncludesExFatDriver = 1, + Rebootless = 2, }; enum class ContentInstallType : u8 { - Full = 0, - FragmentOnly = 1, - Unknown = 7, + Full = 0, + FragmentOnly = 1, + Unknown = 7, }; struct MountName { char name[0x10]; }; - struct PlaceHolderId { + alignas(8) struct PlaceHolderId { util::Uuid uuid; bool operator==(const PlaceHolderId& other) const { @@ -76,11 +76,11 @@ namespace ams::ncm { bool operator!=(const util::Uuid& other) const { return this->uuid != other; } - } __attribute__((aligned(8))); + }; - static_assert(__alignof__(PlaceHolderId) == 8, "PlaceHolderId definition!"); + static_assert(alignof(PlaceHolderId) == 8, "PlaceHolderId definition!"); - struct ContentId { + alignas(4) struct ContentId { util::Uuid uuid; bool operator==(const ContentId& other) const { @@ -98,12 +98,12 @@ namespace ams::ncm { bool operator!=(const util::Uuid& other) const { return this->uuid != other; } - } __attribute__((aligned(4))); + }; - static_assert(__alignof__(ContentId) == 4, "ContentId definition!"); + static_assert(alignof(ContentId) == 4, "ContentId definition!"); - static constexpr PlaceHolderId InvalidPlaceHolderId = { util::InvalidUuid }; - static constexpr ContentId InvalidContentId = { util::InvalidUuid }; + constexpr inline PlaceHolderId InvalidPlaceHolderId = { util::InvalidUuid }; + constexpr inline ContentId InvalidContentId = { util::InvalidUuid }; struct ContentInfo { ContentId content_id; @@ -114,8 +114,8 @@ namespace ams::ncm { static_assert(sizeof(ContentInfo) == 0x18, "ContentInfo definition!"); - typedef void (*MakeContentPathFunc)(char* out, ContentId content_id, const char* root); - typedef void (*MakePlaceHolderPathFunc)(char* out, PlaceHolderId placeholder_id, const char* root); + using MakeContentPathFunc = void (*)(char* out, ContentId content_id, const char* root); + using MakePlaceHolderPathFunc = void (*)(char* out, PlaceHolderId placeholder_id, const char* root); /* Storage IDs. */ enum class StorageId : u8 { @@ -594,7 +594,7 @@ namespace ams::ncm { static_assert(sizeof(ContentMetaKey) == 0x10, "ContentMetaKey definition!"); /* Used by system updates. They share the exact same struct as ContentMetaKey */ - typedef ContentMetaKey ContentMetaInfo; + using ContentMetaInfo = ContentMetaKey; struct ApplicationContentMetaKey { ContentMetaKey key;