Logo Search packages:      
Sourcecode: scummvm version File versions  Download package

endian.h File Reference


Detailed Description

Endian conversion and byteswap conversion functions or macros

SWAP_BYTES_??(a) - inverse byte order SWAP_CONSTANT_??(a) - inverse byte order, implemented as macro. Use with compiletime-constants only, the result will be a compiletime-constant aswell. Unlike most other functions these can be used for eg. switch-case labels

READ_UINT??(a) - read native value from pointer a READ_??_UINT??(a) - read LE/BE value from pointer a and convert it to native WRITE_??_UINT??(a, v) - write native value v to pointer a with LE/BE encoding TO_??_??(a) - convert native value v to LE/BE FROM_??_??(a) - convert LE/BE value v to native CONSTANT_??_??(a) - convert LE/BE value v to native, implemented as macro. Use with compiletime-constants only, the result will be a compiletime-constant aswell. Unlike most other functions these can be used for eg. switch-case labels

Definition in file endian.h.

#include "common/scummsys.h"

Go to the source code of this file.

Defines

#define MKID_BE(a)   ((uint32)(a))
#define SWAP_CONSTANT_16(a)
#define SWAP_CONSTANT_32(a)

Functions

uint32 READ_BE_UINT24 (const void *ptr)
uint32 READ_LE_UINT24 (const void *ptr)
FORCEINLINE uint16 READ_UINT16 (const void *ptr)
FORCEINLINE uint32 READ_UINT32 (const void *ptr)
uint16 SWAP_BYTES_16 (const uint16 a)
uint32 SWAP_BYTES_32 (uint32 a)
FORCEINLINE void WRITE_UINT16 (void *ptr, uint16 value)
FORCEINLINE void WRITE_UINT32 (void *ptr, uint32 value)


Generated by  Doxygen 1.6.0   Back to index