From a554fa9f7d35679c36cb9149a080d9f8a1e5cbe4 Mon Sep 17 00:00:00 2001 From: lukaslw Date: Wed, 8 Oct 2014 18:09:18 +0200 Subject: PRINCE: Changing all occurrences of NULL to nullptr To beconsistent and to keep just one of them --- engines/prince/archive.cpp | 4 +- engines/prince/hero.cpp | 6 +- engines/prince/hero_set.h | 162 ++++++++++++++++++++++----------------------- engines/prince/prince.cpp | 2 +- engines/prince/prince.h | 2 +- engines/prince/sound.cpp | 4 +- 6 files changed, 90 insertions(+), 90 deletions(-) diff --git a/engines/prince/archive.cpp b/engines/prince/archive.cpp index 28f77cb4c4..bc5d5d3818 100644 --- a/engines/prince/archive.cpp +++ b/engines/prince/archive.cpp @@ -29,7 +29,7 @@ namespace Prince { -PtcArchive::PtcArchive() : _stream(NULL) { +PtcArchive::PtcArchive() : _stream(nullptr) { } PtcArchive::~PtcArchive() { @@ -81,7 +81,7 @@ bool PtcArchive::open(const Common::String &filename) { void PtcArchive::close() { delete _stream; - _stream = NULL; + _stream = nullptr; _items.clear(); } diff --git a/engines/prince/hero.cpp b/engines/prince/hero.cpp index bc127b398b..15dd7eb054 100644 --- a/engines/prince/hero.cpp +++ b/engines/prince/hero.cpp @@ -69,8 +69,8 @@ bool Hero::loadAnimSet(uint32 animSetNr) { _moveSet.resize(kMoveSetSize); for (uint32 i = 0; i < kMoveSetSize; i++) { debug("Anim set item %d %s", i, animSet[i]); - Animation *anim = NULL; - if (animSet[i] != NULL) { + Animation *anim = nullptr; + if (animSet[i] != nullptr) { anim = new Animation(); Resource::loadResource(anim, animSet[i], false); } @@ -93,7 +93,7 @@ Graphics::Surface *Hero::getSurface() { Graphics::Surface *heroFrame = heroAnim->getFrame(phaseFrameIndex); return heroFrame; } - return NULL; + return nullptr; } uint16 Hero::getData(AttrId dataId) { diff --git a/engines/prince/hero_set.h b/engines/prince/hero_set.h index 1674f67503..dfe7e50268 100644 --- a/engines/prince/hero_set.h +++ b/engines/prince/hero_set.h @@ -33,28 +33,28 @@ static HeroSetAnimNames heroSet5 = { "SR_DIAB.ANI", "SU_DIAB.ANI", "SD_DIAB.ANI", - NULL, - NULL, + nullptr, + nullptr, "MU_DIAB.ANI", "MD_DIAB.ANI", "TL_DIAB.ANI", "TR_DIAB.ANI", "TU_DIAB.ANI", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr }; static HeroSetAnimNames heroSet1 = { @@ -70,18 +70,18 @@ static HeroSetAnimNames heroSet1 = { "TR_HERO1.ANI", "TU_HERO1.ANI", "TD_HERO1.ANI", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, "KSI_KURZ.ANI", "KS_WLOSY.ANI" }; @@ -99,18 +99,18 @@ static HeroSetAnimNames heroSet2 = { "TR_HERO2.ANI", "TU_HERO2.ANI", "TD_HERO2.ANI", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, "KSI_KU_S.ANI", "KS_WLO_S.ANI" }; @@ -140,8 +140,8 @@ static HeroSetAnimNames heroSet3 = { "N_PRZ-LW.ANI", "N_PRZ-PR.ANI", "N_PRZ-TL.ANI", - NULL, - NULL, + nullptr, + nullptr, }; static HeroSetAnimNames shanSet1 = { @@ -157,18 +157,18 @@ static HeroSetAnimNames shanSet1 = { "TR_SHAN.ANI", "TU_SHAN.ANI", "TD_SHAN.ANI", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, "B1_SHAN.ANI", "B2_SHAN.ANI", }; @@ -186,18 +186,18 @@ static HeroSetAnimNames shanSet2 = { "TR_SHAN2.ANI", "TU_SHAN.ANI", "TD_SHAN2.ANI", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, "B1_SHAN2.ANI", "B2_SHAN2.ANI" }; @@ -215,20 +215,20 @@ static HeroSetAnimNames arivSet1 = { "TR_ARIV.ANI", "TU_ARIV.ANI", "TD_ARIV.ANI", - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL, - NULL + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr, + nullptr }; const HeroSetAnimNames *heroSetTable[7] = { diff --git a/engines/prince/prince.cpp b/engines/prince/prince.cpp index 0267cf58bb..a0cb863dc2 100644 --- a/engines/prince/prince.cpp +++ b/engines/prince/prince.cpp @@ -2203,7 +2203,7 @@ void PrinceEngine::drawInvItems() { int drawX = currInvX; int drawY = currInvY; - Graphics::Surface *itemSurface = NULL; + Graphics::Surface *itemSurface = nullptr; if (itemNr != 68) { itemSurface = _allInvList[itemNr].getSurface(); if (itemSurface->h < _maxInvH) { diff --git a/engines/prince/prince.h b/engines/prince/prince.h index d7519e2414..e6d56b283e 100644 --- a/engines/prince/prince.h +++ b/engines/prince/prince.h @@ -76,7 +76,7 @@ struct Text { uint16 _time; uint32 _color; - Text() : _str(NULL), _x(0), _y(0), _time(0), _color(255){ + Text() : _str(nullptr), _x(0), _y(0), _time(0), _color(255){ } }; diff --git a/engines/prince/sound.cpp b/engines/prince/sound.cpp index e58e89d8f9..032297ee43 100644 --- a/engines/prince/sound.cpp +++ b/engines/prince/sound.cpp @@ -119,7 +119,7 @@ const uint8 MusicPlayer::_musRoomTable[] = { MusicPlayer::MusicPlayer(PrinceEngine *vm) : _vm(vm) { - _data = NULL; + _data = nullptr; _isGM = false; MidiPlayer::createDriver(); @@ -143,7 +143,7 @@ void MusicPlayer::killMidi() { Audio::MidiPlayer::stop(); free(_data); - _data = NULL; + _data = nullptr; } void MusicPlayer::loadMidi(const char *name) { -- cgit v1.2.3