From 242276650b9bd6fbd1d98354171883aecbf72bd1 Mon Sep 17 00:00:00 2001 From: fuzzie Date: Mon, 24 Mar 2008 16:12:32 +0000 Subject: [PATCH] endianlove.h: don't use stdint definitions outside the stdint ifdef git-svn-id: svn://openc2e.ccdevnet.org/openc2e/trunk@1746 5a3b5b51-85f2-0310-b56e-886e3cf1dda3 --- endianlove.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/endianlove.h b/endianlove.h index 07e18d2..01a0eb8 100644 --- a/endianlove.h +++ b/endianlove.h @@ -54,22 +54,22 @@ typedef unsigned int uint32; # if HAVE_BYTESWAP_H #include -static inline uint16_t swapEndianShort(uint16_t a) { +static inline uint16 swapEndianShort(uint16 a) { return bswap_16(a); } -static inline uint32_t swapEndianLong(uint32_t a) { +static inline uint32 swapEndianLong(uint32 a) { return bswap_32(a); } # else // HAVE_BYTESWAP_H -static inline uint16_t swapEndianShort(uint16_t a) { +static inline uint16 swapEndianShort(uint16 a) { return ((((uint16)(a) & 0xff00) >> 8) | (((uint16)(a) & 0x00ff) << 8)); } -static inline uint32_t swapEndianLong(uint32_t a) { +static inline uint32 swapEndianLong(uint32 a) { return ((((uint32)(a) & 0xff000000) >> 24) | (((uint32)(a) & 0x00ff0000) >> 8) | (((uint32)(a) & 0x0000ff00) << 8) | @@ -80,11 +80,11 @@ static inline uint32_t swapEndianLong(uint32_t a) { #else // OC2E_BIG_ENDIAN -static inline uint16_t swapEndianShort(uint16_t a) { +static inline uint16 swapEndianShort(uint16 a) { return a; } -static inline uint32_t swapEndianLong(uint32_t a) { +static inline uint32 swapEndianLong(uint32 a) { return a; } -- 2.11.4.GIT