try using endianness conversion functions instead of icky macros
This commit is contained in:
@@ -81,14 +81,6 @@ extern FILE* logtarget[];
|
||||
#define RAD_TO_DEGREE(r) ((r * 180.0f) / WIIMOTE_PI)
|
||||
#define DEGREE_TO_RAD(d) (d * (WIIMOTE_PI / 180.0f))
|
||||
|
||||
/* Convert to big endian */
|
||||
#define BIG_ENDIAN_LONG(i) (htonl(i))
|
||||
#define BIG_ENDIAN_SHORT(i) (htons(i))
|
||||
|
||||
/* Convert from big endian */
|
||||
#define FROM_BIG_ENDIAN_LONG(i) (ntohl(i))
|
||||
#define FROM_BIG_ENDIAN_SHORT(i) (ntohs(i))
|
||||
|
||||
#define absf(x) ((x >= 0) ? (x) : (x * -1.0f))
|
||||
#define diff_f(x, y) ((x >= y) ? (absf(x - y)) : (absf(y - x)))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user