diff options
author | Chris Robinson <[email protected]> | 2017-04-18 14:11:15 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2017-04-18 14:11:15 -0700 |
commit | 55011d4bfd46c920580d1aa6663bcfdb1e996d3e (patch) | |
tree | 67040a4f7e98acedc060930e146854f61dd8e71b /OpenAL32/alAuxEffectSlot.c | |
parent | de62ab97e912525f20272153f6a4c896e833839d (diff) |
Use a different way to get the size of structs with flexible array members
Diffstat (limited to 'OpenAL32/alAuxEffectSlot.c')
-rw-r--r-- | OpenAL32/alAuxEffectSlot.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/OpenAL32/alAuxEffectSlot.c b/OpenAL32/alAuxEffectSlot.c index 3ec857ca..5d110500 100644 --- a/OpenAL32/alAuxEffectSlot.c +++ b/OpenAL32/alAuxEffectSlot.c @@ -118,9 +118,7 @@ AL_API ALvoid AL_APIENTRY alGenAuxiliaryEffectSlots(ALsizei n, ALuint *effectslo ALsizei newcount = curarray->count + n; ALCdevice *device; - newarray = al_calloc(DEF_ALIGN, - offsetof(struct ALeffectslotArray, slot[newcount]) - ); + newarray = al_calloc(DEF_ALIGN, FAM_SIZE(struct ALeffectslotArray, slot, newcount)); newarray->count = newcount; memcpy(newarray->slot, tmpslots, sizeof(ALeffectslot*)*n); if(curarray) @@ -170,9 +168,7 @@ AL_API ALvoid AL_APIENTRY alDeleteAuxiliaryEffectSlots(ALsizei n, const ALuint * ALsizei j, k; assert(newcount >= 0); - newarray = al_calloc(DEF_ALIGN, - offsetof(struct ALeffectslotArray, slot[newcount]) - ); + newarray = al_calloc(DEF_ALIGN, FAM_SIZE(struct ALeffectslotArray, slot, newcount)); newarray->count = newcount; for(i = j = 0;i < newarray->count;) { |