diff options
| author | Luke Street <luke@street.dev> | 2026-02-28 21:19:17 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-02-28 20:19:17 -0800 |
| commit | 6a48380461bc9baabe1706ba57ca0cedfa2d0c51 (patch) | |
| tree | 593e054cfcb0250e63917c58b445a7e1f025a023 /src/d/actor/d_a_obj_lp.cpp | |
| parent | b5d3b8c059c10711370437f7db7539cd90f1cb29 (diff) | |
More GCC compatibility/warning fixes (#3118)
* Wrap >4-char literals in a MULTI_CHAR macro
Modern compilers do not support CW's non-standard behavior with
>4 char literals. We can, however, use a constexpr function to
compute the u64 values directly. This leaves <=4 char literals
unchanged.
* Replace non-pointer usages of NULL with 0
* Define NULL to nullptr on C++11 and above
* Fix more -Wpointer-arith and -Woverflow warnings
* Replace u32/s32 with uintptr_t/intptr_t where appropriate
* JSUOutputStream: Overload all standard int types
Diffstat (limited to 'src/d/actor/d_a_obj_lp.cpp')
| -rw-r--r-- | src/d/actor/d_a_obj_lp.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/d/actor/d_a_obj_lp.cpp b/src/d/actor/d_a_obj_lp.cpp index 4d75aacb08..77011548d5 100644 --- a/src/d/actor/d_a_obj_lp.cpp +++ b/src/d/actor/d_a_obj_lp.cpp @@ -53,14 +53,14 @@ static int tandem; static int demo_f; -static int target_info[10]; +static void* target_info[10]; static int target_info_count; static void* s_ks_sub(void* param_1, void* param_2) { if (fopAcM_IsActor(param_1) && fopAcM_GetName(param_1) == 0x60) { if (target_info_count < 10) { - target_info[target_info_count] = (intptr_t)param_1; + target_info[target_info_count] = param_1; target_info_count++; } return param_1; @@ -77,7 +77,7 @@ static int hit_check(obj_lp_class* i_this, wd_ss* WdSs) { fVar1 = 50.0f; for (int i = 0; i < target_info_count; i++) { - sp6c = WdSs->field_0x10 - *(cXyz *)(target_info[i] + 0x4d0); + sp6c = WdSs->field_0x10 - *(cXyz *)((u8 *)target_info[i] + 0x4d0); if (sp6c.y >= -3.0f) { f32 dist = JMAFastSqrt(sp6c.x * sp6c.x + sp6c.z * sp6c.z); if (dist <= fVar1 * WdSs->field_0x3c) { @@ -126,7 +126,7 @@ static int hit_check(obj_lp_class* i_this, wd_ss* WdSs) { cLib_addCalc2(&WdSs->field_0x10.y, WdSs->field_0x4.y + fVar8 * -0.5f, 0.5f, 3.0f); cLib_addCalc2(&WdSs->field_0x28.x, fVar8, 0.1f, fVar8 * 0.5f); cLib_addCalcAngleS2(&WdSs->field_0x34, cM_atan2s(sp6c.x, sp6c.z), 0x20, 0x400); - cLib_addCalcAngleS2(&WdSs->field_0x36, 0xfffff060, 0x20, 0x400); + cLib_addCalcAngleS2(&WdSs->field_0x36, -4000, 0x20, 0x400); rv = 1; } } @@ -221,7 +221,7 @@ static int daObj_Lp_Execute(obj_lp_class* i_this) { target_info[i] = 0; } - target_info[0] = (intptr_t)dComIfGp_getPlayer(0); + target_info[0] = dComIfGp_getPlayer(0); target_info_count = 1; if (strcmp(dComIfGp_getStartStageName(), "D_MN05") == 0) { |
