Skip to content

Commit 0078ec0

Browse files
committed
Make sure all enums are 4 bytes
1 parent 4bb93c7 commit 0078ec0

59 files changed

Lines changed: 200 additions & 6 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

include/avm/drc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ typedef enum AVMDrcScanMode
1818
AVM_DRC_SCAN_MODE_UNKNOWN_3 = 3,
1919
AVM_DRC_SCAN_MODE_UNKNOWN_255 = 255,
2020
} AVMDrcScanMode;
21+
WUT_CHECK_SIZE(AVMDrcScanMode, 4);
2122

2223
typedef enum AVMDrcMode
2324
{
2425
AVM_DRC_MODE_NONE = 0,
2526
AVM_DRC_MODE_SINGLE = 1,
2627
AVM_DRC_MODE_DOUBLE = 2,
2728
} AVMDrcMode;
29+
WUT_CHECK_SIZE(AVMDrcMode, 4);
2830

2931
BOOL
3032
AVMGetDRCScanMode(AVMDrcScanMode *outScanMode);

include/camera/camera.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,17 +44,20 @@ typedef enum CamError
4444
CAMERA_ERROR_DEVICE_IN_USE = -12,
4545
CAMERA_ERROR_SEGMENT_VIOLATION = -14
4646
} CamError;
47+
WUT_CHECK_SIZE(CamError, 4);
4748

4849
typedef enum CamFps
4950
{
5051
CAMERA_FPS_15,
5152
CAMERA_FPS_30
5253
} CamFps;
54+
WUT_CHECK_SIZE(CamFps, 4);
5355

5456
typedef enum CamStreamType
5557
{
5658
CAMERA_STREAM_TYPE_1
5759
} CamStreamType;
60+
WUT_CHECK_SIZE(CamStreamType, 4);
5861

5962
struct CAMEventData
6063
{

include/coreinit/bsp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ typedef enum BSPErrors
2222
BSP_ERROR_IOS_ERROR = 0x40,
2323
BSP_ERROR_RESPONSE_TOO_LARGE = 0x80,
2424
} BSPErrors;
25+
WUT_CHECK_SIZE(BSPErrors, 4);
2526

2627
typedef enum BSPHardwareVersions
2728
{
@@ -58,6 +59,7 @@ typedef enum BSPHardwareVersions
5859
BSP_HARDWARE_VERSION_LATTE_B1X_CAT = 0x26100020,
5960
BSP_HARDWARE_VERSION_LATTE_B1X_CAFE = 0x26100028
6061
} BSPHardwareVersions;
62+
WUT_CHECK_SIZE(BSPHardwareVersions, 4);
6163

6264
BSPError
6365
bspInitializeShimInterface();

include/coreinit/codegen.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ typedef enum OSCodegenSecMode
3737
//! The area can be read or executed, but not written to.
3838
CODEGEN_R_X = 1,
3939
} OSCodegenSecMode;
40+
WUT_CHECK_SIZE(OSCodegenSecMode, 4);
4041

4142
/**
4243
* Gets the location and size of codegen memory, if available.

include/coreinit/context.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ enum OS_CONTEXT_STATE {
1919
OS_CONTEXT_STATE_OSCALLBACK = 1 << 3,
2020
OS_CONTEXT_STATE_USERMODE_SAVED = 1 << 4
2121
};
22+
WUT_CHECK_SIZE(enum OS_CONTEXT_STATE, 4);
2223

2324
typedef struct OSContext OSContext;
2425

include/coreinit/cosreport.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ typedef enum COSReportLevel{
1818
COS_REPORT_LEVEL_INFO = 2,
1919
COS_REPORT_LEVEL_VERBOSE = 3,
2020
} COSReportLevel;
21+
WUT_CHECK_SIZE(COSReportLevel, 4);
2122

2223
typedef enum COSReportModule{
2324
COS_REPORT_MODULE_UNKNOWN_0 = 0,
2425
COS_REPORT_MODULE_UNKNOWN_1 = 1,
2526
COS_REPORT_MODULE_UNKNOWN_2 = 2,
2627
COS_REPORT_MODULE_UNKNOWN_5 = 5,
2728
} COSReportModule;
29+
WUT_CHECK_SIZE(COSReportModule, 4);
2830

2931
void
3032
COSVReport(COSReportModule module,

include/coreinit/debug.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ typedef enum DisassemblePPCFlags
1919
{
2020
DISASSEMBLE_PPC_FLAGS_NONE = 0,
2121
} DisassemblePPCFlags;
22-
22+
WUT_CHECK_SIZE(DisassemblePPCFlags, 4);
2323

2424
void
2525
OSConsoleWrite(const char *msg,

include/coreinit/dynload.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ typedef enum OSDynLoad_Error
3333
OS_DYNLOAD_INVALID_ALLOCATOR_PTR = 0xBAD10017,
3434
OS_DYNLOAD_OUT_OF_SYSTEM_MEMORY = 0xBAD1002F,
3535
OS_DYNLOAD_TLS_ALLOCATOR_LOCKED = 0xBAD10031,
36-
OS_DYNLOAD_MODULE_NOT_FOUND = -6,
36+
OS_DYNLOAD_MODULE_NOT_FOUND = 0xFFFFFFFA,
3737
} OSDynLoad_Error;
38+
WUT_CHECK_SIZE(OSDynLoad_Error, 4);
3839

3940
typedef OSDynLoad_Error (*OSDynLoadAllocFn)(int32_t size, int32_t align, void **outAddr);
4041
typedef void (*OSDynLoadFreeFn)(void *addr);
@@ -43,12 +44,14 @@ typedef enum OSDynLoad_ExportType {
4344
OS_DYNLOAD_EXPORT_FUNC = 0,
4445
OS_DYNLOAD_EXPORT_DATA = 1,
4546
} OSDynLoad_ExportType;
47+
WUT_CHECK_SIZE(OSDynLoad_ExportType, 4);
4648

4749
typedef enum OSDynLoad_EntryReason
4850
{
4951
OS_DYNLOAD_LOADED = 0,
5052
OS_DYNLOAD_UNLOADED = 1,
5153
} OSDynLoad_EntryReason;
54+
WUT_CHECK_SIZE(OSDynLoad_EntryReason, 4);
5255

5356
struct OSDynLoad_NotifyData
5457
{
@@ -201,6 +204,7 @@ typedef enum OSDynLoad_NotifyReason
201204
OS_DYNLOAD_NOTIFY_UNLOADED = 0,
202205
OS_DYNLOAD_NOTIFY_LOADED = 1
203206
} OSDynLoad_NotifyReason;
207+
WUT_CHECK_SIZE(OSDynLoad_NotifyReason, 4);
204208

205209
typedef void (*OSDynLoadNotifyFunc)(OSDynLoad_Module module,
206210
void *userContext,

include/coreinit/event.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ typedef enum OSEventMode
2727
//! An auto event will reset everytime a thread is woken.
2828
OS_EVENT_MODE_AUTO = 1,
2929
} OSEventMode;
30+
WUT_CHECK_SIZE(OSEventMode, 4);
3031

3132
#define OS_EVENT_TAG 0x65566E54u
3233

include/coreinit/exception.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ typedef enum OSExceptionMode
2222
OS_EXCEPTION_MODE_THREAD_ALL_CORES = 3,
2323
OS_EXCEPTION_MODE_GLOBAL_ALL_CORES = 4,
2424
} OSExceptionMode;
25+
WUT_CHECK_SIZE(OSExceptionMode, 4);
2526

2627
typedef enum OSExceptionType
2728
{
@@ -41,6 +42,7 @@ typedef enum OSExceptionType
4142
OS_EXCEPTION_TYPE_SYSTEM_INTERRUPT = 13,
4243
OS_EXCEPTION_TYPE_ICI = 14,
4344
} OSExceptionType;
45+
WUT_CHECK_SIZE(OSExceptionType, 4);
4446

4547
OSExceptionCallbackFn
4648
OSSetExceptionCallback(OSExceptionType exceptionType,

0 commit comments

Comments
 (0)