diff --git a/src/m_swap.h b/src/m_swap.h index 1ab82d3b1..a68a0837b 100644 --- a/src/m_swap.h +++ b/src/m_swap.h @@ -91,6 +91,16 @@ inline unsigned short LittleShort (unsigned short x) return (unsigned short)((x>>8) | (x<<8)); } +inline short LittleShort (int x) +{ + return LittleShort((short)x); +} + +inline unsigned short LittleShort (unsigned int x) +{ + return LittleShort((unsigned short)x); +} + // Swapping 32bit. inline unsigned int LittleLong (unsigned int x) { @@ -110,6 +120,16 @@ inline int LittleLong (int x) | (((unsigned int)x)<<24)); } +inline unsigned int LittleLong(unsigned long x) +{ + return LittleLong((unsigned int)x); +} + +inline int LittleLong(long x) +{ + return LittleLong((int)x); +} + #define BigShort(x) (x) #define BigLong(x) (x)