Skip to content

Definition and initialization of local arrays

There are two issues related to the arrays in the framework:

  1. Some local ROM tables are not defined as "const", e.g. int16_t chidx1[MC_PARAMUPMIX_COMBINATIONS] = { 0, 1, 4, 5 }; The keyword const should be added to them.

  2. Some arrays are initialized to zero using instances like float x_0_buf[CPE_CHANNELS][N_MAX] = { { 0.0f } };. I vaguely remember that it was observed in the past that this form can cause troubles in some compilers/platforms. Thus the correct way is to initialize them using for loops, set_zero(), etc.

Please share your view on whether these instances should be fixed. Personally, I would be in favor to do so but I am open to other views as well.