diff options
| author | Tharo <17233964+Thar0@users.noreply.github.com> | 2023-10-17 20:16:31 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-10-17 21:16:31 +0200 |
| commit | a20163c6abf7700c432c711b03532cc4ad8d198a (patch) | |
| tree | df1d59b95bc42d14acd8c42c3557f0197be83799 /src/code | |
| parent | b3486b57ef41a284a366eb40ca07bf82bf4750d6 (diff) | |
Use `long` over `int` for s32/u32 types (#1546)
* long s32
* Suggested changes
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/db_camera.c | 2 | ||||
| -rw-r--r-- | src/code/z_actor.c | 10 | ||||
| -rw-r--r-- | src/code/z_kanfont.c | 2 | ||||
| -rw-r--r-- | src/code/z_play.c | 8 | ||||
| -rw-r--r-- | src/code/z_player_lib.c | 16 |
5 files changed, 19 insertions, 19 deletions
diff --git a/src/code/db_camera.c b/src/code/db_camera.c index 90298c6cc..12e400bfe 100644 --- a/src/code/db_camera.c +++ b/src/code/db_camera.c @@ -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; } diff --git a/src/code/z_actor.c b/src/code/z_actor.c index e95a67ce6..bfae518bc 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -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; diff --git a/src/code/z_kanfont.c b/src/code/z_kanfont.c index 2da6c53a9..5f83f5779 100644 --- a/src/code/z_kanfont.c +++ b/src/code/z_kanfont.c @@ -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; diff --git a/src/code/z_play.c b/src/code/z_play.c index 2ece8f970..1cd8497c9 100644 --- a/src/code/z_play.c +++ b/src/code/z_play.c @@ -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; } diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index a14934d2c..5426a780a 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -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); } |
