Ashhar Farhan
2004-Oct-22 22:22 UTC
[Speex-dev] FIXED_POINT warns on compute_weighted_codebook
hi, i am trying to compile a fixed point version of lipspeex on desktop windows environment. a short reason for the complicated story is that we need to keep the 'engine' part of our project same across the various ports of our voip project (blame the pointy haired boss). now, when i compile with FIXED_POINT defined in the Visual C++ 6.0, i get these errors: e:\phonestack\engine\speex\cb_search.c(185) : warning C4133: 'function' : incompatible types - from 'short *' to 'float *' e:\phonestack\engine\speex\nb_celp.c(875) : warning C4761: integral size mismatch in argument; conversion supplied e:\phonestack\engine\speex\nb_celp.c(1603) : warning C4761: integral size mismatch in argument; conversion supplied of these, the last two are not worrisome. but the first error is forcing a short pointer to a float. any clue as to what is going on? - farhan
Tom Newbern
2004-Oct-23 07:39 UTC
[Speex-dev] FIXED_POINT warns on compute_weighted_codebook
Hi, The culprit for the 'short * to float *' is prarmeter 4 of compute_weighted_codebook(). This should be of type spx_word16_t not float. This change will allow compilation in both fixed and floating point without warning. This warning does not cause any problems as the parameter is not used by the function. It is necessary however as the SSE build does use it. The other two warnings can be fixed with type casting. The constant arument to the multiply is a float so the compiler converts ener to a float and provides the result as a float. The complier then safely converts the float to a spx_word32_t if necessary. By adding "(spx_word32_t)(ener*(1/2.2))" to parameter 3 you can avoid the warning. Tom -----Original Message----- From: speex-dev-bounces@xiph.org [mailto:speex-dev-bounces@xiph.org]On Behalf Of Ashhar Farhan Sent: Saturday, October 23, 2004 1:22 AM To: speex-dev@xiph.org Subject: [Speex-dev] FIXED_POINT warns on compute_weighted_codebook hi, i am trying to compile a fixed point version of lipspeex on desktop windows environment. a short reason for the complicated story is that we need to keep the 'engine' part of our project same across the various ports of our voip project (blame the pointy haired boss). now, when i compile with FIXED_POINT defined in the Visual C++ 6.0, i get these errors: e:\phonestack\engine\speex\cb_search.c(185) : warning C4133: 'function' : incompatible types - from 'short *' to 'float *' e:\phonestack\engine\speex\nb_celp.c(875) : warning C4761: integral size mismatch in argument; conversion supplied e:\phonestack\engine\speex\nb_celp.c(1603) : warning C4761: integral size mismatch in argument; conversion supplied of these, the last two are not worrisome. but the first error is forcing a short pointer to a float. any clue as to what is going on? - farhan _______________________________________________ Speex-dev mailing list Speex-dev@xiph.org http://lists.xiph.org/mailman/listinfo/speex-dev