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

#define MKID_BE (  )     ((uint32)(a))

A wrapper macro used around four character constants, like 'DATA', to ensure portability. Typical usage: MKID_BE('DATA').

Why is this necessary? The C/C++ standard does not define the endianess to be used for character constants. Hence if one uses multi-byte character constants, a potential portability problem opens up.

Fortunately, a semi-standard has been established: On almost all systems and compilers, multi-byte character constants are encoded using the big endian convention (probably in analogy to the encoding of string constants). Still some systems differ. This is why we provide the MKID_BE macro. If you wrap your four character constants with it, the result will always be BE encoded, even on systems which differ from the default BE encoding.

For the latter systems we provide the INVERSE_MKID override.

Definition at line 163 of file endian.h.

Referenced by Graphics::SmackerDecoder::decodeNextFrame(), Graphics::DXADecoder::decodeNextFrame(), Scumm::ScummEngine::getObjectXYPos(), Graphics::PaletteLUT::load(), Graphics::SmackerDecoder::loadFile(), Graphics::DXADecoder::loadFile(), Scumm::ScummEngine::resetRoomSubBlocks(), Graphics::PaletteLUT::save(), and Scumm::ScummEngine::setupRoomSubBlocks().

Generated by  Doxygen 1.6.0   Back to index