summaryrefslogtreecommitdiff
path: root/src/code/TwoHeadArena.c
diff options
context:
space:
mode:
authorRoman971 <32455037+Roman971@users.noreply.github.com>2022-06-16 02:15:44 +0200
committerGitHub <noreply@github.com>2022-06-15 20:15:44 -0400
commit08c8126ba55c11b8774721dedec3a5d8993503cd (patch)
treeb19dace8340a2eba1c61f07209462e57565b8fe3 /src/code/TwoHeadArena.c
parent5299208291dc3032954b8b2242be2be9c7b6c7c0 (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.c10
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) {