1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-15 20:35:13 +00:00

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
This commit is contained in:
Roman971 2022-06-16 02:15:44 +02:00 committed by GitHub
parent 5299208291
commit 08c8126ba5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
46 changed files with 225 additions and 224 deletions

View file

@ -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) {