Vegastrike 0.5.1 rc1
1.0
Original sources for Vegastrike Evolved
|
Functions | |
posh_u32_t | POSH_LittleFloatBits (float f) |
posh_u32_t | POSH_BigFloatBits (float f) |
void | POSH_DoubleBits (double d, posh_byte_t dst[8]) |
double | POSH_DoubleFromBits (const posh_byte_t src[8]) |
float | POSH_FloatFromLittleBits (posh_u32_t bits) |
float | POSH_FloatFromBigBits (posh_u32_t bits) |
float * | POSH_WriteFloatToLittle (void *dst, float f) |
float * | POSH_WriteFloatToBig (void *dst, float f) |
float | POSH_ReadFloatFromLittle (const void *src) |
float | POSH_ReadFloatFromBig (const void *src) |
double * | POSH_WriteDoubleToLittle (void *dst, double d) |
double * | POSH_WriteDoubleToBig (void *dst, double d) |
double | POSH_ReadDoubleFromLittle (const void *src) |
double | POSH_ReadDoubleFromBig (const void *src) |
Unavailable if @ref POSH_NO_FLOAT "POSH_NO_FLOAT" is defined. By default floating point support is enabled, but if you find that this causes problems or is inconvenient and you're not using the support, you can define <code><b>POSH_NO_FLOAT</code></b> to disable POSH's use of any floating point types or operations. Here are some code examples:
* * //read a little-endian float from disk * float LoadFloat( FILE *fp ) * { * float f; * posh_u32_t u32; * * fread( &u32, sizeof( u32 ), 1, fp ); * * f = POSH_FloatFromLittleBits( u32 ); * * return f; * } * * //write a little-endian float to disk * void WriteFloat( FILE *fp, float f ) * { * posh_u32_t u32; * * u32 = POSH_LittleFloatBits( f ); * * fwrite( &u32, sizeof( u32 ), 1, fp ); * } * *
posh_u32_t POSH_BigFloatBits | ( | float | f) |
Extracts raw big-endian bits from a 32-bit floating point value
f[in] | floating point value |
Definition at line 671 of file posh.cpp.
References POSH_SwapU32().
Referenced by NetBuffer::addFloat(), and s_testFloatingPoint().
void POSH_DoubleBits | ( | double | d, |
posh_byte_t | dst[8] | ||
) |
Extracts raw, little-endian bit representation from a 64-bit double.
d[in] | 64-bit double precision value |
dst[out] | 8-byte storage buffer |
Definition at line 698 of file posh.cpp.
Referenced by NetBuffer::addDouble(), and s_testFloatingPoint().
double POSH_DoubleFromBits | ( | const posh_byte_t | src[8]) |
Creates a double-precision, 64-bit floating point value from a set if raw, little-endian bits
src[in] | little-endian byte representation of 64-bit double precision floating point value |
Definition at line 742 of file posh.cpp.
Referenced by NetBuffer::getDouble(), and s_testFloatingPoint().
float POSH_FloatFromBigBits | ( | posh_u32_t | bits) |
Creates a floating point number from big-endian bits
bits[in] | raw floating point bits in big-endian form |
Definition at line 809 of file posh.cpp.
References bits, and POSH_SwapU32().
Referenced by NetBuffer::getFloat(), and s_testFloatingPoint().
float POSH_FloatFromLittleBits | ( | posh_u32_t | bits) |
Creates a floating point number from little endian bits
bits[in] | raw floating point bits in little-endian form |
Definition at line 783 of file posh.cpp.
References bits, and POSH_SwapU32().
Referenced by s_testFloatingPoint().
posh_u32_t POSH_LittleFloatBits | ( | float | f) |
Extracts raw little-endian bits from a 32-bit floating point value
f[in] | floating point value |
Definition at line 645 of file posh.cpp.
References POSH_SwapU32().
Referenced by s_testFloatingPoint().
double POSH_ReadDoubleFromBig | ( | const void * | src) |
double POSH_ReadDoubleFromLittle | ( | const void * | src) |
float POSH_ReadFloatFromBig | ( | const void * | src) |
float POSH_ReadFloatFromLittle | ( | const void * | src) |
double* POSH_WriteDoubleToBig | ( | void * | dst, |
double | d | ||
) |
double* POSH_WriteDoubleToLittle | ( | void * | dst, |
double | d | ||
) |