audio: mfcc: fix signed 1-bit field#9385
Conversation
| int waiting_fill:1; /**< booleans */ | ||
| int prev_samples_valid:1; | ||
| unsigned int waiting_fill:1; /**< booleans */ | ||
| unsigned int prev_samples_valid:1; |
There was a problem hiding this comment.
let's just make them bool to avoid bit-operations. This will waste 4 bytes (unless the compiler decides to make them different size) but will be prettier, atomic, and avoid issues like the present one
No more, I just left out this fix from there. I didn't notice that this was done before. |
lyakh
left a comment
There was a problem hiding this comment.
@marc-hb misunderstood me, I probably didn't explain well enough: I propose to make these pure bool with no bit-counts. Just
bool waiting_fill; /**< booleans */
bool prev_samples_valid;
The 2 big disadvantages that I see with these 1-bit flags are (1) non-atomicity, (2) decreased speed. Sorry, @cujomalainey , I'll dare request this change again, but if there's an otherwise general consensus that this is ok, feel free to dismiss it.
Sparse complained about this since signed fields should be >=2 bits minimum. Signed-off-by: Curtis Malainey <cujomalainey@chromium.org>
Sparse complained about this since signed fields should be >=2 bits minimum.