diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-12-07 17:36:04 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-12-07 17:36:04 +0000 |
commit | bbcd70959d18dee14c47e32250ff56a88305071d (patch) | |
tree | 6976db5e44f7eeb8ca3d2830171c06fd6ad21f8d /nuttx/lib | |
parent | 8d6ec21fe74f90a692184a290cf14a4f7b02c59f (diff) | |
download | px4-nuttx-bbcd70959d18dee14c47e32250ff56a88305071d.tar.gz px4-nuttx-bbcd70959d18dee14c47e32250ff56a88305071d.tar.bz2 px4-nuttx-bbcd70959d18dee14c47e32250ff56a88305071d.zip |
Several syntax errors
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1431 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/lib')
-rw-r--r-- | nuttx/lib/lib_fixedmath.c | 8 |
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); } /**************************************************************************** |