MI_SwapEndian*

C Specification

#include <nitro/mi.h>

#define MI_SwapEndian16(val) (u16)((((val) & 0xFF00UL) >> 8UL) | (((val) & 0x00FFUL) << 8UL))
#define MI_SwapEndian32(val) (u32)((((val) & 0xFF000000UL) >> 24UL) | (((val) & 0x00FF0000UL) >> 8UL) | (((val) & 0x0000FF00UL) << 8UL) | (((val) & 0x000000FFUL) << 24UL))

Arguments

val Represents the value whose endian is to be converted.
Note: Because this is a macro, evaluation is performed several times.

Return Values

Returns a value converted to the specified endian (u16 or u32)

Description

Converts the endian of the specified 16-bit value. If little endian is detected before conversion, big endian results after conversion.
Note: Because this is a macro, arguments are evaluated several times.

See Also

MI_Load* MI_Store* MI_HTo* MI_*ToH*

Revision History

04/05/2006 Initial version.

CONFIDENTIAL