Fixing issues, enabled warnings and fixing on linux

This commit is contained in:
Krzosa Karol
2026-01-31 22:53:18 +01:00
parent 52390a7aa8
commit bbf97eba2f
32 changed files with 117 additions and 99 deletions

View File

@@ -117,8 +117,9 @@ EM_JS(void, JS_Breakpoint, (), {
#define MiB(x) (KiB(x) * 1024ull)
#define GiB(x) (MiB(x) * 1024ull)
#define TiB(x) (GiB(x) * 1024ull)
#define Lengthof(x) ((int64_t)((sizeof(x) / sizeof((x)[0]))))
#define SLICE_LAST INT64_MAX
#define Lengthof(x) ((int64_t)((sizeof(x) / sizeof((x)[0]))))
#define Unused(x) (void)(x)
using U8 = uint8_t;
using U16 = uint16_t;
@@ -132,6 +133,8 @@ using Int = S64;
using UInt = U64;
using Float = double;
#define IntMax INT64_MAX
template <class T>
T Min(T a, T b) {
if (a > b) return b;
@@ -247,3 +250,14 @@ inline uint64_t GetRandomU64(RandomSeed *state) {
#define STRINGIFY(x) STRINGIFY_(x)
#define CONCAT_(a, b) a ## b
#define CONCAT(a, b) CONCAT_(a, b)
Int SizeToInt(size_t size) {
Assert(size <= (size_t)IntMax);
return (Int)size;
}
Int Strlen(const char *string) {
size_t size = strlen(string);
Int result = SizeToInt(size);
return result;
}