Re: [AD] [ alleg-Bugs-1650580 ] Problem in fixed point library. |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
- To: Coordination of admins/developers of the game programming library Allegro <alleg-developers@xxxxxxxxxx>
- Subject: Re: [AD] [ alleg-Bugs-1650580 ] Problem in fixed point library.
- From: Elias Pschernig <elias@xxxxxxxxxx>
- Date: Sun, 04 Feb 2007 15:02:44 +0100
I'll apply the below patch if nobody objects - the bug reporter claims
to have tested it, and LONG_LONG also is used for fixmul so should cause
no problem here.
Index: include/allegro/inline/fmaths.inl
===================================================================
--- include/allegro/inline/fmaths.inl (revision 7706)
+++ include/allegro/inline/fmaths.inl (working copy)
@@ -151,7 +151,7 @@
return (x < 0) ? -0x7FFFFFFF : 0x7FFFFFFF;
}
else
- return ftofix(fixtof(x) / fixtof(y));
+ return ((LONG_LONG)x << 16) / (LONG_LONG)y;
})
--
Elias Pschernig