Skip to content

Commit 339c00f

Browse files
authored
Use explicit zero-comparison in dBgS_Acch::Chk* functions (#2533)
1 parent cd99fa7 commit 339c00f

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

include/d/d_bg_s_acch.h

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ class dBgS_AcchCir : public cBgS_PolyInfo {
4646
f32 GetWallR() { return m_wall_r; }
4747
void SetWallH(f32 h) { m_wall_h = h; }
4848
void ClrWallHDirect() { m_flags &= ~WALL_H_DIRECT; }
49-
bool ChkWallHit() { return m_flags & WALL_HIT; }
49+
bool ChkWallHit() { return (m_flags & WALL_HIT) != 0; }
5050
s16 GetWallAngleY() { return m_wall_angle_y; }
51-
bool ChkWallHDirect() { return m_flags & WALL_H_DIRECT; }
51+
bool ChkWallHDirect() { return (m_flags & WALL_H_DIRECT) != 0; }
5252
f32 GetWallHDirect() { return m_wall_h_direct; }
5353
f32 GetWallRR() { return m_wall_rr; }
5454
void SetWallHit() { m_flags |= WALL_HIT; }
@@ -124,9 +124,9 @@ class dBgS_Acch : public cBgS_Chk, public dBgS_Chk {
124124
f32 GetRoofHeight() const { return m_roof_height; }
125125
int GetTblSize() { return m_tbl_size; }
126126
void SetLin() { m_lin.SetStartEnd(*pm_old_pos, *pm_pos); }
127-
bool ChkGroundFind() { return m_flags & GROUND_FIND; }
128-
bool ChkGroundHit() const { return m_flags & GROUND_HIT; }
129-
bool ChkGroundLanding() const { return m_flags & GROUND_LANDING; }
127+
bool ChkGroundFind() { return (m_flags & GROUND_FIND) != 0; }
128+
bool ChkGroundHit() const { return (m_flags & GROUND_HIT) != 0; }
129+
bool ChkGroundLanding() const { return (m_flags & GROUND_LANDING) != 0; }
130130
void ClrGroundLanding() { m_flags &= ~GROUND_LANDING; }
131131
void ClrGroundAway() { m_flags &= ~GROUND_AWAY; }
132132
void ClrWallHit() { m_flags &= ~WALL_HIT; }
@@ -136,26 +136,26 @@ class dBgS_Acch : public cBgS_Chk, public dBgS_Chk {
136136
u32 ChkWallHit() const { return m_flags & WALL_HIT; }
137137
void OffLineCheckHit() { m_flags &= ~LINE_CHECK_HIT; }
138138
void OffLineCheck() { m_flags &= ~LINE_CHECK; }
139-
u32 ChkLineCheckNone() const { return m_flags & LINE_CHECK_NONE; }
140-
u32 ChkLineCheck() const { return m_flags & LINE_CHECK; }
139+
u32 ChkLineCheckNone() const { return (m_flags & LINE_CHECK_NONE) != 0; }
140+
u32 ChkLineCheck() const { return (m_flags & LINE_CHECK) != 0; }
141141
void ClrRoofHit() { m_flags &= ~ROOF_HIT; }
142142
void ClrWaterHit() { m_flags &= ~WATER_HIT; }
143143
void SetWaterHit() { m_flags |= WATER_HIT; }
144144
void ClrWaterIn() { m_flags &= ~WATER_IN; }
145145
void SetWaterIn() { m_flags |= WATER_IN; }
146146
const u32 MaskWaterIn() const { return m_flags & WATER_IN; }
147-
const bool ChkWaterIn() const { return MaskWaterIn();}
147+
const bool ChkWaterIn() const { return MaskWaterIn() != 0; }
148148
void ClrGroundFind() { m_flags &= ~GROUND_FIND; }
149149
u32 MaskRoofHit() const { return m_flags & ROOF_HIT; }
150-
bool ChkRoofHit() const { return MaskRoofHit(); }
150+
bool ChkRoofHit() const { return MaskRoofHit() != 0; }
151151
void OffClrSpeedY() { m_flags |= CLR_SPEED_Y; }
152152
bool ChkClrSpeedY() const { return !(m_flags & CLR_SPEED_Y); }
153153
void SetGroundFind() { m_flags |= GROUND_FIND; }
154154
void SetGroundHit() { m_flags |= GROUND_HIT; }
155155
void SetGroundLanding() { m_flags |= GROUND_LANDING; }
156156
void SetGroundAway() { m_flags |= GROUND_AWAY; }
157157
const u32 MaskWaterHit() const { return m_flags & WATER_HIT; }
158-
const bool ChkWaterHit() const { return MaskWaterHit(); }
158+
const bool ChkWaterHit() const { return MaskWaterHit() != 0; }
159159
void ClrWaterNone() { m_flags &= ~WATER_NONE; }
160160
void SetWaterCheckOffset(f32 offset) { m_wtr_chk_offset = offset; }
161161
void OnLineCheck() { m_flags |= LINE_CHECK; }
@@ -164,14 +164,14 @@ class dBgS_Acch : public cBgS_Chk, public dBgS_Chk {
164164
void SetWtrChkMode(int mode) { m_wtr_mode = mode; }
165165
void SetGrndNone() { m_flags |= GRND_NONE; }
166166
void ClrGrndNone() { m_flags &= ~GRND_NONE; }
167-
bool ChkMoveBGOnly() const { return m_flags & MOVE_BG_ONLY; }
167+
bool ChkMoveBGOnly() const { return (m_flags & MOVE_BG_ONLY) != 0; }
168168
void SetWallHit() { m_flags |= WALL_HIT; }
169169
void ClrWallNone() { m_flags &= ~WALL_NONE; }
170170
void OnLineCheckNone() { m_flags |= LINE_CHECK_NONE; }
171171
void OffLineCheckNone() { m_flags &= ~LINE_CHECK_NONE; }
172172
void SetWallNone() { m_flags |= WALL_NONE; }
173173
void OnLineCheckHit() { m_flags |= LINE_CHECK_HIT; }
174-
bool ChkGroundAway() const { return m_flags & GROUND_AWAY; }
174+
bool ChkGroundAway() const { return (m_flags & GROUND_AWAY) != 0; }
175175
void ClrGroundHit() { m_flags &= ~GROUND_HIT; }
176176

177177
cM3dGCyl* GetWallBmdCylP() { return &m_wall_cyl; }

src/d/actor/d_a_obj_carry.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3172,7 +3172,6 @@ BOOL daObjCarry_c::chkSinkObj() {
31723172
}
31733173

31743174
/* 8047573C-80476618 0067BC 0EDC+00 1/1 0/0 0/0 .text bg_check__12daObjCarry_cFv */
3175-
// NONMATCHING - regalloc, equivalent?
31763175
void daObjCarry_c::bg_check() {
31773176
bool roof_hit = mAcch.ChkRoofHit();
31783177
bool wall_hit = mAcch.ChkWallHit();

0 commit comments

Comments
 (0)