vegastrike  0.5.1.r1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Byte Swapping Functions

Functions

posh_u16_t POSH_SwapU16 (posh_u16_t u)
 
posh_s16_t POSH_SwapS16 (posh_s16_t u)
 
posh_u32_t POSH_SwapU32 (posh_u32_t u)
 
posh_s32_t POSH_SwapS32 (posh_s32_t u)
 

Detailed Description

These functions perform byte swapping of 16 and 32-bit values. The 64-bit versions of these functions are documented under SixtyFourBit

Function Documentation

posh_s16_t POSH_SwapS16 ( posh_s16_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 217 of file posh.cpp.

posh_s32_t POSH_SwapS32 ( posh_s32_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 249 of file posh.cpp.

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 198 of file posh.cpp.

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 228 of file posh.cpp.