From 53408e2cb3d0705f261e9756bcf6f3f6c90c3fe9 Mon Sep 17 00:00:00 2001 From: inmarket Date: Sat, 9 Nov 2013 19:13:01 +1000 Subject: [PATCH] Fix incorrect naming of GMISC_INVSQRT_... macros. --- demos/modules/gdisp/streaming/gfxconf.h | 4 ++-- demos/modules/gdisp/streaming/main.c | 4 ++-- gfxconf.example.h | 4 ++-- include/gmisc/options.h | 12 ++++++------ src/gmisc/trig.c | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/demos/modules/gdisp/streaming/gfxconf.h b/demos/modules/gdisp/streaming/gfxconf.h index 4038a3fd..82843184 100644 --- a/demos/modules/gdisp/streaming/gfxconf.h +++ b/demos/modules/gdisp/streaming/gfxconf.h @@ -25,7 +25,7 @@ #define GFX_USE_GMISC TRUE #define GMISC_NEED_INVSQRT TRUE -//#define GDISP_INVSQRT_MIXED_ENDIAN TRUE -//#define GDISP_INVSQRT_REAL_SLOW TRUE +//#define GMISC_INVSQRT_MIXED_ENDIAN TRUE +//#define GMISC_INVSQRT_REAL_SLOW TRUE #endif /* _GFXCONF_H */ diff --git a/demos/modules/gdisp/streaming/main.c b/demos/modules/gdisp/streaming/main.c index 5b857eeb..4ad48b6c 100644 --- a/demos/modules/gdisp/streaming/main.c +++ b/demos/modules/gdisp/streaming/main.c @@ -42,11 +42,11 @@ * your processor. * * You can modify the implementation of invsqrt() by firstly defining - * #define GDISP_INVSQRT_MIXED_ENDIAN TRUE + * #define GMISC_INVSQRT_MIXED_ENDIAN TRUE * in your gfxconf.h file. * * If it still doesn't work then instead define - * #define GDISP_INVSQRT_REAL_SLOW TRUE + * #define GMISC_INVSQRT_REAL_SLOW TRUE * in your gfxconf.h file. This should always work although it will probably be slow. */ #define BALLCOLOR1 Red diff --git a/gfxconf.example.h b/gfxconf.example.h index 74d7f768..260d8bf6 100644 --- a/gfxconf.example.h +++ b/gfxconf.example.h @@ -181,8 +181,8 @@ #define GWIN_CONSOLE_USE_BASESTREAM FALSE #define GWIN_CONSOLE_USE_FLOAT FALSE #define GWIN_NEED_IMAGE_ANIMATION FALSE - #define GDISP_INVSQRT_MIXED_ENDIAN FALSE - #define GDISP_INVSQRT_REAL_SLOW FALSE + #define GMISC_INVSQRT_MIXED_ENDIAN FALSE + #define GMISC_INVSQRT_REAL_SLOW FALSE */ /* Optional Low Level Driver Definitions */ diff --git a/include/gmisc/options.h b/include/gmisc/options.h index 9c309487..06f689ec 100644 --- a/include/gmisc/options.h +++ b/include/gmisc/options.h @@ -53,15 +53,15 @@ * the same endianness. Unfortunately there are some strange * processors that don't eg. some very early ARM devices. * For those where the endianness doesn't match you can fix it by - * defining GDISP_INVSQRT_MIXED_ENDIAN. + * defining GMISC_INVSQRT_MIXED_ENDIAN. * @note This still assumes the processor is using an ieee floating point format. * * If you have a software floating point that uses a non-standard * floating point format (or very strange hardware) then define - * GDISP_INVSQRT_REAL_SLOW and it will do it the hard way. + * GMISC_INVSQRT_REAL_SLOW and it will do it the hard way. */ - #ifndef GDISP_INVSQRT_MIXED_ENDIAN - #define GDISP_INVSQRT_MIXED_ENDIAN FALSE + #ifndef GMISC_INVSQRT_MIXED_ENDIAN + #define GMISC_INVSQRT_MIXED_ENDIAN FALSE #endif /** * @brief Modifies the @p invsqrt() function to do things the long slow way. @@ -69,8 +69,8 @@ * processor floating point format. * @note This makes the @p invsqrt() function very slow. */ - #ifndef GDISP_INVSQRT_REAL_SLOW - #define GDISP_INVSQRT_REAL_SLOW FALSE + #ifndef GMISC_INVSQRT_REAL_SLOW + #define GMISC_INVSQRT_REAL_SLOW FALSE #endif /** @} */ diff --git a/src/gmisc/trig.c b/src/gmisc/trig.c index 2485da85..3c6dd461 100644 --- a/src/gmisc/trig.c +++ b/src/gmisc/trig.c @@ -144,7 +144,7 @@ #if GMISC_NEED_INVSQRT // Algorithm based on Quake code. - #if GDISP_INVSQRT_REAL_SLOW + #if GMISC_INVSQRT_REAL_SLOW #include float invsqrt(float n) { return 1.0/sqrt(n); @@ -157,7 +157,7 @@ x2 = n * 0.5F; // Convert into an int32 (no binary format conversion) - #if GDISP_INVSQRT_MIXED_ENDIAN + #if GMISC_INVSQRT_MIXED_ENDIAN ((char *)&i)[0] = ((char *)&n)[3]; ((char *)&i)[1] = ((char *)&n)[2]; ((char *)&i)[2] = ((char *)&n)[1]; @@ -170,7 +170,7 @@ i = 0x5F375A86 - (i >> 1); // The quake code used 0x5F3759DF but this is better. // Convert back to a float (no binary format conversion) - #if GDISP_INVSQRT_MIXED_ENDIAN + #if GMISC_INVSQRT_MIXED_ENDIAN ((char *)&n)[0] = ((char *)&i)[3]; ((char *)&n)[1] = ((char *)&i)[2]; ((char *)&n)[2] = ((char *)&i)[1];