[Speex-dev] FIXED_POINT warns on compute_weighted_codebook

Tom Newbern tnewbern at comcast.net
Sat Oct 23 07:37:00 PDT 2004


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.


-----Original Message-----
From: speex-dev-bounces at xiph.org [mailto:speex-dev-bounces at xiph.org]On
Behalf Of Ashhar Farhan
Sent: Saturday, October 23, 2004 1:22 AM
To: speex-dev at xiph.org
Subject: [Speex-dev] FIXED_POINT warns on compute_weighted_codebook

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 at xiph.org

More information about the Speex-dev mailing list