diff options
| author | Derek Hensley <hensley.derek58@gmail.com> | 2023-11-15 22:01:42 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-11-16 16:01:42 +1100 |
| commit | 5acaec4486a6ba9c6a308c3987f664d1bbe6ab6b (patch) | |
| tree | 1bd1f4ee664b19afffa85021f5d996285b6db613 /src/code/z_malloc.c | |
| parent | d9585d7444cdd3a3fe0c49807163ce8132c11956 (diff) | |
Fix ultratypes types (#1454)
* Fix ultratypes types
* Add back size_t and NULL
* Callocs
* Callocs pt 2
* bool
* STDC version checks
Diffstat (limited to 'src/code/z_malloc.c')
| -rw-r--r-- | src/code/z_malloc.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/code/z_malloc.c b/src/code/z_malloc.c index ac56231cf..c23da3927 100644 --- a/src/code/z_malloc.c +++ b/src/code/z_malloc.c @@ -24,16 +24,16 @@ void ZeldaArena_Free(void* ptr) { __osFree(&sZeldaArena, ptr); } -void* ZeldaArena_Calloc(u32 num, size_t size) { - void* ret; - u32 n = num * size; +void* ZeldaArena_Calloc(size_t num, size_t size) { + void* ptr; + size_t totalSize = num * size; - ret = __osMalloc(&sZeldaArena, n); - if (ret != NULL) { - bzero(ret, n); + ptr = __osMalloc(&sZeldaArena, totalSize); + if (ptr != NULL) { + bzero(ptr, totalSize); } - return ret; + return ptr; } void ZeldaArena_GetSizes(size_t* outMaxFree, size_t* outFree, size_t* outAlloc) { |
