Skip to content

Commit 733febf

Browse files
committed
tidy
1 parent df36c79 commit 733febf

13 files changed

Lines changed: 16 additions & 29 deletions

src/sound.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ auto sound_load(float volume, const std::string &name, const std::string &name_a
181181
TRACE();
182182

183183
if (m->chunk == nullptr) {
184-
if (me) {
184+
if (me != nullptr) {
185185
thing_err(me, "cannot find sound chunk %s", m->name_alias.c_str());
186186
} else {
187187
ERR("cannot find sound chunk %s", m->name_alias.c_str());
@@ -215,7 +215,7 @@ auto sound_load(float volume, const std::string &name, const std::string &name_a
215215

216216
auto chan = Mix_PlayChannel(-1, m->chunk, loops);
217217
if (chan == -1) {
218-
if (me) {
218+
if (me != nullptr) {
219219
THING_DBG(me, "Failed to play sound %s volume %d channel %d: %s", name_alias.c_str(), static_cast< int >(volume), chan,
220220
Mix_GetError());
221221
} else {
@@ -229,7 +229,7 @@ auto sound_load(float volume, const std::string &name, const std::string &name_a
229229
p.volume = static_cast< int >(volume);
230230
already_playing[ chan ] = p;
231231

232-
if (me) {
232+
if (me != nullptr) {
233233
THING_DBG(me, "play sound %s volume %d channel %d", name_alias.c_str(), static_cast< int >(volume), chan);
234234
} else {
235235
DBG("play sound %s volume %d channel %d", name_alias.c_str(), static_cast< int >(volume), chan);
@@ -249,7 +249,7 @@ auto sound_play(Gamep g, const std::string &name_alias, float scale, int loops,
249249
auto *sound = find_one(name_alias);
250250
if (sound == nullptr) {
251251
if (! g_opt_tests && ! g_opt_do_level_gen && ! g_opt_do_level_select_gen && ! g_opt_do_room_gen) {
252-
if (me) {
252+
if (me != nullptr) {
253253
thing_err(me, "cannot find sound %s", name_alias.c_str());
254254
} else {
255255
ERR("cannot find sound %s", name_alias.c_str());

src/thing_carry_drop.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ auto thing_carry(Gamep g, Levelsp v, Levelp l, Thingp me, Thingp item, ThingEven
318318
// Auto wield if nothing wielded?
319319
//
320320
if (thing_is_auto_wield(item)) {
321-
if (! thing_wielding(g, v, l, me)) {
321+
if (thing_wielding(g, v, l, me) == nullptr) {
322322
if (! thing_wield(g, v, l, me, item, e)) {
323323
return false;
324324
}

src/thing_laser.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "my_fpoint.hpp"
88
#include "my_game_defs.hpp"
99
#include "my_level.hpp"
10+
#include "my_main.hpp"
1011
#include "my_math.hpp"
1112
#include "my_thing.hpp"
1213
#include "my_tp.hpp"

src/wid_cfg_gfx.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static bool menu_was_created_due_to_game_restarting;
3838

3939
static void wid_cfg_gfx_destroy()
4040
{
41-
if (! wid_cfg_gfx_window) {
41+
if (wid_cfg_gfx_window == nullptr) {
4242
return;
4343
}
4444

src/wid_credits.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ static WidPopup *wid_credits_window;
2323

2424
static void wid_credits_destroy(Gamep g)
2525
{
26-
if (! wid_credits_window) {
26+
if (wid_credits_window == nullptr) {
2727
return;
2828
}
2929

src/wid_error.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ static WidPopup *wid_error_window;
2323

2424
static void wid_error_destroy(Gamep g)
2525
{
26-
if (! wid_error_window) {
26+
if (wid_error_window == nullptr) {
2727
return;
2828
}
2929

src/wid_hiscore.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ static WidPopup *wid_hiscore_window;
2828

2929
static void wid_hiscore_destroy(Gamep g)
3030
{
31-
if (! wid_hiscore_window) {
31+
if (wid_hiscore_window == nullptr) {
3232
return;
3333
}
3434

src/wid_intro.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static WidPopup *wid_intro_window;
2727

2828
static void wid_intro_destroy()
2929
{
30-
if (! wid_intro_window) {
30+
if (wid_intro_window == nullptr) {
3131
return;
3232
}
3333

src/wid_main_menu.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ static WidPopup *wid_main_menu_window;
3232

3333
void wid_main_menu_destroy(Gamep /*g*/)
3434
{
35-
if (! wid_main_menu_window) {
35+
if (wid_main_menu_window == nullptr) {
3636
return;
3737
}
3838

src/wid_more.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,13 @@
1717

1818
#include <SDL_keyboard.h>
1919
#include <SDL_keycode.h>
20-
#include <cmath>
2120
#include <cstdint>
2221

2322
static WidPopup *wid_more_window;
2423

2524
static void wid_more_destroy()
2625
{
27-
if (! wid_more_window) {
26+
if (wid_more_window == nullptr) {
2827
return;
2928
}
3029

0 commit comments

Comments
 (0)