Here is a proposed fix for a compile warning on 32 bit machines. I am
interested in feedback on how I replace the shift with 2^(NBITS-1). I
don’t see any reason to keep teh shift, since the compiler should do the
math at compile time. I am a little worried about the NBITS=32 case and
how
is implicitedly converted to a float.
Philip B. (1):
audio_alsa_sink : Fix warning on 32 bit builds.
On machines where sizeof(long) = sizeof(int) the code for calculating
scale factors produced an overflow warning. This change simplifies the
code by eliminating the shift. The compiler should calculate the
constant
at compile time anyway.
@@ -385,7 +385,7 @@ audio_alsa_sink::work_s32 (int noutput_items,
bi = 0;
for (unsigned int i = 0; i < d_period_size; i++){
for (unsigned int chan = 0; chan < nchan; chan++){
@@ -427,7 +427,7 @@ audio_alsa_sink::work_s16_1x2 (int noutput_items,
// process one period of data
bi = 0;
for (unsigned int i = 0; i < d_period_size; i++){
}
@@ -469,7 +469,7 @@ audio_alsa_sink::work_s32_1x2 (int noutput_items,
// process one period of data
bi = 0;
for (unsigned int i = 0; i < d_period_size; i++){