aboutsummaryrefslogtreecommitdiff
path: root/iemlib1/src
diff options
context:
space:
mode:
authormusil <tmusil@users.sourceforge.net>2007-10-24 15:59:23 +0000
committermusil <tmusil@users.sourceforge.net>2007-10-24 15:59:23 +0000
commit21fc2079515c88e156dc04c9781a376a8cc506c0 (patch)
treee0d324420113a7a2f1edbc03badd6543cee5e287 /iemlib1/src
parentc656a4ffdd98eb870916e2adcb9d74fc4b592043 (diff)
union tabfudge_f instead *(long *)(float *)
for HCS's strict aliasing svn path=/trunk/externals/iemlib/; revision=8874
Diffstat (limited to 'iemlib1/src')
-rw-r--r--iemlib1/src/iem_sqrt4~.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/iemlib1/src/iem_sqrt4~.c b/iemlib1/src/iem_sqrt4~.c
index 78b4ef6..50d837a 100644
--- a/iemlib1/src/iem_sqrt4~.c
+++ b/iemlib1/src/iem_sqrt4~.c
@@ -33,7 +33,7 @@ static t_int *iem_sqrt4_tilde_perform(t_int *w)
{
t_float f = *in;
t_float g, h;
- long l = *(long *)(in);
+ union tabfudge_f tf;
if(f < 0.0f)
{
@@ -44,7 +44,8 @@ static t_int *iem_sqrt4_tilde_perform(t_int *w)
}
else
{
- g = iem_sqrt4_tilde_exptab[(l >> 23) & 0xff] * iem_sqrt4_tilde_mantissatab[(l >> 13) & 0x3ff];
+ tf.tf_f = f;
+ g = iem_sqrt4_tilde_exptab[((tf.tf_l) >> 23) & 0xff] * iem_sqrt4_tilde_mantissatab[((tf.tf_l) >> 13) & 0x3ff];
h = f * (1.5f * g - 0.5f * g * g * g * f);
*out++ = h;
*out++ = h;