1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-04 23:14:37 +00:00

Use long over int for s32/u32 types (#1546)

* long s32

* Suggested changes
This commit is contained in:
Tharo 2023-10-17 20:16:31 +01:00 committed by GitHub
parent b3486b57ef
commit a20163c6ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
21 changed files with 66 additions and 62 deletions

View file

@ -2369,6 +2369,6 @@ void func_800BB060(void) {
sDebugCamAnim.unk_0A = 0;
}
s32 func_800BB06C(void) {
int func_800BB06C(void) {
return sDebugCamPtr->unk_00 == 2 && sDebugCamAnim.unk_0A != 0;
}

View file

@ -1000,15 +1000,15 @@ f32 func_8002DCE4(Player* player) {
}
}
s32 func_8002DD6C(Player* player) {
int func_8002DD6C(Player* player) {
return player->stateFlags1 & PLAYER_STATE1_3;
}
s32 func_8002DD78(Player* player) {
int func_8002DD78(Player* player) {
return func_8002DD6C(player) && player->unk_834;
}
s32 func_8002DDA8(PlayState* play) {
int func_8002DDA8(PlayState* play) {
Player* player = GET_PLAYER(play);
return (player->stateFlags1 & PLAYER_STATE1_11) || func_8002DD78(player);
@ -1049,7 +1049,7 @@ void Actor_MountHorse(PlayState* play, Player* player, Actor* horse) {
horse->child = &player->actor;
}
s32 func_8002DEEC(Player* player) {
int func_8002DEEC(Player* player) {
return (player->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_29)) || (player->csAction != PLAYER_CSACTION_NONE);
}
@ -2996,7 +2996,7 @@ Actor* Actor_Delete(ActorContext* actorCtx, Actor* actor, PlayState* play) {
return newHead;
}
s32 func_80032880(PlayState* play, Actor* actor) {
int func_80032880(PlayState* play, Actor* actor) {
s16 sp1E;
s16 sp1C;

View file

@ -37,7 +37,7 @@ void Font_LoadOrderedFont(Font* font) {
s32 jj;
s32 codePointIndex;
s32 fontBufIndex;
size_t offset;
u32 offset;
font->msgOffset = _message_0xFFFC_nes - (const char*)_nes_message_data_staticSegmentStart;
len = font->msgLength = _message_0xFFFD_nes - _message_0xFFFC_nes;

View file

@ -400,7 +400,7 @@ void Play_Init(GameState* thisx) {
zAllocAligned = (zAlloc + 8) & ~0xF;
ZeldaArena_Init((void*)zAllocAligned, zAllocSize - (zAllocAligned - zAlloc));
// "Zelda Heap"
osSyncPrintf("ゼルダヒープ %08x-%08x\n", zAllocAligned, zAllocAligned + zAllocSize - (s32)(zAllocAligned - zAlloc));
osSyncPrintf("ゼルダヒープ %08x-%08x\n", zAllocAligned, (u8*)zAllocAligned + zAllocSize - (s32)(zAllocAligned - zAlloc));
Fault_AddClient(&D_801614B8, ZeldaArena_Display, NULL, NULL);
Actor_InitContext(this, &this->actorCtx, this->playerEntry);
@ -1336,7 +1336,7 @@ void Play_Main(GameState* thisx) {
}
// original name: "Game_play_demo_mode_check"
s32 Play_InCsMode(PlayState* this) {
int Play_InCsMode(PlayState* this) {
return (this->csCtx.state != CS_STATE_IDLE) || Player_InCsMode(this);
}
@ -1773,7 +1773,7 @@ void Play_TriggerRespawn(PlayState* this) {
Play_LoadToLastEntrance(this);
}
s32 Play_CamIsNotFixed(PlayState* this) {
int Play_CamIsNotFixed(PlayState* this) {
// SCENE_CAM_TYPE_FIXED_SHOP_VIEWPOINT was probably intended to be in this condition,
// but the room shape type check handles all shop cases regardless
return (this->roomCtx.curRoom.roomShape->base.type != ROOM_SHAPE_TYPE_IMAGE) &&
@ -1781,7 +1781,7 @@ s32 Play_CamIsNotFixed(PlayState* this) {
(R_SCENE_CAM_TYPE != SCENE_CAM_TYPE_FIXED_MARKET) && (this->sceneId != SCENE_CASTLE_COURTYARD_GUARDS_DAY);
}
s32 FrameAdvance_IsEnabled(PlayState* this) {
int FrameAdvance_IsEnabled(PlayState* this) {
return !!this->frameAdvCtx.enabled;
}

View file

@ -487,14 +487,14 @@ void Player_SetBootData(PlayState* play, Player* this) {
}
}
s32 Player_InBlockingCsMode(PlayState* play, Player* this) {
int Player_InBlockingCsMode(PlayState* play, Player* this) {
return (this->stateFlags1 & (PLAYER_STATE1_7 | PLAYER_STATE1_29)) || (this->csAction != PLAYER_CSACTION_NONE) ||
(play->transitionTrigger == TRANS_TRIGGER_START) || (this->stateFlags1 & PLAYER_STATE1_0) ||
(this->stateFlags3 & PLAYER_STATE3_7) ||
((gSaveContext.magicState != MAGIC_STATE_IDLE) && (Player_ActionToMagicSpell(this, this->itemAction) >= 0));
}
s32 Player_InCsMode(PlayState* play) {
int Player_InCsMode(PlayState* play) {
Player* this = GET_PLAYER(play);
return Player_InBlockingCsMode(play, this) || (this->unk_6AD == 4);
@ -504,7 +504,7 @@ s32 func_8008E9C4(Player* this) {
return (this->stateFlags1 & PLAYER_STATE1_4);
}
s32 Player_IsChildWithHylianShield(Player* this) {
int Player_IsChildWithHylianShield(Player* this) {
return gSaveContext.save.linkAge != LINK_AGE_ADULT && (this->currentShield == PLAYER_SHIELD_HYLIAN);
}
@ -640,7 +640,7 @@ s32 func_8008EF44(PlayState* play, s32 ammo) {
return 1;
}
s32 Player_IsBurningStickInRange(PlayState* play, Vec3f* pos, f32 xzRange, f32 yRange) {
int Player_IsBurningStickInRange(PlayState* play, Vec3f* pos, f32 xzRange, f32 yRange) {
Player* this = GET_PLAYER(play);
Vec3f diff;
s32 pad;
@ -685,7 +685,7 @@ s32 Player_HasMirrorShieldEquipped(PlayState* play) {
return (this->currentShield == PLAYER_SHIELD_MIRROR);
}
s32 Player_HasMirrorShieldSetToDraw(PlayState* play) {
int Player_HasMirrorShieldSetToDraw(PlayState* play) {
Player* this = GET_PLAYER(play);
return (this->rightHandType == PLAYER_MODELTYPE_RH_SHIELD) && (this->currentShield == PLAYER_SHIELD_MIRROR);
@ -701,11 +701,11 @@ s32 Player_ActionToMagicSpell(Player* this, s32 itemAction) {
}
}
s32 Player_HoldsHookshot(Player* this) {
int Player_HoldsHookshot(Player* this) {
return (this->heldItemAction == PLAYER_IA_HOOKSHOT) || (this->heldItemAction == PLAYER_IA_LONGSHOT);
}
s32 func_8008F128(Player* this) {
int func_8008F128(Player* this) {
return Player_HoldsHookshot(this) && (this->heldActor == NULL);
}
@ -731,7 +731,7 @@ s32 Player_HoldsTwoHandedWeapon(Player* this) {
}
}
s32 Player_HoldsBrokenKnife(Player* this) {
int Player_HoldsBrokenKnife(Player* this) {
return (this->heldItemAction == PLAYER_IA_SWORD_BIGGORON) &&
(gSaveContext.save.info.playerData.swordHealth <= 0.0f);
}