2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CBASICS
|
|
|
|
#define _CBASICS
|
2022-04-10 00:17:06 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
|
|
|
namespace CBasics {
|
2022-10-02 07:43:00 +00:00
|
|
|
void Init();
|
2022-04-10 00:17:06 +00:00
|
|
|
char* Stringize(const char* fmt, ...);
|
2022-10-18 02:05:27 +00:00
|
|
|
inline uint SwapBytes(uint x) {
|
|
|
|
#if 0
|
|
|
|
x = ((x << 24) | ((x << 8) & 0x00FF0000) | ((x >> 8) & 0x0000FF00) | (x >> 24));
|
|
|
|
#endif
|
|
|
|
return x;
|
|
|
|
}
|
|
|
|
inline float SwapBytes(float x) {
|
|
|
|
union {
|
|
|
|
float f;
|
|
|
|
uint u;
|
|
|
|
};
|
|
|
|
f = x;
|
|
|
|
#if 0
|
|
|
|
u = SwapBytes(u);
|
|
|
|
#endif
|
|
|
|
return f;
|
|
|
|
}
|
2022-10-09 05:13:17 +00:00
|
|
|
}; // namespace CBasics
|
2022-04-10 00:17:06 +00:00
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CBASICS
|