Added .aligned() method for vm::ptr

Added set_alignment() macro for setting alignment
Added alignof32() macro similar to sizeof32()
Added CHECK_SIZE, CHECK_ALIGN macro with static_assert
Minor refactoring
This commit is contained in:
Nekotekina 2015-06-21 17:48:21 +03:00
parent a7f77c27f7
commit e896da8064
18 changed files with 1202 additions and 1237 deletions

View file

@ -867,7 +867,7 @@ s32 cellAudioAddData(u32 portNum, vm::ptr<float> src, u32 samples, float volume)
return CELL_AUDIO_ERROR_NOT_INIT;
}
if (portNum >= AUDIO_PORT_COUNT || !src || src.addr() % 4)
if (portNum >= AUDIO_PORT_COUNT || !src || !src.aligned())
{
return CELL_AUDIO_ERROR_PARAM;
}
@ -900,7 +900,7 @@ s32 cellAudioAdd2chData(u32 portNum, vm::ptr<float> src, u32 samples, float volu
return CELL_AUDIO_ERROR_NOT_INIT;
}
if (portNum >= AUDIO_PORT_COUNT || !src || src.addr() % 4)
if (portNum >= AUDIO_PORT_COUNT || !src || !src.aligned())
{
return CELL_AUDIO_ERROR_PARAM;
}
@ -963,7 +963,7 @@ s32 cellAudioAdd6chData(u32 portNum, vm::ptr<float> src, float volume)
return CELL_AUDIO_ERROR_NOT_INIT;
}
if (portNum >= AUDIO_PORT_COUNT || !src || src.addr() % 4)
if (portNum >= AUDIO_PORT_COUNT || !src || !src.aligned())
{
return CELL_AUDIO_ERROR_PARAM;
}