diff options
author | bonmas14 <bonmas14@gmail.com> | 2025-08-07 03:04:55 +0300 |
---|---|---|
committer | bonmas14 <bonmas14@gmail.com> | 2025-08-07 03:04:55 +0300 |
commit | 262ddbd72b42dd0673b61cfeeda86c36a4cd98cc (patch) | |
tree | b4e4b8537d6d7475f8d996ea2452e6dc501c318b | |
parent | b16ca14911ad5df44ae499eed2d90c3ca2da4eb0 (diff) | |
download | ungrateful-262ddbd72b42dd0673b61cfeeda86c36a4cd98cc.tar.gz ungrateful-262ddbd72b42dd0673b61cfeeda86c36a4cd98cc.zip |
Shadowing of global is warning on msvc. i guess it is not a big thing to
rename it.
-rw-r--r-- | src/un_memory.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/un_memory.c b/src/un_memory.c index 84f5f14..b092196 100644 --- a/src/un_memory.c +++ b/src/un_memory.c @@ -103,25 +103,25 @@ Allocator un_allocator_get_standard(void) { static struct { u64 index; u8 data[UN_TEMP_SIZE]; -} temp; +} _temp; static void temp_reset(void) { - temp.index = 0; + _temp.index = 0; } static void *temp_alloc(u64 size) { - if ((temp.index + size) > UN_TEMP_SIZE) { + if ((_temp.index + size) > UN_TEMP_SIZE) { // @todo: Decice what is the best behaviour for wrapping assert(false); temp_reset(); } - if ((temp.index + size) > UN_TEMP_SIZE) { + if ((_temp.index + size) > UN_TEMP_SIZE) { return NULL; } - void *ptr = (u8*)temp.data + temp.index; - temp.index += size; + void *ptr = (u8*)_temp.data + _temp.index; + _temp.index += size; un_memory_set(ptr, 0x00, size); return ptr; |