You've already forked Microtransactions64
mirror of
https://github.com/Print-and-Panic/Microtransactions64.git
synced 2026-01-21 10:17:19 -08:00
Clean up AVOID_UB ifdefs
This commit is contained in:
@@ -21,23 +21,13 @@
|
||||
#define DEBUG_ASSERT(exp)
|
||||
#endif
|
||||
|
||||
// Pointer casting is technically UB, and avoiding it gets rid of endian issues
|
||||
// as well as a nice side effect.
|
||||
#ifdef AVOID_UB
|
||||
// Pointer casting is technically UB, and avoiding it gets rid of endian issues as well as a nice side effect.
|
||||
#define GET_HIGH_U16_OF_32(var) ((u16)((var) >> 16))
|
||||
#define GET_HIGH_S16_OF_32(var) ((s16)((var) >> 16))
|
||||
#define GET_LOW_U16_OF_32(var) ((u16)((var) & 0xFFFF))
|
||||
#define GET_LOW_S16_OF_32(var) ((s16)((var) & 0xFFFF))
|
||||
#define SET_HIGH_U16_OF_32(var, x) ((var) = ((var) & 0xFFFF) | ((x) << 16))
|
||||
#define SET_HIGH_S16_OF_32(var, x) ((var) = ((var) & 0xFFFF) | ((x) << 16))
|
||||
#else
|
||||
#define GET_HIGH_U16_OF_32(var) (((u16 *)&(var))[0])
|
||||
#define GET_HIGH_S16_OF_32(var) (((s16 *)&(var))[0])
|
||||
#define GET_LOW_U16_OF_32(var) (((u16 *)&(var))[1])
|
||||
#define GET_LOW_S16_OF_32(var) (((s16 *)&(var))[1])
|
||||
#define SET_HIGH_U16_OF_32(var, x) ((((u16 *)&(var))[0]) = (x))
|
||||
#define SET_HIGH_S16_OF_32(var, x) ((((s16 *)&(var))[0]) = (x))
|
||||
#endif
|
||||
|
||||
// Layers
|
||||
#if SILHOUETTE
|
||||
|
||||
@@ -255,11 +255,7 @@ f32 gSineTable[] = {
|
||||
0.999830604f, 0.999857664f, 0.999882340f, 0.999904692f,
|
||||
0.999924719f, 0.999942362f, 0.999957621f, 0.999970615f,
|
||||
0.999981165f, 0.999989390f, 0.999995291f, 0.999998808f,
|
||||
#ifndef AVOID_UB
|
||||
};
|
||||
|
||||
f32 gCosineTable[0x1000] = {
|
||||
#endif
|
||||
// cosine
|
||||
1.000000000f, 0.999998808f, 0.999995291f, 0.999989390f,
|
||||
0.999981165f, 0.999970615f, 0.999957621f, 0.999942362f,
|
||||
|
||||
Reference in New Issue
Block a user