...
 
Commits (2)
......@@ -143,28 +143,51 @@ typedef struct _freeverb
//#define FIX_DENORM_NAN_FLOAT(v);
//#endif
typedef union ulf
{
unsigned long ul;
float f;
} ulf;
#if defined(__i386__) || defined(__x86_64__) // Type punning code:
static inline float fix_denorm_nan_float(float v);
#if PD_FLOATSIZE == 32
static inline float fix_denorm_nan_float(float v)
typedef union
{
#ifndef IRIX
ulf u;
t_float f;
uint32_t ui;
}ulf;
u.f = v;
if ((((u.ul & 0x7f800000) == 0L) && (u.f != 0.f)) || ((u.ul & 0x7f800000) == 0x7f800000))
/* Test strictly for NANs and infs */
static inline t_float fix_denorm_nan_float(t_float f)
{
ulf pun;
pun.f = f;
if ((((pun.ui & 0x7f800000) == 0L) && (pun.f != 0.f)) || ((pun.ui & 0x7f800000) == 0x7f800000))
/* if the float is denormal or NaN, return 0.0 */
v = 0.0f;
//return 0.0f;
#endif //IRIX
return v;
f = 0.0f;
return f;
}
#elif PD_FLOATSIZE == 64
typedef union
{
t_float f;
uint32_t ui[2];
}ulf;
/* Test for NANs and infs */
static inline int fix_denorm_nan_float(t_float f)
{
ulf pun;
pun.f = f;
if ((((pun.ui[1] & 0x7ff00000) == 0L) && (u.f != 0.f)) || ((pun.ui[1] & 0x7ff00000) == 0x7ff00000))
/* if the float is denormal or NaN, return 0.0 */
f = 0.0f
return f;
}
#endif // endif PD_FLOATSIZE
#else // if not defined(__i386__) || defined(__x86_64__)
#define fix_denorm_nan_float(f) 0
#endif // end if defined(__i386__) || defined(__x86_64__)
/* we need prototypes for Mac for everything */
static void comb_setdamp(t_freeverb *x, t_floatarg val);
static void comb_setfeedback(t_freeverb *x, t_floatarg val);
......