SHERLOCK: Use nullptr

Using clang-tidy modernize-use-nullptr
This commit is contained in:
Orgad Shaneh 2021-11-13 23:40:39 +02:00 committed by Filippos Karapetis
parent ed5489929c
commit 1296eb0c2a
9 changed files with 29 additions and 29 deletions

View File

@ -29,7 +29,7 @@
static const PlainGameDescriptor sherlockGames[] = {
{ "scalpel", "The Case of the Serrated Scalpel" },
{ "rosetattoo", "The Case of the Rose Tattoo" },
{0, 0}
{nullptr, nullptr}
};
static const DebugChannelDef debugFlagList[] = {

View File

@ -381,7 +381,7 @@ void ImageFile3DO::loadAnimationFile(Common::SeekableReadStream &stream) {
streamLeft -= celDataSize;
// always 16 bits per pixel (RGB555)
decompress3DOCelFrame(frame, data_, celDataSize, 16, NULL);
decompress3DOCelFrame(frame, data_, celDataSize, 16, nullptr);
delete[] data_;
@ -399,7 +399,7 @@ void ImageFile3DO::load3DOCelFile(Common::SeekableReadStream &stream) {
int32 chunkStartPos = 0;
uint32 chunkTag = 0;
uint32 chunkSize = 0;
byte *chunkDataPtr = NULL;
byte *chunkDataPtr = nullptr;
// ANIM chunk (animation header for animation files)
bool animFound = false;
@ -596,7 +596,7 @@ void ImageFile3DO::load3DOCelFile(Common::SeekableReadStream &stream) {
// Decompress/copy this frame
if (!plutFound) {
decompress3DOCelFrame(imageFrame, chunkDataPtr, dataSize, ccbPRE0_bitsPerPixel, NULL);
decompress3DOCelFrame(imageFrame, chunkDataPtr, dataSize, ccbPRE0_bitsPerPixel, nullptr);
} else {
decompress3DOCelFrame(imageFrame, chunkDataPtr, dataSize, ccbPRE0_bitsPerPixel, &plutRGBlookupTable);
}
@ -721,7 +721,7 @@ void ImageFile3DO::load3DOCelRoomData(Common::SeekableReadStream &stream) {
imageFrame._size = 0;
// Decompress/copy this frame
decompress3DOCelFrame(imageFrame, celDataPtr, celDataSize, ccbPRE0_bitsPerPixel, NULL);
decompress3DOCelFrame(imageFrame, celDataPtr, celDataSize, ccbPRE0_bitsPerPixel, nullptr);
delete[] celDataPtr;
@ -907,9 +907,9 @@ void ImageFile3DO::loadFont(Common::SeekableReadStream &stream) {
uint32 header_maxChar = 0;
uint32 header_charCount = 0;
byte *widthTablePtr = NULL;
byte *widthTablePtr = nullptr;
uint32 bitsTableSize = 0;
byte *bitsTablePtr = NULL;
byte *bitsTablePtr = nullptr;
stream.skip(2); // Unknown bytes
stream.skip(2); // Unknown bytes (0x000E)
@ -938,7 +938,7 @@ void ImageFile3DO::loadFont(Common::SeekableReadStream &stream) {
// Now extract all characters
uint16 curChar = 0;
const byte *curBitsLinePtr = bitsTablePtr;
const byte *curBitsPtr = NULL;
const byte *curBitsPtr = nullptr;
byte curBitsLeft = 0;
uint32 curCharHeightLeft = 0;
uint32 curCharWidthLeft = 0;

View File

@ -72,7 +72,7 @@ MidiParser_SH::MidiParser_SH() {
MidiParser_SH::~MidiParser_SH() {
Common::StackLock lock(_mutex);
unloadMusic();
_driver = NULL;
_driver = nullptr;
}
void MidiParser_SH::parseNextEvent(EventInfo &info) {
@ -209,7 +209,7 @@ void MidiParser_SH::unloadMusic() {
if (_musData) {
delete[] _musData;
_musData = NULL;
_musData = nullptr;
_musDataSize = 0;
}
@ -219,8 +219,8 @@ void MidiParser_SH::unloadMusic() {
/*----------------------------------------------------------------*/
Music::Music(SherlockEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer) {
_midiDriver = NULL;
_midiParser = NULL;
_midiDriver = nullptr;
_midiParser = nullptr;
_musicType = MT_NULL;
_musicPlaying = false;
_midiOption = false;
@ -336,7 +336,7 @@ Music::Music(SherlockEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer) {
Music::~Music() {
stopMusic();
if (_midiDriver) {
_midiDriver->setTimerCallback(this, NULL);
_midiDriver->setTimerCallback(this, nullptr);
}
if (_midiParser) {
_midiParser->stopPlaying();

View File

@ -217,8 +217,8 @@ uint16 frequencyLookUpTable[SHERLOCK_ADLIB_NOTES_COUNT] = {
class MidiDriver_SH_AdLib : public MidiDriver {
public:
MidiDriver_SH_AdLib(Audio::Mixer *mixer)
: _masterVolume(15), _opl(0),
_adlibTimerProc(0), _adlibTimerParam(0), _isOpen(false) {
: _masterVolume(15), _opl(nullptr),
_adlibTimerProc(nullptr), _adlibTimerParam(nullptr), _isOpen(false) {
memset(_voiceChannelMapping, 0, sizeof(_voiceChannelMapping));
}
~MidiDriver_SH_AdLib() override { }
@ -227,8 +227,8 @@ public:
int open() override;
void close() override;
void send(uint32 b) override;
MidiChannel *allocateChannel() override { return NULL; }
MidiChannel *getPercussionChannel() override { return NULL; }
MidiChannel *allocateChannel() override { return nullptr; }
MidiChannel *getPercussionChannel() override { return nullptr; }
bool isOpen() const override { return _isOpen; }
uint32 getBaseTempo() override { return 1000000 / OPL::OPL::kDefaultCallbackFrequency; }
@ -251,7 +251,7 @@ private:
byte currentA0hReg;
byte currentB0hReg;
adlib_ChannelEntry() : inUse(false), inUseTimer(0), currentInstrumentPtr(NULL), currentNote(0),
adlib_ChannelEntry() : inUse(false), inUseTimer(0), currentInstrumentPtr(nullptr), currentNote(0),
currentA0hReg(0), currentB0hReg(0) { }
};

View File

@ -41,7 +41,7 @@ const byte mt32ReverbDataSysEx[] = {
class MidiDriver_MT32 : public MidiDriver {
public:
MidiDriver_MT32() {
_driver = NULL;
_driver = nullptr;
_isOpen = false;
_nativeMT32 = false;
_baseFreq = 250;
@ -62,12 +62,12 @@ public:
MidiChannel *allocateChannel() override {
if (_driver)
return _driver->allocateChannel();
return NULL;
return nullptr;
}
MidiChannel *getPercussionChannel() override {
if (_driver)
return _driver->getPercussionChannel();
return NULL;
return nullptr;
}
void setTimerCallback(void *timer_param, Common::TimerManager::TimerProc timer_proc) override {
@ -103,11 +103,11 @@ public:
MidiDriver_MT32::~MidiDriver_MT32() {
Common::StackLock lock(_mutex);
if (_driver) {
_driver->setTimerCallback(0, 0);
_driver->setTimerCallback(nullptr, nullptr);
_driver->close();
delete _driver;
}
_driver = NULL;
_driver = nullptr;
}
int MidiDriver_MT32::open() {

View File

@ -45,7 +45,7 @@ bool ScalpelDebugger::cmd3DO_PlayMovie(int argc, const char **argv) {
Common::String filename = argv[1];
_3doPlayMovieFile = filename;
return cmdExit(0, 0);
return cmdExit(0, nullptr);
}
bool ScalpelDebugger::cmd3DO_PlayAudio(int argc, const char **argv) {

View File

@ -153,7 +153,7 @@ int ScalpelMap::show() {
screen.clear();
// Load the entire map
ImageFile *bigMap = NULL;
ImageFile *bigMap = nullptr;
if (!IS_3DO) {
// PC
bigMap = new ImageFile("bigmap.vgs");

View File

@ -434,7 +434,7 @@ Logo::Logo(ScalpelEngine *vm) : _vm(vm), _lib("sf3.rlb") {
_animateObject = 0;
_animateStartFrame = 0;
_animateFrameDelay = 0;
_animateFrames = NULL;
_animateFrames = nullptr;
_animateFrame = 0;
// Save a copy of the original palette
@ -499,7 +499,7 @@ void Logo::nextFrame() {
} else {
_animateObject = 0;
_animateFrameDelay = 0;
_animateFrames = NULL;
_animateFrames = nullptr;
_animateStartFrame = 0;
_animateFrame = 0;
}

View File

@ -964,8 +964,8 @@ bool Scene::loadScene(const Common::String &filename) {
error("Could not open file - %s", roomBackgroundFilename.c_str());
int totalPixelCount = SHERLOCK_SCREEN_WIDTH * SHERLOCK_SCENE_HEIGHT;
uint16 *roomBackgroundDataPtr = NULL;
uint16 *pixelSourcePtr = NULL;
uint16 *roomBackgroundDataPtr = nullptr;
uint16 *pixelSourcePtr = nullptr;
uint16 *pixelDestPtr = (uint16 *)screen._backBuffer1.getPixels();
uint16 curPixel = 0;
uint32 roomBackgroundStreamSize = roomBackgroundStream.size();