summaryrefslogtreecommitdiff
path: root/src/utils/include/engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/include/engine')
-rw-r--r--src/utils/include/engine/utils/hashmap.h6
-rw-r--r--src/utils/include/engine/utils/stack.h4
2 files changed, 5 insertions, 5 deletions
diff --git a/src/utils/include/engine/utils/hashmap.h b/src/utils/include/engine/utils/hashmap.h
index d8fdbf2..0113ce5 100644
--- a/src/utils/include/engine/utils/hashmap.h
+++ b/src/utils/include/engine/utils/hashmap.h
@@ -11,7 +11,7 @@ extern "C" {
#include <engine/core/memory.h>
#include <engine/utils/list.h>
-i32 lolhash(const usize s, i32 v);
+usize lolhash(const usize s, usize v);
/* Define a linked list before using this */
/* Example: DEFINE_LLIST(i32) */
@@ -23,7 +23,7 @@ i32 lolhash(const usize s, i32 v);
} hashmap_##type; \
\
type* hashmap_##type##_lookup(hashmap_##type* hmap, const type* val) { \
- const i32 idx = lolhash(64, type_to_int(val)); \
+ const usize idx = lolhash(64, type_to_int(val)); \
List_##type* head = &hmap->elems[idx]; \
while (head != NULL) { \
if (!cmp(&(head->value), val)) return &(head->value); \
@@ -34,7 +34,7 @@ i32 lolhash(const usize s, i32 v);
\
void hashmap_##type##_insert(memory* m, hashmap_##type* hmap, \
const type* val) { \
- const i32 idx = lolhash(64, type_to_int(val)); \
+ const usize idx = lolhash(64, type_to_int(val)); \
List_##type* head = &(hmap->elems[idx]); \
\
/* This is highly dependant on whether the memory is zero-initialized */ \
diff --git a/src/utils/include/engine/utils/stack.h b/src/utils/include/engine/utils/stack.h
index b8e1807..b4caf5f 100644
--- a/src/utils/include/engine/utils/stack.h
+++ b/src/utils/include/engine/utils/stack.h
@@ -8,7 +8,7 @@ extern "C" {
#include <engine/core/types.h>
typedef struct {
- isize head; /* current number of elements */
+ usize head; /* current number of elements */
const usize elem_size; /* size in bytes of each element */
usize size; /* current memory size used by the stack */
const usize chunk_size; /* size of which the stack increases when running out
@@ -24,7 +24,7 @@ void stack_free(Stack* s);
void* stack_pop(Stack* s);
void stack_push(Stack* s, void* elem);
void* stack_peek(Stack* s);
-isize stack_size(const Stack* s);
+usize stack_size(const Stack* s);
void stack_swap(Stack* s, Stack* t);
#ifdef __cplusplus