1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-07-22 17:18:39 +00:00

Apply some refactoring/cleanup to mainly util functions

This commit is contained in:
sfan5 2025-03-26 19:08:31 +01:00
parent 89e3bc8d56
commit e73eed247e
19 changed files with 190 additions and 160 deletions

View file

@ -48,8 +48,8 @@
// not represent the full range, but rather the largest safe range, of values on
// all supported architectures. Note: This definition makes assumptions on
// platform float-to-int conversion behavior.
#define F1000_MIN ((float)(s32)((float)(-0x7FFFFFFF - 1) / FIXEDPOINT_FACTOR))
#define F1000_MAX ((float)(s32)((float)(0x7FFFFFFF) / FIXEDPOINT_FACTOR))
static constexpr float F1000_MIN = (s32)((float)(S32_MIN) / FIXEDPOINT_FACTOR);
static constexpr float F1000_MAX = (s32)((float)(S32_MAX) / FIXEDPOINT_FACTOR);
#define STRING_MAX_LEN 0xFFFF
#define WIDE_STRING_MAX_LEN 0xFFFF
@ -159,7 +159,7 @@ inline void writeU64(u8 *data, u64 i)
inline u8 readU8(const u8 *data)
{
return ((u8)data[0] << 0);
return data[0];
}
inline s8 readS8(const u8 *data)