touch: add new commands

This commit is contained in:
nillerusr
2021-11-16 23:46:29 +03:00
parent f7cdca7ad2
commit d2f3cc44db
138 changed files with 46564 additions and 1231 deletions
+9 -7
View File
@@ -996,7 +996,7 @@ inline T QWordSwapC( T dw )
// The typically used methods.
//-------------------------------------
#if defined(__i386__) && !defined(VALVE_LITTLE_ENDIAN)
#if (defined(__i386__) || (defined(__arm__) && defined(ANDROID))) && !defined(VALVE_LITTLE_ENDIAN)
#define VALVE_LITTLE_ENDIAN 1
#endif
@@ -1055,19 +1055,21 @@ inline T QWordSwapC( T dw )
// @Note (toml 05-02-02): this technique expects the compiler to
// optimize the expression and eliminate the other path. On any new
// platform/compiler this should be tested.
inline short BigShort( short val ) { int test = 1; return ( *(char *)&test == 1 ) ? WordSwap( val ) : val; }
inline uint16 BigWord( uint16 val ) { int test = 1; return ( *(char *)&test == 1 ) ? WordSwap( val ) : val; }
inline long BigLong( long val ) { int test = 1; return ( *(char *)&test == 1 ) ? DWordSwap( val ) : val; }
#define BigShort( val ) BigWord( val )
inline uint32 BigDWord( uint32 val ) { int test = 1; return ( *(char *)&test == 1 ) ? DWordSwap( val ) : val; }
inline short LittleShort( short val ) { int test = 1; return ( *(char *)&test == 1 ) ? val : WordSwap( val ); }
#define BigLong( val ) BigDWord( val )
inline uint16 LittleWord( uint16 val ) { int test = 1; return ( *(char *)&test == 1 ) ? val : WordSwap( val ); }
inline long LittleLong( long val ) { int test = 1; return ( *(char *)&test == 1 ) ? val : DWordSwap( val ); }
#define LittleShort( val ) LittleWord( val )
inline uint32 LittleDWord( uint32 val ) { int test = 1; return ( *(char *)&test == 1 ) ? val : DWordSwap( val ); }
#define LittleLong( val ) LittleDWord( val )
inline uint64 LittleQWord( uint64 val ) { int test = 1; return ( *(char *)&test == 1 ) ? val : QWordSwap( val ); }
inline short SwapShort( short val ) { return WordSwap( val ); }
inline uint16 SwapWord( uint16 val ) { return WordSwap( val ); }
inline long SwapLong( long val ) { return DWordSwap( val ); }
#define SwapShort( val ) SwapWord( val )
inline uint32 SwapDWord( uint32 val ) { return DWordSwap( val ); }
#define SwapLong( val ) SwapDWord( val )
// Pass floats by pointer for swapping to avoid truncation in the fpu
inline void BigFloat( float *pOut, const float *pIn ) { int test = 1; ( *(char *)&test == 1 ) ? SafeSwapFloat( pOut, pIn ) : ( *pOut = *pIn ); }