alignas() used instead of set_alignment macro

This commit is contained in:
Nekotekina 2015-08-06 21:43:51 +03:00
parent 544fe531a3
commit 8d758b9088
7 changed files with 30 additions and 30 deletions

View file

@ -31,10 +31,10 @@
#define force_inline __attribute__((always_inline))
#endif
#if defined(_MSC_VER)
#define set_alignment(x) _CRT_ALIGN(x)
#else
#define set_alignment(x) __attribute__((aligned(x)))
#if defined(_MSC_VER) && _MSC_VER <= 1800
#define alignas(x) _CRT_ALIGN(x)
#elif defined(__GNUG__)
#define ALIGN(x) __attribute__((aligned(x))) // not used
#endif
#if defined(__GNUG__)

View file

@ -2,21 +2,21 @@
using SceFiberEntry = void(u32 argOnInitialize, u32 argOnRun);
struct set_alignment(8) SceFiber
struct alignas(8) SceFiber
{
le_t<u64> padding[16];
};
CHECK_SIZE_ALIGN(SceFiber, 128, 8);
struct set_alignment(8) SceFiberOptParam
struct alignas(8) SceFiberOptParam
{
le_t<u64> padding[16];
};
CHECK_SIZE_ALIGN(SceFiberOptParam, 128, 8);
struct set_alignment(8) SceFiberInfo
struct alignas(8) SceFiberInfo
{
vm::lptr<SceFiberEntry> entry;
le_t<u32> argOnInitialize;

View file

@ -551,7 +551,7 @@ struct CellAdecParamM4Aac
};
// MPEG4 AAC BSI
struct set_alignment(16) CellAdecM4AacInfo
struct alignas(16) CellAdecM4AacInfo
{
be_t<u32> samplingFreq; // [Hz]
be_t<u32> numberOfChannels;

View file

@ -36,7 +36,7 @@ enum : s32
CELL_ATRAC_LOOP_STREAM_DATA_IS_ON_MEMORY = -3,
};
struct set_alignment(8) CellAtracHandle
struct alignas(8) CellAtracHandle
{
vm::ptr<u8> pucWorkMem;
// ...

View file

@ -37,7 +37,7 @@ enum : s32
CELL_ATRACMULTI_LOOP_STREAM_DATA_IS_ON_MEMORY = -3,
};
struct set_alignment(8) CellAtracMultiHandle
struct alignas(8) CellAtracMultiHandle
{
vm::ptr<u8> pucWorkMem;
// ...

View file

@ -261,7 +261,7 @@ enum SpursEventFlagConstants
CELL_SPURS_EVENT_FLAG_INVALID_SPU_PORT = 0xFF,
};
struct set_alignment(16) CellSpursWorkloadFlag
struct alignas(16) CellSpursWorkloadFlag
{
be_t<u64> unused0;
be_t<u32> unused1;
@ -295,7 +295,7 @@ struct CellSpursInfo
CHECK_SIZE(CellSpursInfo, 280);
struct set_alignment(8) CellSpursAttribute
struct alignas(8) CellSpursAttribute
{
be_t<u32> revision; // 0x0
be_t<u32> sdkVersion; // 0x4
@ -319,7 +319,7 @@ CHECK_SIZE_ALIGN(CellSpursAttribute, 512, 8);
using CellSpursShutdownCompletionEventHook = void(vm::ptr<CellSpurs> spurs, u32 wid, vm::ptr<void> arg);
struct set_alignment(16) CellSpursTraceInfo
struct alignas(16) CellSpursTraceInfo
{
be_t<u32> spuThread[8]; // 0x00
be_t<u32> count[8]; // 0x20
@ -385,7 +385,7 @@ struct CellSpursTraceStartData
be_t<u16> ls;
};
struct set_alignment(16) CellSpursTracePacket
struct alignas(16) CellSpursTracePacket
{
CellSpursTraceHeader header;
@ -411,7 +411,7 @@ struct set_alignment(16) CellSpursTracePacket
CHECK_SIZE_ALIGN(CellSpursTracePacket, 16, 16);
// Core CellSpurs structures
struct set_alignment(128) CellSpurs
struct alignas(128) CellSpurs
{
struct _sub_str1
{
@ -609,7 +609,7 @@ struct CellSpursWorkloadAttribute
CHECK_SIZE_ALIGN(CellSpursWorkloadAttribute, 512, 8);
struct set_alignment(128) CellSpursEventFlag
struct alignas(128) CellSpursEventFlag
{
struct ControlSyncVar
{
@ -657,14 +657,14 @@ union CellSpursTaskLsPattern
be_t<u64> _u64[2];
};
struct set_alignment(16) CellSpursTaskAttribute
struct alignas(16) CellSpursTaskAttribute
{
u8 reserved[256];
};
CHECK_SIZE_ALIGN(CellSpursTaskAttribute, 256, 16);
struct set_alignment(16) CellSpursTaskAttribute2
struct alignas(16) CellSpursTaskAttribute2
{
be_t<u32> revision;
be_t<u32> sizeContext;
@ -680,7 +680,7 @@ CHECK_SIZE_ALIGN(CellSpursTaskAttribute2, 256, 16);
// Exception handler
using CellSpursTasksetExceptionEventHandler = void(vm::ptr<CellSpurs> spurs, vm::ptr<CellSpursTaskset> taskset, u32 idTask, vm::cptr<CellSpursExceptionInfo> info, vm::ptr<void> arg);
struct set_alignment(128) CellSpursTaskExitCode
struct alignas(128) CellSpursTaskExitCode
{
u8 skip[128];
};
@ -719,7 +719,7 @@ struct CellSpursTasksetInfo
CHECK_SIZE(CellSpursTasksetInfo, 9360);
struct set_alignment(8) CellSpursTasksetAttribute
struct alignas(8) CellSpursTasksetAttribute
{
be_t<u32> revision; // 0x00
be_t<u32> sdk_version; // 0x04
@ -734,7 +734,7 @@ struct set_alignment(8) CellSpursTasksetAttribute
CHECK_SIZE_ALIGN(CellSpursTasksetAttribute, 512, 8);
struct set_alignment(128) CellSpursTaskset
struct alignas(128) CellSpursTaskset
{
struct TaskInfo
{
@ -772,7 +772,7 @@ struct set_alignment(128) CellSpursTaskset
CHECK_SIZE_ALIGN(CellSpursTaskset, 128 * 50, 128);
struct set_alignment(128) CellSpursTaskset2
struct alignas(128) CellSpursTaskset2
{
struct TaskInfo
{
@ -812,12 +812,12 @@ struct set_alignment(128) CellSpursTaskset2
CHECK_SIZE_ALIGN(CellSpursTaskset2, 128 * 82, 128);
struct set_alignment(16) CellSpursTaskNameBuffer
struct alignas(16) CellSpursTaskNameBuffer
{
char taskName[CELL_SPURS_MAX_TASK][CELL_SPURS_MAX_TASK_NAME_LENGTH];
};
struct set_alignment(8) CellSpursTasksetAttribute2
struct alignas(8) CellSpursTasksetAttribute2
{
be_t<u32> revision; // 0x00
vm::bcptr<char> name; // 0x04
@ -831,7 +831,7 @@ struct set_alignment(8) CellSpursTasksetAttribute2
CHECK_SIZE_ALIGN(CellSpursTasksetAttribute2, 512, 8);
struct set_alignment(16) CellSpursTaskBinInfo
struct alignas(16) CellSpursTaskBinInfo
{
be_t<u64> eaElf;
be_t<u32> sizeContext;

View file

@ -31,7 +31,7 @@ enum
CELL_SYNC_ERROR_NO_SPU_CONTEXT_STORAGE = 0x80410114, // ???
};
struct set_alignment(4) sync_mutex_t // CellSyncMutex sync var
struct alignas(4) sync_mutex_t // CellSyncMutex sync var
{
be_t<u16> rel;
be_t<u16> acq;
@ -56,7 +56,7 @@ using CellSyncMutex = atomic_be_t<sync_mutex_t>;
CHECK_SIZE_ALIGN(CellSyncMutex, 4, 4);
struct set_alignment(4) sync_barrier_t // CellSyncBarrier sync var
struct alignas(4) sync_barrier_t // CellSyncBarrier sync var
{
be_t<s16> value;
be_t<u16> count;
@ -145,7 +145,7 @@ struct sync_rwm_t // CellSyncRwm sync var
}
};
struct set_alignment(16) CellSyncRwm
struct alignas(16) CellSyncRwm
{
atomic_be_t<sync_rwm_t> ctrl; // sync var
@ -245,7 +245,7 @@ struct sync_queue_t // CellSyncQueue sync var
}
};
struct set_alignment(32) CellSyncQueue
struct alignas(32) CellSyncQueue
{
atomic_be_t<sync_queue_t> ctrl;
@ -277,7 +277,7 @@ enum CellSyncQueueDirection : u32 // CellSyncLFQueueDirection
CELL_SYNC_QUEUE_ANY2ANY = 3, // SPU/PPU to SPU/PPU
};
struct set_alignment(128) CellSyncLFQueue
struct alignas(128) CellSyncLFQueue
{
struct pop1_t
{