Commit 184d84f6 authored by Monty Montgomery's avatar Monty Montgomery

Corrections necessary for proper compilation by GCC 4.x



git-svn-id: https://svn.xiph.org/trunk/postfish@10418 0101bb08-14d6-0310-b084-bc0e0c8e3800
parent e8bf0473
......@@ -312,7 +312,7 @@ int input_load(void){
/* Crappy! Use a lib to do this for pete's sake! */
if(f){
unsigned char headerid[12];
char headerid[12];
off_t filelength;
fe->f=f;
......
......@@ -85,22 +85,43 @@ static inline int zerome(double x){
#ifdef UGLY_IEEE754_FLOAT32_HACK
static inline float todB_a(float x){
return (float)((*((int32_t *)&x))&0x7fffffff) * 7.17711438e-7f -764.6161886f;
static inline float todB_a(const float x){
union {
u_int32_t i;
float f;
} ix;
ix.f = x;
ix.i = ix.i&0x7fffffff;
return (float)(ix.i * 7.17711438e-7f -764.6161886f);
}
// eliminate a *.5 in ops on sq magnitudes
static inline float todB_a2(float x){
return (float)((*((int32_t *)&x))&0x7fffffff) * 3.58855719e-7f -382.3080943f;
static inline float todB_a2(const float x){
union {
u_int32_t i;
float f;
} ix;
ix.f = x;
ix.i = ix.i&0x7fffffff;
return (float)(ix.i * 3.58855719e-7f -382.3080943f);
}
static inline float fromdB_a(float x){
int y=(x < -300.f ? 0 : 1.39331762961e+06f*(x+764.6161886f));
return *(float *)&y;
static inline float fromdB_a(const float x){
union {
u_int32_t i;
float f;
} ix;
ix.i = (x < -300.f ? 0 : 1.39331762961e+06f*(x+764.6161886f));
return ix.f;
}
static inline void underguard(float *x){
if(((*(int32_t *) &x) & 0x7f800000)==0) *x=0.0f;
union {
u_int32_t i;
float f;
} ix;
ix.f = *x;
if((ix.i & 0x7f800000)==0) *x=0.0f;
}
#else
......
#define VERSION "$Id$ "
/* DO NOT EDIT: Automated versioning hack [Thu Jan 20 00:32:25 EST 2005] */
/* DO NOT EDIT: Automated versioning hack [Sun Nov 20 21:43:22 EST 2005] */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment