util_swa_* + GMQCC_INLINE

This commit is contained in:
Wolfgang Bumiller 2012-12-23 13:11:20 +01:00
parent 1731a29c51
commit 2382fdee50

6
util.c
View file

@ -196,13 +196,13 @@ void util_debug(const char *area, const char *ms, ...) {
* data.
*/
#if PLATFORM_BYTE_ORDER == GMQCC_BYTE_ORDER_BIG
static void util_swap16(uint16_t *d, size_t l) {
static GMQCC_INLINE void util_swap16(uint16_t *d, size_t l) {
while (l--) {
d[l] = (d[l] << 8) | (d[l] >> 8);
}
}
static void util_swap32(uint32_t *d, size_t l) {
static GMQCC_INLINE void util_swap32(uint32_t *d, size_t l) {
while (l--) {
uint32_t v;
v = ((d[l] << 8) & 0xFF00FF00) | ((d[l] >> 8) & 0x00FF00FF);
@ -213,7 +213,7 @@ void util_debug(const char *area, const char *ms, ...) {
/* Some strange system doesn't like constants that big, AND doesn't recognize an ULL suffix
* so let's go the safe way
*/
static void util_swap64(uint32_t *d, size_t l) {
static GMQCC_INLINE void util_swap64(uint32_t *d, size_t l) {
/*
while (l--) {
uint64_t v;