Skip to content

Commit 478c189

Browse files
committed
update enum type usage in structs
1 parent 6bd9989 commit 478c189

File tree

2 files changed

+26
-26
lines changed
  • libctru
    • include/3ds/services
    • source/services

2 files changed

+26
-26
lines changed

libctru/include/3ds/services/am.h

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ typedef enum
3636
/// Contains information about the limits section of a ticket.
3737
typedef struct
3838
{
39-
AM_TicketLimitFlag flags : 8; ///< Enabled ticket limit types.
39+
u8 flags; ///< Enabled ticket limit types. @ref AM_TicketLimitFlag
4040
u8 maxPlaycount; ///< The maximum play count when the ticket has a play count limit.
4141
u8 reserved[14];
4242
} AM_TicketLimitInfo;
@@ -68,11 +68,11 @@ typedef enum
6868
// Contains basic information about a pending title.
6969
typedef struct
7070
{
71-
u64 titleId; ///< The title's title ID.
72-
u16 version; ///< The title's title version.
73-
AM_TitleInstallStatus status : 8; ///< The title's installation status. @ref AM_TitleInstallStatus
74-
u32 titleType; ///< The title's title type from the TMD.
75-
u64 titleSize; ///< The amount of storage space (in bytes) the title takes up.
71+
u64 titleId; ///< The title's title ID.
72+
u16 version; ///< The title's title version.
73+
u8 status; ///< The title's installation status. @ref AM_TitleInstallStatus
74+
u32 titleType; ///< The title's title type from the TMD.
75+
u64 titleSize; ///< The amount of storage space (in bytes) the title takes up.
7676
} AM_PendingTitleInfo;
7777

7878
// Contains basic information about a pending title.
@@ -81,11 +81,11 @@ typedef AM_PendingTitleInfo AM_PendingTitleEntry;
8181
// Contains information about a title's active content import.
8282
typedef struct
8383
{
84-
u32 contentId; ///< Content ID (from the TMD) of this content.
85-
u16 contentIndex; ///< Content index (from the TMD) of this content.
86-
AM_ContentInstallStatus status : 8; ///< Installation status of this content. @ref AM_ContentInstallStatus
87-
u64 size; ///< Total size of this content.
88-
u64 currentInstallOffset; ///< Current installation offset for this content.
84+
u32 contentId; ///< Content ID (from the TMD) of this content.
85+
u16 contentIndex; ///< Content index (from the TMD) of this content.
86+
u8 status; ///< Installation status of this content. @ref AM_ContentInstallStatus
87+
u64 size; ///< Total size of this content.
88+
u64 currentInstallOffset; ///< Current installation offset for this content.
8989
} AM_ImportContentContext;
9090

9191
/// Pending title flags.
@@ -136,12 +136,12 @@ typedef enum
136136
/// Contains information about a title's content.
137137
typedef struct
138138
{
139-
u16 index; ///< Content index from the TMD.
140-
AM_ContentTypeFlags type : 16; ///< Content flags from the TMD. @ref AM_ContentTypeFlags
141-
u32 contentId; ///< Content ID from the TMD.
142-
u64 size; ///< Size of the content in the title.
143-
AM_ContentInfoFlags flags : 8; ///< @ref AM_ContentInfoFlags
144-
u8 padding[7]; ///< Padding
139+
u16 index; ///< Content index from the TMD.
140+
u16 type; ///< Content flags from the TMD. @ref AM_ContentTypeFlags
141+
u32 contentId; ///< Content ID from the TMD.
142+
u64 size; ///< Size of the content in the title.
143+
u8 flags; ///< @ref AM_ContentInfoFlags
144+
u8 padding[7]; ///< Padding
145145
} AM_ContentInfo;
146146

147147
/// Contains internal information about a title's storage location.
@@ -411,15 +411,15 @@ Result AM_GetPersonalizedTicketInfos(u32 *outNum, AM_TicketInfo *outInfos, u32 c
411411
* @param mediaType The media type to delete the pending titles from.
412412
* @param flags The criteria based on which the pending titles should be deleted. @ref AM_PendingTitleFlags
413413
*/
414-
Result AM_DeleteAllImportTitleContexts(FS_MediaType mediaType, AM_PendingTitleFlags flags);
414+
Result AM_DeleteAllImportTitleContexts(FS_MediaType mediaType, u32 flags);
415415

416416
/**
417417
* @brief Gets the number of pending titles matching specific criteria.
418418
* @param[out] outNum Pointer to output the number of pending titles to.
419419
* @param mediaType The media type to count the titles from.
420420
* @param flags The criteria based on which the pending titles should be counted. @ref AM_PendingTitleFlags
421421
*/
422-
Result AM_GetNumImportTitleContexts(u32 *outNum, FS_MediaType mediaType, AM_PendingTitleFlags flags);
422+
Result AM_GetNumImportTitleContexts(u32 *outNum, FS_MediaType mediaType, u32 flags);
423423

424424
/**
425425
* @brief Gets a list of title IDs for pending titles matching specific criteria.
@@ -428,7 +428,7 @@ Result AM_GetNumImportTitleContexts(u32 *outNum, FS_MediaType mediaType, AM_Pend
428428
* @param flags The criteria based on which the title IDs should be retrieved. @ref AM_PendingTitleFlags
429429
* @param[out] titleIds Pointer to output the title IDs to.
430430
*/
431-
Result AM_GetImportTitleContextList(u32 *outNum, u32 count, FS_MediaType mediaType, AM_PendingTitleFlags flags, u64 *titleIds);
431+
Result AM_GetImportTitleContextList(u32 *outNum, u32 count, FS_MediaType mediaType, u32 flags, u64 *titleIds);
432432

433433
/**
434434
* @brief Checks whether or not the user has the right to use a given content of a title.

libctru/source/services/am.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -581,28 +581,28 @@ Result AM_GetPersonalizedTicketInfos(u32 *outNum, AM_TicketInfo *outInfos, u32 c
581581
return (Result)cmdbuf[1];
582582
}
583583

584-
Result AM_DeleteAllImportTitleContexts(FS_MediaType mediaType, AM_PendingTitleFlags flags)
584+
Result AM_DeleteAllImportTitleContexts(FS_MediaType mediaType, u32 flags)
585585
{
586586
u32 *cmdbuf = getThreadCommandBuffer();
587587

588588
cmdbuf[0] = IPC_MakeHeader(0x22, 2, 0); // 0x00220080
589589
cmdbuf[1] = (u32)mediaType;
590-
cmdbuf[2] = (u32)flags;
590+
cmdbuf[2] = flags;
591591

592592
Result res = svcSendSyncRequest(amHandle);
593593

594594
if (R_FAILED(res)) return res;
595595
return (Result)cmdbuf[1];
596596
}
597597

598-
Result AM_GetNumImportTitleContexts(u32 *outNum, FS_MediaType mediaType, AM_PendingTitleFlags flags)
598+
Result AM_GetNumImportTitleContexts(u32 *outNum, FS_MediaType mediaType, u32 flags)
599599
{
600600
Result ret = 0;
601601
u32 *cmdbuf = getThreadCommandBuffer();
602602

603603
cmdbuf[0] = IPC_MakeHeader(0x23,2,0); // 0x00230080
604604
cmdbuf[1] = (u32)mediaType;
605-
cmdbuf[2] = (u32)flags;
605+
cmdbuf[2] = flags;
606606

607607
if(R_FAILED(ret = svcSendSyncRequest(amHandle))) return ret;
608608

@@ -611,15 +611,15 @@ Result AM_GetNumImportTitleContexts(u32 *outNum, FS_MediaType mediaType, AM_Pend
611611
return (Result)cmdbuf[1];
612612
}
613613

614-
Result AM_GetImportTitleContextList(u32 *outNum, u32 count, FS_MediaType mediaType, AM_PendingTitleFlags flags, u64 *titleIds)
614+
Result AM_GetImportTitleContextList(u32 *outNum, u32 count, FS_MediaType mediaType, u32 flags, u64 *titleIds)
615615
{
616616
Result ret = 0;
617617
u32 *cmdbuf = getThreadCommandBuffer();
618618

619619
cmdbuf[0] = IPC_MakeHeader(0x24,3,2); // 0x002400C2
620620
cmdbuf[1] = count;
621621
cmdbuf[2] = (u32)mediaType;
622-
cmdbuf[3] = (u32)flags;
622+
cmdbuf[3] = flags;
623623
cmdbuf[4] = IPC_Desc_Buffer(count*sizeof(u64),IPC_BUFFER_W);
624624
cmdbuf[5] = (u32)titleIds;
625625

0 commit comments

Comments
 (0)