diff options
| author | Flatmush <Flatmush@gmail.com> | 2011-02-14 21:53:27 +0000 |
|---|---|---|
| committer | Flatmush <Flatmush@gmail.com> | 2011-02-14 21:53:27 +0000 |
| commit | e06f8263886ba7ec96265b8d64ddc62a4409077b (patch) | |
| tree | 2ac2ee33bad4a244666ff2620ebcb3bd359998b2 | |
| parent | 87c75fa88018ab6c9a0751da9f4f1b40b6f46d63 (diff) | |
| download | libfixmath-e06f8263886ba7ec96265b8d64ddc62a4409077b.tar.gz | |
Changed consts such as e, pi, one to macros as suggested by mth for compiler optimization purposes.
| -rw-r--r-- | libfixmath/fix16.c | 3 | ||||
| -rw-r--r-- | libfixmath/fix16.h | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/libfixmath/fix16.c b/libfixmath/fix16.c index f564202..3fef27d 100644 --- a/libfixmath/fix16.c +++ b/libfixmath/fix16.c @@ -1,10 +1,11 @@ #include "fix16.h"
-
+/* Replaced as defines, these are left here to uncomment for code dependant on the symbols.
const fix16_t fix16_pi = 205887;
const fix16_t fix16_e = 178145;
const fix16_t fix16_one = 0x00010000;
+*/
diff --git a/libfixmath/fix16.h b/libfixmath/fix16.h index 05e4bc3..aacfd8e 100644 --- a/libfixmath/fix16.h +++ b/libfixmath/fix16.h @@ -11,11 +11,13 @@ extern "C" #define fix16_MAX (fix16_t)0x7FFFFFFF /*!< the maximum value of fix16_t */
#define fix16_MIN (fix16_t)0x80000000 /*!< the minimum value of fix16_t */
+#define fix16_pi 205887 /*!< fix16_t value of pi */
+#define fix16_e 178145 /*!< fix16_t value of e */
+#define fix16_one 0x00010000 /*!< fix16_t value of 1 */
+
typedef int32_t fix16_t;
-extern const fix16_t fix16_pi; /*!< fix16_t value of pi */
-extern const fix16_t fix16_e; /*!< fix16_t value of e */
-extern const fix16_t fix16_one; /*!< fix16_t value of 1 */
+
/*! Coverts a fix16_t to a double and returns the result.
*/
|
