Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Macros Are Evil
08-28-2015, 11:41 AM, (This post was last modified: 08-28-2015, 11:50 AM by CrystalH.)
#4
RE: Macros Are Evil
Ah heh okay I see now.
They didn't put () around the SIMD_2_PI define:
should be:
#define SIMD_2_PI (btScalar(2.0) * SIMD_PI)
without that the
SIMD_DEGS_PER_RAD (btScalar(360.0) / SIMD_2_PI)
becomes 360 / 2 * PI = 180 * PI instead of 360 / (2 * PI) = 180 / PI.

Well yeah but I won't say defines are evil, just need special care.
Same could be said about = and ==. E.g. you can write if (a = b) and loose a lot of time to get what's wrong if you don't know already.
Reply


Messages In This Thread
Macros Are Evil - by NaN - 08-28-2015, 10:21 AM
RE: Macros Are Evil - by CrystalH - 08-28-2015, 10:31 AM
RE: Macros Are Evil - by NaN - 08-28-2015, 10:56 AM
RE: Macros Are Evil - by CrystalH - 08-28-2015, 11:41 AM
RE: Macros Are Evil - by CrystalH - 08-29-2015, 03:12 AM
RE: Macros Are Evil - by NaN - 08-29-2015, 09:23 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)