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 /Alc/panning.c | |
parent | de62ab97e912525f20272153f6a4c896e833839d (diff) |
Use a different way to get the size of structs with flexible array members
Diffstat (limited to 'Alc/panning.c')
-rw-r--r-- | Alc/panning.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/Alc/panning.c b/Alc/panning.c index e4941720..5ce93b9b 100644 --- a/Alc/panning.c +++ b/Alc/panning.c @@ -922,13 +922,11 @@ static void InitHrtfPanning(ALCdevice *device, bool hoa_mode) }; const ALfloat (*AmbiMatrix)[2][MAX_AMBI_COEFFS] = hoa_mode ? AmbiMatrixHOA : AmbiMatrixFOA; ALsizei count = hoa_mode ? 9 : 4; - size_t sizeof_hrtfstate; ALsizei i; static_assert(COUNTOF(AmbiPoints) <= HRTF_AMBI_MAX_CHANNELS, "HRTF_AMBI_MAX_CHANNELS is too small"); - sizeof_hrtfstate = offsetof(DirectHrtfState, Chan[count]); - device->Hrtf = al_calloc(16, sizeof_hrtfstate); + device->Hrtf = al_calloc(16, FAM_SIZE(DirectHrtfState, Chan, count)); for(i = 0;i < count;i++) { |