From 6d2d24676839e972e783fa71e843361cd6f06c20 Mon Sep 17 00:00:00 2001 From: jules Date: Wed, 26 Sep 2007 08:23:09 +0000 Subject: [PATCH] --- src/juce_core/basics/juce_DataConversions.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/juce_core/basics/juce_DataConversions.h b/src/juce_core/basics/juce_DataConversions.h index 47ebfee777..0ceb1c2587 100644 --- a/src/juce_core/basics/juce_DataConversions.h +++ b/src/juce_core/basics/juce_DataConversions.h @@ -86,20 +86,23 @@ inline uint64 swapByteOrder (const uint64 value) throw() inline uint16 swapIfBigEndian (const uint16 v) throw() { return v; } /** Swaps the byte order of a 32-bit int if the CPU is big-endian */ inline uint32 swapIfBigEndian (const uint32 v) throw() { return v; } + /** Swaps the byte order of a 64-bit int if the CPU is big-endian */ + inline uint64 swapIfBigEndian (const uint64 v) throw() { return v; } + /** Swaps the byte order of a 16-bit int if the CPU is little-endian */ inline uint16 swapIfLittleEndian (const uint16 v) throw() { return swapByteOrder (v); } /** Swaps the byte order of a 32-bit int if the CPU is little-endian */ inline uint32 swapIfLittleEndian (const uint32 v) throw() { return swapByteOrder (v); } + /** Swaps the byte order of a 64-bit int if the CPU is little-endian */ + inline uint64 swapIfLittleEndian (const uint64 v) throw() { return swapByteOrder (v); } /** Turns 4 bytes into a little-endian integer. */ inline uint32 littleEndianInt (const char* const bytes) throw() { return *(uint32*) bytes; } - /** Turns 2 bytes into a little-endian integer. */ inline uint16 littleEndianShort (const char* const bytes) throw() { return *(uint16*) bytes; } /** Turns 4 bytes into a big-endian integer. */ inline uint32 bigEndianInt (const char* const bytes) throw() { return swapByteOrder (*(uint32*) bytes); } - /** Turns 2 bytes into a big-endian integer. */ inline uint16 bigEndianShort (const char* const bytes) throw() { return swapByteOrder (*(uint16*) bytes); } @@ -108,20 +111,23 @@ inline uint64 swapByteOrder (const uint64 value) throw() inline uint16 swapIfBigEndian (const uint16 v) throw() { return swapByteOrder (v); } /** Swaps the byte order of a 32-bit int if the CPU is big-endian */ inline uint32 swapIfBigEndian (const uint32 v) throw() { return swapByteOrder (v); } + /** Swaps the byte order of a 64-bit int if the CPU is big-endian */ + inline uint64 swapIfBigEndian (const uint64 v) throw() { return swapByteOrder (v); } + /** Swaps the byte order of a 16-bit int if the CPU is little-endian */ inline uint16 swapIfLittleEndian (const uint16 v) throw() { return v; } /** Swaps the byte order of a 32-bit int if the CPU is little-endian */ inline uint32 swapIfLittleEndian (const uint32 v) throw() { return v; } + /** Swaps the byte order of a 64-bit int if the CPU is little-endian */ + inline uint64 swapIfLittleEndian (const uint64 v) throw() { return v; } /** Turns 4 bytes into a little-endian integer. */ inline uint32 littleEndianInt (const char* const bytes) throw() { return swapByteOrder (*(uint32*) bytes); } - /** Turns 2 bytes into a little-endian integer. */ inline uint16 littleEndianShort (const char* const bytes) throw() { return swapByteOrder (*(uint16*) bytes); } /** Turns 4 bytes into a big-endian integer. */ inline uint32 bigEndianInt (const char* const bytes) throw() { return *(uint32*) bytes; } - /** Turns 2 bytes into a big-endian integer. */ inline uint16 bigEndianShort (const char* const bytes) throw() { return *(uint16*) bytes; } #endif