C++11: modernize use nullptr (replaces NULL or 0)

This commit is contained in:
wmayer
2021-11-05 18:16:19 +01:00
parent ef598dd1e3
commit 3dcbceda3a
36 changed files with 247 additions and 258 deletions

View File

@@ -4,13 +4,13 @@
#include "KeyboardP.h"
using namespace SIM::Coin3D::Quarter;
QuarterP::StateCursorMap * QuarterP::statecursormap = NULL;
QuarterP::StateCursorMap * QuarterP::statecursormap = nullptr;
QuarterP::QuarterP(void)
QuarterP::QuarterP()
{
this->sensormanager = new SensorManager;
this->imagereader = new ImageReader;
assert(QuarterP::statecursormap == NULL);
assert(QuarterP::statecursormap == nullptr);
QuarterP::statecursormap = new StateCursorMap;
}
@@ -20,17 +20,17 @@ QuarterP::~QuarterP()
delete this->imagereader;
delete this->sensormanager;
assert(QuarterP::statecursormap != NULL);
assert(QuarterP::statecursormap != nullptr);
delete QuarterP::statecursormap;
// FIXME: Why not use an atexit mechanism for this?
if (KeyboardP::keyboardmap != NULL) {
if (KeyboardP::keyboardmap != nullptr) {
KeyboardP::keyboardmap->clear();
KeyboardP::keypadmap->clear();
delete KeyboardP::keyboardmap;
delete KeyboardP::keypadmap;
KeyboardP::keyboardmap = NULL;
KeyboardP::keypadmap = NULL;
KeyboardP::keyboardmap = nullptr;
KeyboardP::keypadmap = nullptr;
}