Fix some compiler warnings

This commit is contained in:
robojumper
2024-06-26 20:28:09 +02:00
parent 9d07cbc14e
commit 446df060f2
7 changed files with 71 additions and 38 deletions
+12 -12
View File
@@ -14,17 +14,17 @@ bool increment(u16 *t) {
int dTgTimer_c::create() {
switch (getSubtypeFromParams()) {
case 0:
mGetTargetTimeFunc = dTgTimer_c::getConstant0x50_Thunk;
break;
case 1:
mTargetTime = getTimerFromParams() * 0x1e;
mGetTargetTimeFunc = getStoredTargetTime;
break;
default:
mTargetTime = getTimerFromParams();
mGetTargetTimeFunc = getStoredTargetTime;
break;
case 0:
mGetTargetTimeFunc = &dTgTimer_c::getConstant0x50_Thunk;
break;
case 1:
mTargetTime = getTimerFromParams() * 0x1e;
mGetTargetTimeFunc = &dTgTimer_c::getStoredTargetTime;
break;
default:
mTargetTime = getTimerFromParams();
mGetTargetTimeFunc = &dTgTimer_c::getStoredTargetTime;
break;
}
resetTimer();
return 1;
@@ -68,7 +68,7 @@ u16 dTgTimer_c::getConstant0x50() {
return 0x50;
}
u16 dTgTimer_c::setTimer(u16 val) {
void dTgTimer_c::setTimer(u16 val) {
mTimer = val;
}
+7 -4
View File
@@ -127,8 +127,8 @@ void create(int priority, EGG::Heap *commandHeap, EGG::Heap *archiveHeap, EGG::H
}
/** 802eef30 */
static void *loadToMainRAM(int entryNum, char *dst, EGG::Heap *heap, EGG::DvdRipper::EAllocDirection allocDir, s32 offset,
u32 *outAmountRead, u32 *outFileSize, u32 decompressorType) {
static void *loadToMainRAM(int entryNum, char *dst, EGG::Heap *heap, EGG::DvdRipper::EAllocDirection allocDir,
s32 offset, u32 *outAmountRead, u32 *outFileSize, u32 decompressorType) {
void *result;
u32 amountRead = 0;
u32 fileSize = 0;
@@ -492,7 +492,9 @@ u32 mDvd_mountMemArchive_c::execute() {
mDataPtr = archive;
} else {
if (data != nullptr) {
delete data;
// TODO so far data seems to have been passed around as void *
// but this silences a compiler warning. Unsure about the actual type.
delete (char *)data;
}
mAmountRead = 0;
}
@@ -568,7 +570,8 @@ mDvd_toMainRam_arc_c *mDvd_toMainRam_arc_c::create(EGG::Archive *arc, const char
}
/** 802efe90 */
mDvd_toMainRam_arc_c *mDvd_toMainRam_arc_c::createOrFail(EGG::Archive *arc, const char *path, int mountDirection, EGG::Heap *heap) {
mDvd_toMainRam_arc_c *mDvd_toMainRam_arc_c::createOrFail(EGG::Archive *arc, const char *path, int mountDirection,
EGG::Heap *heap) {
mDvd_toMainRam_arc_c *cmd = mDvd_toMainRam_arc_c::create(arc, path, mountDirection, heap);
while (!cmd) {}
return cmd;
+2 -1
View File
@@ -591,13 +591,14 @@ void Material::SetColorElement(u32 colorType, s16 value) {
// 28:[TevKCol->r] 29:[TevKCol->g] 30:[TevKCol->b] 31:[TevKCol->a]
// clang-format off
switch (colorType) {
case 0: case 1: case 2: case 3:
case 0: case 1: case 2: case 3: {
if (mGXMemNum.matCol < 1 ) {
break;
}
ut::Color *matCols = GetMatColAry();
SetColorComponentValue(matCols, colorType , value);
break;
}
case 4: case 5: case 6: case 7: case 8: case 9:
case 10: case 11: case 12: case 13: case 14: case 15: {
u32 regIdx = (colorType - 4) / 4;
+4 -2
View File
@@ -94,18 +94,20 @@ FontInformation *ResFont::Rebuild(BinaryFileHeader *header) {
case MAGIC_TEXGLYPH:
ResolveOffset<u8>(reinterpret_cast<FontTextureGlyph *>(block + 1)->sheetImage, header);
break;
case MAGIC_CHARWIDTH:
case MAGIC_CHARWIDTH: {
FontWidth *width = reinterpret_cast<FontWidth *>(block + 1);
if (width->next != 0) {
ResolveOffset<FontWidth>(width->next, header);
}
break;
case MAGIC_CHARMAP:
}
case MAGIC_CHARMAP: {
FontCodeMap *map = reinterpret_cast<FontCodeMap *>(block + 1);
if (map->next != 0) {
ResolveOffset<FontCodeMap>(map->next, header);
}
break;
}
case MAGIC_GLGR:
break;
default: