diff options
author | Henry Wilson <m3henry@googlemail.com> | 2019-04-10 22:07:06 +0100 |
---|---|---|
committer | Michael Lutz <michi@icosahedron.de> | 2019-04-10 23:22:20 +0200 |
commit | 7c8e7c6b6e16d4a26259a676db32d8776b99817e (patch) | |
tree | 99f134b7e66367cf11e10bc5061896eab4a3264f /src/newgrf_sound.cpp | |
parent | 3b4f224c0bc50e7248050d4bcbb6d83fd510c1cc (diff) | |
download | openttd-7c8e7c6b6e16d4a26259a676db32d8776b99817e.tar.xz |
Codechange: Use null pointer literal instead of the NULL macro
Diffstat (limited to 'src/newgrf_sound.cpp')
-rw-r--r-- | src/newgrf_sound.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/newgrf_sound.cpp b/src/newgrf_sound.cpp index 0a04f4400..a25c3abcc 100644 --- a/src/newgrf_sound.cpp +++ b/src/newgrf_sound.cpp @@ -49,7 +49,7 @@ void InitializeSoundPool() SoundEntry *GetSound(SoundID index) { - if (index >= _sounds.size()) return NULL; + if (index >= _sounds.size()) return nullptr; return &_sounds[index]; } @@ -173,7 +173,7 @@ SoundID GetNewGRFSoundID(const GRFFile *file, SoundID sound_id) if (sound_id < ORIGINAL_SAMPLE_COUNT) return sound_id; sound_id -= ORIGINAL_SAMPLE_COUNT; - if (file == NULL || sound_id >= file->num_sounds) return INVALID_SOUND; + if (file == nullptr || sound_id >= file->num_sounds) return INVALID_SOUND; return file->sound_offset + sound_id; } @@ -192,7 +192,7 @@ bool PlayVehicleSound(const Vehicle *v, VehicleSoundEvent event) uint16 callback; /* If the engine has no GRF ID associated it can't ever play any new sounds */ - if (file == NULL) return false; + if (file == nullptr) return false; /* Check that the vehicle type uses the sound effect callback */ if (!HasBit(EngInfo(v->engine_type)->callback_mask, CBM_VEHICLE_SOUND_EFFECT)) return false; |