PRINCE: Use nullptr

Using clang-tidy modernize-use-nullptr
This commit is contained in:
Orgad Shaneh 2021-11-13 23:40:37 +02:00 committed by Filippos Karapetis
parent b56293beaf
commit 5733e3de1c
6 changed files with 12 additions and 12 deletions

View File

@ -158,7 +158,7 @@ const Common::ArchiveMemberPtr PtcArchive::getMember(const Common::Path &path) c
Common::SeekableReadStream *PtcArchive::createReadStreamForMember(const Common::Path &path) const {
Common::String name = path.toString();
if (!_items.contains(name)) {
return 0;
return nullptr;
}
debug(8, "PtcArchive::createReadStreamForMember(%s)", name.c_str());
@ -166,7 +166,7 @@ Common::SeekableReadStream *PtcArchive::createReadStreamForMember(const Common::
const FileEntry &entryHeader = _items[name];
if (entryHeader._size < 4)
return 0;
return nullptr;
uint32 size = entryHeader._size;

View File

@ -27,7 +27,7 @@
static const PlainGameDescriptor princeGames[] = {
{"prince", "The Prince and the Coward"},
{0, 0}
{nullptr, nullptr}
};
static const DebugChannelDef debugFlagList[] = {
@ -103,7 +103,7 @@ static const PrinceGameDescription gameDescriptions[] = {
"prince",
"w/translation",
AD_ENTRY2s("databank.ptc", "5fa03833177331214ec1354761b1d2ee", 3565031,
"prince_translation.dat", 0, -1),
"prince_translation.dat", nullptr, -1),
Common::EN_ANY,
Common::kPlatformWindows,
GF_TRANSLATED | ADGF_DROPPLATFORM,
@ -116,7 +116,7 @@ static const PrinceGameDescription gameDescriptions[] = {
"prince",
"w/translation",
AD_ENTRY2s("databank.ptc", "48ec9806bda9d152acbea8ce31c93c49", 3435298,
"prince_translation.dat", 0, -1),
"prince_translation.dat", nullptr, -1),
Common::EN_ANY,
Common::kPlatformWindows,
GF_TRANSLATED | ADGF_DROPPLATFORM,
@ -131,7 +131,7 @@ static const PrinceGameDescription gameDescriptions[] = {
const static char *directoryGlobs[] = {
"all",
0
nullptr
};
class PrinceMetaEngineDetection : public AdvancedMetaEngineDetection {

View File

@ -45,7 +45,7 @@ GraphicsMan::GraphicsMan(PrinceEngine *vm) : _vm(vm), _changed(false) {
_shadowTable70 = (byte *)malloc(256);
_shadowTable50 = (byte *)malloc(256);
_roomBackground = 0;
_roomBackground = nullptr;
}
GraphicsMan::~GraphicsMan() {

View File

@ -264,7 +264,7 @@ void Hero::showHeroShadow(Graphics::Surface *screen, DrawNode *drawNode) {
int shadWallDown = 0;
int shadWallBitAddr = 0;
int shadWallBitMask = 0;
byte *shadWallDestAddr = 0;
byte *shadWallDestAddr = nullptr;
int shadWallPosY = 0;
int shadWallSkipX = 0;
int shadWallModulo = 0;

View File

@ -771,7 +771,7 @@ void PrinceEngine::leftMouseButton() {
if (!text._str) {
continue;
}
text._str = 0;
text._str = nullptr;
text._time = 0;
}
}

View File

@ -1537,8 +1537,8 @@ void Interpreter::O_INITDIALOG() {
_string = string + adressOfFirstSequence;
for (int i = 0; i < 32; i++) {
_vm->_dialogBoxAddr[i] = 0;
_vm->_dialogOptAddr[i] = 0;
_vm->_dialogBoxAddr[i] = nullptr;
_vm->_dialogOptAddr[i] = nullptr;
}
for (int i = 0; i < 4 * 32; i++) {
@ -1574,7 +1574,7 @@ void Interpreter::O_INITDIALOG() {
int freeHSlot = 0;
for (int i = 31; i >= 0; i--) {
if (_vm->_dialogOptAddr[i] != 0) {
if (_vm->_dialogOptAddr[i] != nullptr) {
i++;
freeHSlot = i;
_flags->setFlagValue(Flags::VOICE_H_LINE, i);