Fix all warnings raised by IDO (#152)

* Fix all warnings raised by IDO, ignore trailing commas

* Set -woff=624,...; keep const in printf functions

* Remove redefined macros in irqmgr.c

* Remove DECR macro & reformat

* Address PR comments from AngheloAlf
This commit is contained in:
Zach Banks
2021-05-18 22:28:04 -04:00
committed by GitHub
parent 7f14659919
commit dea3c8fd79
40 changed files with 130 additions and 130 deletions
+1 -1
View File
@@ -63,7 +63,7 @@ ASFLAGS := -march=vr4300 -32
MIPS_VERSION := -mips2
# we support Microsoft extensions such as anonymous structs, which the compiler does support but warns for their usage. Surpress the warnings with -woff.
CFLAGS += -G 0 -non_shared -Xfullwarn -Xcpluscomm -Iinclude -I./ -Isrc -Wab,-r4300_mul -woff 649,838,712
CFLAGS += -G 0 -non_shared -Xfullwarn -Xcpluscomm -Iinclude -I./ -Isrc -Wab,-r4300_mul -woff 624,649,838,712
#### Files ####
+5 -5
View File
@@ -11,7 +11,7 @@ double sqrt(double d);
#pragma intrinsic(sqrt)
void bootproc(void);
void Idle_ClearMemory(const void* begin, const void* end);
void Idle_ClearMemory(void* begin, void* end);
void Idle_InitFramebuffer(u32* ptr, u32 numBytes, u32 value);
void Idle_InitScreen(void);
void Idle_InitMemory(void);
@@ -110,7 +110,7 @@ void FaultDrawer_SetCharPad(s8 padW, s8 padH);
void FaultDrawer_SetCursor(s32 x, s32 y);
void FaultDrawer_FillScreen(void);
FaultDrawer* FaultDrawer_FormatStringFunc(FaultDrawer* arg, const char* str, s32 count);
void FaultDrawer_VPrintf(char* str, char* args);
void FaultDrawer_VPrintf(const char* str, char* args);
void FaultDrawer_Printf(const char* fmt, ...);
void FaultDrawer_DrawText(s32 x, s32 y, const char* fmt, ...);
void FaultDrawer_SetDrawerFB(void* fb, u16 w, u16 h);
@@ -369,7 +369,7 @@ s32 osContStartQuery(OSMesgQueue* mq);
void osContGetQuery(OSContStatus* data);
void guLookAtHiliteF(float mf[4][4], LookAt* l, Hilite* h, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp, f32 xl1, f32 yl1, f32 zl1, f32 xl2, f32 yl2, f32 zl2, s32 twidth, s32 theight);
void guLookAtHilite(Mtx* m, LookAt* l, Hilite* h, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f32 xUp, f32 yUp, f32 zUp, f32 xl1, f32 yl1, f32 zl1, f32 xl2, f32 yl2, f32 zl2, s32 twidth, s32 theight);
s32 _Printf(printf_func pfn, void* arg, char* fmt, va_list ap);
s32 _Printf(printf_func pfn, void* arg, const char* fmt, va_list ap);
void _Putfld(_Pft* px, va_list* pap, u8 code, u8* ac);
// void func_8008ED30(void);
void osUnmapTLBAll(void);
@@ -972,13 +972,13 @@ void func_800C3C00(CollisionContext* bgCtxt, u32 param_2);
void func_800C3C14(CollisionContext* bgCtxt, u32 param_2);
CollisionHeader* BgCheck_GetActorMeshHeader(CollisionContext* bgCtxt, s32 index);
// void func_800C3C94(void);
f32 func_800C3D50(s32 arg0, CollisionContext* bgCtxt, s32 arg2, CollisionPoly* arg3, s32* arg4, Vec3f* pos, Actor* actor, s32 arg7, f32 arg8, s32 arg9);
f32 func_800C3D50(s32 arg0, CollisionContext* bgCtxt, s32 arg2, CollisionPoly** arg3, s32* arg4, Vec3f* pos, Actor* actor, s32 arg7, f32 arg8, s32 arg9);
// void func_800C3F40(void);
// void func_800C3FA0(void);
// void func_800C4000(void);
// void func_800C4058(void);
// void func_800C40B4(void);
f32 func_800C411C(CollisionContext* bgCtxt, CollisionPoly* arg1, s32* arg2, Actor* actor, Vec3f* pos);
f32 func_800C411C(CollisionContext* bgCtxt, CollisionPoly** arg1, s32* arg2, Actor* actor, Vec3f* pos);
// void func_800C4188(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_800C41E4(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
// void func_800C4240(UNK_TYPE1 param_1, UNK_TYPE1 param_2, UNK_TYPE1 param_3, UNK_TYPE1 param_4, UNK_TYPE4 param_5, UNK_TYPE4 param_6);
+1 -1
View File
@@ -34,7 +34,7 @@ typedef struct {
Vec3f pos;
} ScaleRotPos;
typedef struct {
typedef struct CollisionPoly {
/* 0x00 */ u16 type;
union {
u16 vtxData[3];
+1
View File
@@ -9,6 +9,7 @@
struct GraphicsContext;
struct GlobalContext;
struct EffectSs;
typedef void(*eff_destroy_func)(void* params);
+7 -7
View File
@@ -21,23 +21,23 @@ typedef struct {
/* 0x3 */ u8 color[3];
} LightDirectional; // size = 0x6
typedef union {
typedef union LightParams {
LightPoint point;
LightDirectional dir;
} LightParams; // size = 0xC
typedef struct {
typedef struct LightInfo {
/* 0x0 */ u8 type;
/* 0x2 */ LightParams params;
} LightInfo; // size = 0xE
typedef struct {
typedef struct Lights {
/* 0x00 */ u8 enablePosLights;
/* 0x01 */ u8 numLights;
/* 0x08 */ Lightsn l;
} Lights; // size = 0x80
typedef struct {
typedef struct LightInfoPositional {
/* 0x0 */ u8 type;
/* 0x2 */ LightPoint params;
} LightInfoPositional; // size = 0xE
@@ -51,13 +51,13 @@ typedef struct LightNode {
// TODO move LightsBuffer to .c file once .bss has been split
#define LIGHTS_BUFFER_SIZE 32
typedef struct {
typedef struct LightsBuffer {
/* 0x000 */ s32 numOccupied;
/* 0x004 */ s32 searchIndex;
/* 0x008 */ LightNode lights[LIGHTS_BUFFER_SIZE];
} LightsBuffer; // size = 0x188
typedef struct {
typedef struct LightContext {
/* 0x0 */ LightNode* listHead;
/* 0x4 */ Color_RGB8 ambient;
/* 0x7 */ u8 unk7;
@@ -67,7 +67,7 @@ typedef struct {
/* 0xC */ s16 unkC;
} LightContext; // size = 0x10
typedef enum {
typedef enum LightType {
/* 0x00 */ LIGHT_POINT_NOGLOW,
/* 0x01 */ LIGHT_DIRECTIONAL,
/* 0x02 */ LIGHT_POINT_GLOW
+1 -1
View File
@@ -8,7 +8,7 @@ u32 gViConfigFeatures = 0x42;
f32 gViConfigXScale = 1.0f;
f32 gViConfigYScale = 1.0f;
void Idle_ClearMemory(const void* begin, const void* end) {
void Idle_ClearMemory(void* begin, void* end) {
if (begin < end) {
bzero(begin, (s32)(int)end - (int)begin);
}
-5
View File
@@ -1,11 +1,6 @@
#include <ultra64.h>
#include <global.h>
// TODO move out
#define OS_CLOCK_RATE 62500000LL
#define OS_CPU_COUNTER (OS_CLOCK_RATE * 3 / 4)
#define OS_USEC_TO_CYCLES(n) (((u64)(n) * (OS_CPU_COUNTER / 15625LL)) / (1000000LL / 15625LL))
vs32 gIrqMgrResetStatus = 0;
volatile OSTime sIrqMgrResetTime = 0;
volatile OSTime sIrqMgrRetraceTime = 0;
+1 -1
View File
@@ -883,7 +883,7 @@ void Fault_HangupFaultClient(const char* arg0, char* arg1) {
void Fault_AddHungupAndCrashImpl(const char* arg0, char* arg1) {
FaultClient client;
char padd[4];
Fault_AddClient(&client, (fault_client_func)Fault_HangupFaultClient, arg0, arg1);
Fault_AddClient(&client, (fault_client_func)Fault_HangupFaultClient, (void*)arg0, arg1);
*(u32*)0x11111111 = 0; // trigger an exception
}
+1 -1
View File
@@ -140,7 +140,7 @@ void FaultDrawer_FillScreen() {
#pragma GLOBAL_ASM("./asm/non_matchings/boot/fault_drawer/FaultDrawer_FormatStringFunc.asm")
void FaultDrawer_VPrintf(char* str, char* args) { // va_list
void FaultDrawer_VPrintf(const char* str, char* args) { // va_list
_Printf((printf_func)FaultDrawer_FormatStringFunc, sFaultDrawContext, str, args);
}
+4 -8
View File
@@ -1,10 +1,6 @@
#include <ultra64.h>
#include <global.h>
// From OOT
#define ABS(x) ((x) < 0 ? -(x) : (x))
#define DECR(x) ((x) == 0 ? 0 : ((x) -= 1))
void Actor_PrintLists(ActorContext* actorCtx) {
ActorListEntry* actorList = &actorCtx->actorList[0];
Actor* actor;
@@ -526,7 +522,7 @@ s32 Actor_IsActorFacedByActor(Actor* actor, Actor* other, s16 tolerance) {
angle = Actor_YawBetweenActors(actor, other) + 0x8000;
dist = angle - other->shape.rot.y;
if (ABS(dist) < tolerance) {
if (ABS_ALT(dist) < tolerance) {
return 1;
}
return 0;
@@ -536,7 +532,7 @@ s32 Actor_IsActorFacingLink(Actor* actor, s16 angle) {
s16 dist;
dist = actor->yawTowardsPlayer - actor->shape.rot.y;
if (ABS(dist) < angle) {
if (ABS_ALT(dist) < angle) {
return 1;
}
return 0;
@@ -546,7 +542,7 @@ s32 Actor_IsActorFacingActor(Actor* actor, Actor* other, s16 tolerance) {
s16 dist;
dist = Actor_YawBetweenActors(actor, other) - actor->shape.rot.y;
if (ABS(dist) < tolerance) {
if (ABS_ALT(dist) < tolerance) {
return 1;
}
return 0;
@@ -559,7 +555,7 @@ s32 Actor_IsActorFacingActorAndWithinRange(Actor* actor, Actor* other, f32 range
if (Actor_DistanceBetweenActors(actor, other) < range) {
dist = Actor_YawBetweenActors(actor, other) - actor->shape.rot.y;
if (ABS(dist) < tolerance) {
if (ABS_ALT(dist) < tolerance) {
return 1;
}
}
+1 -1
View File
@@ -162,7 +162,7 @@ void BgCheck_CreateVertexFromVec3f(Vec3s* vertex, Vec3f* vector) {
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_bgcheck/func_800C40B4.asm")
f32 func_800C411C(CollisionContext* bgCtxt, CollisionPoly* arg1, s32* arg2, Actor* actor, Vec3f* pos) {
f32 func_800C411C(CollisionContext* bgCtxt, CollisionPoly** arg1, s32* arg2, Actor* actor, Vec3f* pos) {
return func_800C3D50(0, bgCtxt, 2, arg1, arg2, pos, actor, 28, 1.0f, 0);
}
+2 -2
View File
@@ -225,7 +225,7 @@ void EffectSS_UpdateParticle(GlobalContext* ctxt, s32 index) {
particle->pos.y += particle->velocity.y;
particle->pos.z += particle->velocity.z;
(*particle->update)(ctxt, index, particle);
particle->update(ctxt, index, particle);
}
}
@@ -250,7 +250,7 @@ void EffectSS_UpdateAllParticles(GlobalContext* ctxt) {
void EffectSS_DrawParticle(GlobalContext* ctxt, s32 index) {
EffectSs* entry = &EffectSS2Info.data_table[index];
if (entry->draw != 0) {
(*entry->draw)(ctxt, index, entry);
entry->draw(ctxt, index, entry);
}
}
+10 -3
View File
@@ -187,9 +187,16 @@ void Lights_BindDirectional(Lights* lights, LightParams* params, void* unused) {
* available in the Lights group. This is at most 7 slots for a new group, but could be less.
*/
void Lights_BindAll(Lights* lights, LightNode* listHead, Vec3f* refPos, GlobalContext* globalCtx) {
static LightsPosBindFunc posBindFuncs[] = { Lights_BindPoint, Lights_BindDirectional, Lights_BindPoint };
static LightsBindFunc dirBindFuncs[] = { Lights_BindPointWithReference, Lights_BindDirectional,
Lights_BindPointWithReference };
static LightsPosBindFunc posBindFuncs[] = {
Lights_BindPoint,
(LightsPosBindFunc)Lights_BindDirectional,
Lights_BindPoint,
};
static LightsBindFunc dirBindFuncs[] = {
Lights_BindPointWithReference,
(LightsBindFunc)Lights_BindDirectional,
Lights_BindPointWithReference,
};
if (listHead != NULL) {
if ((refPos == NULL) && (lights->enablePosLights == 1)) {
+4 -3
View File
@@ -19,8 +19,9 @@ void SkelAnime_AnimationType4Loaded(GlobalContext* globalCtx, AnimationEntryType
void SkelAnime_AnimationType5Loaded(GlobalContext* globalCtx, AnimationEntryType5* entry);
static AnimationEntryCallback sAnimationLoadDone[] = {
SkelAnime_LinkAnimetionLoaded, SkelAnime_AnimationType1Loaded, SkelAnime_AnimationType2Loaded,
SkelAnime_AnimationType3Loaded, SkelAnime_AnimationType4Loaded, SkelAnime_AnimationType5Loaded,
(AnimationEntryCallback)SkelAnime_LinkAnimetionLoaded, (AnimationEntryCallback)SkelAnime_AnimationType1Loaded,
(AnimationEntryCallback)SkelAnime_AnimationType2Loaded, (AnimationEntryCallback)SkelAnime_AnimationType3Loaded,
(AnimationEntryCallback)SkelAnime_AnimationType4Loaded, (AnimationEntryCallback)SkelAnime_AnimationType5Loaded,
};
s32 D_801F5AB0;
@@ -1240,7 +1241,7 @@ void SkelAnime_ChangeLinkAnim(GlobalContext* globalCtx, SkelAnime* skelAnime, Li
skelAnime->initialFrame = frame;
skelAnime->animCurrentFrame = frame;
skelAnime->animFrameCount = frameCount;
skelAnime->totalFrames = SkelAnime_GetTotalFrames(linkAnimetionEntrySeg);
skelAnime->totalFrames = SkelAnime_GetTotalFrames(&linkAnimetionEntrySeg->genericHeader);
skelAnime->animPlaybackSpeed = playbackSpeed;
}
+2 -2
View File
@@ -113,11 +113,11 @@ s32 func_8013A530(GlobalContext* globalCtx, Actor* actor, s32 flag, Vec3f* pos,
s16 x;
s16 y;
f32 distance;
UNK_TYPE unk1;
CollisionPoly* unk1;
Camera* camera;
Actor* actors[2];
s32 ret = 0;
UNK_TYPE unk2;
u32 unk2;
camera = ACTIVE_CAM;
+1 -1
View File
@@ -62,5 +62,5 @@ void guLookAt(Mtx* m, f32 xEye, f32 yEye, f32 zEye, f32 xAt, f32 yAt, f32 zAt, f
guLookAtF(mf, xEye, yEye, zEye, xAt, yAt, zAt, xUp, yUp, zUp);
guMtxF2L((MtxF*)mf, m);
guMtxF2L(mf, m);
}
+1 -1
View File
@@ -154,5 +154,5 @@ void guLookAtHilite(Mtx* m, LookAt* l, Hilite* h, f32 xEye, f32 yEye, f32 zEye,
guLookAtHiliteF(mf, l, h, xEye, yEye, zEye, xAt, yAt, zAt, xUp, yUp, zUp, xl1, yl1, zl1, xl2, yl2, zl2, hiliteWidth,
hiliteHeight);
guMtxF2L((MtxF*)mf, m);
guMtxF2L(mf, m);
}
+4 -4
View File
@@ -35,11 +35,11 @@
char spaces[] = " ";
char zeroes[] = "00000000000000000000000000000000";
int _Printf(printf_func pfn, void* arg, char* fmt, va_list ap) {
int _Printf(printf_func pfn, void* arg, const char* fmt, va_list ap) {
_Pft x;
x.nchar = 0;
while (1) {
unsigned char* s;
const char* s;
unsigned char c;
unsigned char* t;
@@ -52,11 +52,11 @@ int _Printf(printf_func pfn, void* arg, char* fmt, va_list ap) {
while ((c = *s) != 0 && c != '%') {
s++;
}
_PROUT(fmt, s - fmt);
_PROUT((char*)fmt, s - fmt);
if (c == 0) {
return x.nchar;
}
fmt = (char*)++s;
fmt = ++s;
x.flags = 0;
// TODO the cast isn't necessary because strchr should take it in as const, but it currently doesn't
for (; (t = strchr((char*)fchar, *s)) != NULL; s++) {
@@ -170,7 +170,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
this->grabbed = NULL;
} else {
if (this->actor.child != NULL) {
f32 sp94 = Actor_DistanceBetweenActors(this, grabbed);
f32 sp94 = Actor_DistanceBetweenActors(&this->actor, grabbed);
f32 sp90 = sqrtf(SQ(this->unk1FC.x) + SQ(this->unk1FC.y) + SQ(this->unk1FC.z));
Math_Vec3f_Diff(&grabbed->world.pos, &this->unk1FC, &this->actor.world.pos);
if (50.0f < (sp94 - sp90)) {
@@ -111,7 +111,7 @@ static InitChainEntry sInitChain[] = {
};
extern Gfx D_06000828[];
extern CollisionHeader* D_06000908;
extern CollisionHeader D_06000908;
s32 BgKin2Fence_CheckHitMask(BgKin2Fence* this) {
ColliderJntSphElement* elements = this->collider.elements;
@@ -149,13 +149,13 @@ void BgKin2Fence_Init(Actor* thisx, GlobalContext* globalCtx) {
BgKin2Fence* this = THIS;
s32 i = 0;
Actor_ProcessInitChain(&this->dyna.actor, &sInitChain);
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
BcCheck3_BgActorInit(&this->dyna, 0);
BgCheck3_LoadMesh(globalCtx, &this->dyna, &D_06000908);
Collider_InitJntSph(globalCtx, &this->collider);
Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, &this->colliderElements);
Collider_SetJntSph(globalCtx, &this->collider, &this->dyna.actor, &sJntSphInit, this->colliderElements);
SysMatrix_SetStateRotationAndTranslation(this->dyna.actor.world.pos.x, this->dyna.actor.world.pos.y,
this->dyna.actor.world.pos.z, &this->dyna.actor.shape);
this->dyna.actor.world.pos.z, &this->dyna.actor.shape.rot);
Matrix_Scale(this->dyna.actor.scale.x, this->dyna.actor.scale.y, this->dyna.actor.scale.z, 1);
for (i = 0; i < 4; i++) {
@@ -209,7 +209,7 @@ void BgKin2Fence_HandleMaskCode(BgKin2Fence* this, GlobalContext* globalCtx) {
this->cooldownTimer -= 1;
return;
}
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider);
CollisionCheck_SetAC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
}
}

Some files were not shown because too many files have changed in this diff Show More