aboutsummaryrefslogtreecommitdiff
path: root/shared/common/binport.c
diff options
context:
space:
mode:
authorN.N. <krzyszcz@users.sourceforge.net>2004-05-12 15:01:35 +0000
committerN.N. <krzyszcz@users.sourceforge.net>2004-05-12 15:01:35 +0000
commit7d42c7df89091db055ad77ef4bbfb64059858e52 (patch)
tree5390a17317f473e89aeecc0554069c9f90df6b41 /shared/common/binport.c
parent075b865652ce146fe8419494b149ceadcac48071 (diff)
mapping feature for ported names
svn path=/trunk/externals/miXed/; revision=1725
Diffstat (limited to 'shared/common/binport.c')
-rw-r--r--shared/common/binport.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/shared/common/binport.c b/shared/common/binport.c
index 90eb4a1..e2c9d34 100644
--- a/shared/common/binport.c
+++ b/shared/common/binport.c
@@ -245,12 +245,12 @@ static int binport_readfloat(FILE *fp, float *fptr)
}
else if (ex || hi || lo)
{
- double d;
+ double dhi, dlo, dabs;
ex -= 0x401e;
- hi = ((hi - 0x7fffffff) - 1) + ((float)0x7fffffff + 1.);
- lo = ((lo - 0x7fffffff) - 1) + ((float)0x7fffffff + 1.);
- d = ldexp(hi, ex) + ldexp(lo, ex - 32);
- *fptr = ((word[0] & 0x80) ? -(float)d : (float)d);
+ dhi = (double)((hi - 0x7fffffff) - 1) + ((float)0x7fffffff + 1.);
+ dlo = (double)((lo - 0x7fffffff) - 1) + ((float)0x7fffffff + 1.);
+ dabs = ldexp(dhi, ex) + ldexp(dlo, ex - 32);
+ *fptr = ((word[0] & 0x80) ? -(float)dabs : (float)dabs);
}
else *fptr = 0.;
#ifdef BINPORT_DEBUG
@@ -679,7 +679,7 @@ static int maxtext_nextatom(FILE *fp, t_atom *ap)
else if (floatstate == 2)
binport_setint(ap, atoi(buf));
else if (floatstate == 4 || floatstate == 5 || floatstate == 8)
- binport_setfloat(ap, atof(buf));
+ binport_setfloat(ap, (float)atof(buf));
else
binport_setsymbol(ap, gensym(buf));
}