Main Page | Modules | File List | Globals | Related Pages

Byte Swapping Functions


Detailed Description

These functions perform byte swapping of 16 and 32-bit values.

The 64-bit versions of these functions are documented under 64-bit Support


Functions

posh_u16_t POSH_SwapU16 (posh_u16_t v)
 Byte swaps a 16-bit unsigned value.

posh_i16_t POSH_SwapI16 (posh_i16_t v)
 Byte swaps a 16-bit signed value.

posh_u32_t POSH_SwapU32 (posh_u32_t v)
 Byte swaps a 32-bit unsigned value.

posh_i32_t POSH_SwapI32 (posh_i32_t v)
 Byte swaps a 32-bit signed value.


Function Documentation

posh_i16_t POSH_SwapI16 posh_i16_t  v  ) 
 

Byte swaps a 16-bit signed value.

Parameters:
v [in] signed 16-bit input value to swap
Returns:
a byte swapped version of v
Remarks:
This just calls back to the unsigned version, since byte swapping is independent of sign. However, we still provide this function to avoid signed/unsigned mismatch compiler warnings.

Definition at line 310 of file posh.c.

References posh_i16_t, and POSH_SwapU16().

posh_i32_t POSH_SwapI32 posh_i32_t  v  ) 
 

Byte swaps a 32-bit signed value.

Parameters:
v [in] signed 32-bit input value to swap
Returns:
a byte swapped version of v
Remarks:
This just calls back to the unsigned version, since byte swapping is independent of sign. However, we still provide this function to avoid signed/unsigned mismatch compiler warnings.

Definition at line 346 of file posh.c.

References posh_i32_t, POSH_SwapU32(), and posh_u32_t.

posh_u16_t POSH_SwapU16 posh_u16_t  v  ) 
 

Byte swaps a 16-bit unsigned value.

Parameters:
v [in] unsigned 16-bit input value to swap
Returns:
a byte swapped version of v

Definition at line 289 of file posh.c.

References posh_u16_t.

Referenced by POSH_SwapI16().

posh_u32_t POSH_SwapU32 posh_u32_t  v  ) 
 

Byte swaps a 32-bit unsigned value.

Parameters:
v [in] unsigned 32-bit input value to swap
Returns:
a byte swapped version of v

Definition at line 323 of file posh.c.

References posh_u32_t.

Referenced by POSH_FloatFromBigBits(), POSH_FloatFromLittleBits(), and POSH_SwapI32().


Generated on Tue Jan 31 18:27:36 2006 for POSH by doxygen 1.3.7