lvqcl wrote:> About a commit http://git.xiph.org/?p=flac.git;a=commitdiff;h=40e817dc526d1d41e900bb0f54d1a4451bda01ed > > I think it's more consistent to write > > FLAC__int16 s16buffer[FLAC__MAX_BLOCK_SIZE * FLAC__MAX_CHANNELS * sizeof(FLAC__int32)/sizeof(FLAC__int16)]; > > instead of > > FLAC__int16 s16buffer[FLAC__MAX_BLOCK_SIZE * FLAC__MAX_CHANNELS * sizeof(FLAC__int16)];Really? Would you also write this? : FLAC__int32 s32buffer[FLAC__MAX_BLOCK_SIZE * FLAC__MAX_CHANNELS * sizeof(FLAC__int32)/sizeof(FLAC__int32)]; Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/
Erik de Castro Lopo wrote:>> FLAC__int16 s16buffer[FLAC__MAX_BLOCK_SIZE * FLAC__MAX_CHANNELS * sizeof(FLAC__int32)/sizeof(FLAC__int16)]; >> >> instead of >> >> FLAC__int16 s16buffer[FLAC__MAX_BLOCK_SIZE * FLAC__MAX_CHANNELS * sizeof(FLAC__int16)]; > > Really? Would you also write this? : > > FLAC__int32 s32buffer[FLAC__MAX_BLOCK_SIZE * FLAC__MAX_CHANNELS * sizeof(FLAC__int32)/sizeof(FLAC__int32)];Well, in the latter case it's obviously redundant; in the former case it's not so obvious (at least, not for me).
lvqcl wrote:> Erik de Castro Lopo wrote: > > >> FLAC__int16 s16buffer[FLAC__MAX_BLOCK_SIZE * FLAC__MAX_CHANNELS * sizeof(FLAC__int32)/sizeof(FLAC__int16)]; > >> > >> instead of > >> > >> FLAC__int16 s16buffer[FLAC__MAX_BLOCK_SIZE * FLAC__MAX_CHANNELS * sizeof(FLAC__int16)]; > > > > Really? Would you also write this? : > > > > FLAC__int32 s32buffer[FLAC__MAX_BLOCK_SIZE * FLAC__MAX_CHANNELS * sizeof(FLAC__int32)/sizeof(FLAC__int32)]; > > Well, in the latter case it's obviously redundant; in the former case it's > not so obvious (at least, not for me).Maybe a comment stating that all these array are exactly the same in bytes, but the number of elements is different because of the different size of each element? Would that help? Erik -- ---------------------------------------------------------------------- Erik de Castro Lopo http://www.mega-nerd.com/