summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-12-07 17:36:04 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2008-12-07 17:36:04 +0000
commitbbcd70959d18dee14c47e32250ff56a88305071d (patch)
tree6976db5e44f7eeb8ca3d2830171c06fd6ad21f8d
parent8d6ec21fe74f90a692184a290cf14a4f7b02c59f (diff)
downloadnuttx-bbcd70959d18dee14c47e32250ff56a88305071d.tar.gz
nuttx-bbcd70959d18dee14c47e32250ff56a88305071d.tar.bz2
nuttx-bbcd70959d18dee14c47e32250ff56a88305071d.zip
Several syntax errors
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1431 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/lib/lib_fixedmath.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/nuttx/lib/lib_fixedmath.c b/nuttx/lib/lib_fixedmath.c
index e5f7ce3a4..b13e1fafd 100644
--- a/nuttx/lib/lib_fixedmath.c
+++ b/nuttx/lib/lib_fixedmath.c
@@ -178,7 +178,7 @@ b16_t b16sqr(b16_t a)
/* Overflow occurred if the result is negative */
- sq = (bt_t)ub16sqr(a);
+ sq = (b16_t)ub16sqr(a);
if (sq < 0)
{
sq = b16MAX;
@@ -202,10 +202,10 @@ ub16_t ub16sqr(ub16_t a)
* = (mi*mi)*2**16 + 2*(mi*mf) + mf*mf*2**-16 (b16)
*/
- uint32 mi = ((uint32)m1 >> 16);
- uint32 mf = ((uint32)m1 & 0x0000ffff);
+ uint32 mi = ((uint32)a >> 16);
+ uint32 mf = ((uint32)a & 0x0000ffff);
- return (mi*mi << 16) + (mi*mf << 1) (((mf*mf) + b16HALF) >> 16);
+ return (mi*mi << 16) + (mi*mf << 1) + ((mf*mf + b16HALF) >> 16);
}
/****************************************************************************