diff options
| author | Roman971 <32455037+Roman971@users.noreply.github.com> | 2022-06-16 02:15:44 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-06-15 20:15:44 -0400 |
| commit | 08c8126ba55c11b8774721dedec3a5d8993503cd (patch) | |
| tree | b19dace8340a2eba1c61f07209462e57565b8fe3 /src/code/TwoHeadArena.c | |
| parent | 5299208291dc3032954b8b2242be2be9c7b6c7c0 (diff) | |
Enable int-conversion warnings and fix all current instances (#1280)
* Enable int-conversion warnings for gcc/clang
* Fix all current int-conversion warnings
* Run format.sh
* Apply review suggestions
Diffstat (limited to 'src/code/TwoHeadArena.c')
| -rw-r--r-- | src/code/TwoHeadArena.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/code/TwoHeadArena.c b/src/code/TwoHeadArena.c index fc347c494..334060460 100644 --- a/src/code/TwoHeadArena.c +++ b/src/code/TwoHeadArena.c @@ -79,7 +79,7 @@ void* THA_GetTail(TwoHeadArena* tha) { void* THA_AllocStart(TwoHeadArena* tha, u32 size) { void* start = tha->head; - tha->head = (u32)tha->head + size; + tha->head = (void*)((u32)tha->head + size); return start; } @@ -100,19 +100,19 @@ void* THA_AllocEnd(TwoHeadArena* tha, u32 size) { mask = (size >= 0x10) ? ~0xF : 0; } - tha->tail = (((u32)tha->tail & mask) - size) & mask; + tha->tail = (void*)((((u32)tha->tail & mask) - size) & mask); return tha->tail; } void* THA_AllocEndAlign16(TwoHeadArena* tha, u32 size) { u32 mask = ~0xF; - tha->tail = (((u32)tha->tail & mask) - size) & (u64)mask; + tha->tail = (void*)((((u32)tha->tail & mask) - size) & (u32)(u64)mask); return tha->tail; } void* THA_AllocEndAlign(TwoHeadArena* tha, u32 size, u32 mask) { - tha->tail = (((u32)tha->tail & mask) - size) & mask; + tha->tail = (void*)((((u32)tha->tail & mask) - size) & mask); return tha->tail; } @@ -126,7 +126,7 @@ u32 THA_IsCrash(TwoHeadArena* tha) { void THA_Init(TwoHeadArena* tha) { tha->head = tha->bufp; - tha->tail = (u32)tha->bufp + tha->size; + tha->tail = (void*)((u32)tha->bufp + tha->size); } void THA_Ct(TwoHeadArena* tha, void* ptr, u32 size) { |
