From 6fcac783b6e66d0390682c7dd18e4cf67b593b02 Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Thu, 13 Jan 2022 11:32:46 -0500 Subject: [PATCH] rename some uint types to u32/u64 --- src/util.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/util.h b/src/util.h index cab0916..82f9a1a 100644 --- a/src/util.h +++ b/src/util.h @@ -4,6 +4,8 @@ #include #include +#include +#include #include "types.h" @@ -14,7 +16,7 @@ // NOTE: FNV1a hashing algorithm http://www.isthe.com/chongo/tech/comp/fnv/ #define FNV1_64_INIT ((u64) 0xcbf29ce484222325ULL) #define FNV_64_PRIME ((u64) 0x100000001b3ULL) -u64 utilFNV64a_str(const char *str, u64 hval = FNV1_64_INIT); +u64 utilFNV64a_str(const char* str, u64 hval = FNV1_64_INIT); //----------------- // Memory allocation @@ -30,7 +32,7 @@ struct MemoryArena MemoryArena* arenaInit(size_t initial_size = DEFAULT_ARENA_SIZE); void arenaFree(MemoryArena*& arena); -uint arenaGetFreeSize(MemoryArena* arena); +u32 arenaGetFreeSize(MemoryArena* arena); #define ARENA_ALLOC(arena, type, count) \ (type*) arenaAllocateBlock(arena, sizeof(type) * count) @@ -54,8 +56,8 @@ void utilSafeFree(void* p); //----------------- // Hashing -uint64_t -utilFNV64a_str(const char* str, uint64_t hval) +u64 +utilFNV64a_str(const char* str, u64 hval) { unsigned char* s = (unsigned char *)str; // unsigned string @@ -76,7 +78,7 @@ utilFNV64a_str(const char* str, uint64_t hval) MemoryArena* arenaInit(size_t initial_size) { - uint sz = sizeof(MemoryArena); + u32 sz = sizeof(MemoryArena); MemoryArena* arena = (MemoryArena*) std::calloc(initial_size + sz, sizeof(u8)); arena->head = arena->next_free = (uint8_t*) arena + sz;