Replace some NULLs with nullptr

This commit is contained in:
Thomas Edvalson
2014-04-20 15:40:59 -04:00
parent 7514e734eb
commit 0abe496457
2 changed files with 11 additions and 13 deletions
+4 -5
View File
@@ -1,4 +1,3 @@
#include <stddef.h>
#include <cpp3ds/Graphics/Actor.hpp>
#include <cpp3ds/Graphics/Stage.hpp>
@@ -7,10 +6,10 @@ namespace cpp3ds {
void Actor::addStage(Stage& stage){
StageNode *node = new StageNode();
node->stage = &stage;
node->next = NULL;
if (stageHead == NULL)
node->next = nullptr;
if (stageHead == nullptr)
stageHead = node;
if (stageTail != NULL)
if (stageTail != nullptr)
stageTail->next = node;
stageTail = node;
}
@@ -18,7 +17,7 @@ namespace cpp3ds {
void Actor::detach(){
// Remove this actor from all stages
StageNode* cur = stageHead;
while (cur != NULL) {
while (cur != nullptr) {
cur->stage->removeActor(*this);
cur = cur->next;
}
+7 -8
View File
@@ -1,4 +1,3 @@
#include <stddef.h>
#include <cpp3ds/Graphics/Stage.hpp>
#include <cpp3ds/Graphics/Actor.hpp>
#include <cpp3ds/Window/Input.hpp>
@@ -13,10 +12,10 @@ namespace cpp3ds {
ActorNode *node = new ActorNode();
node->actor = &actor;
node->prev = actorTail;
node->next = NULL;
if (actorHead == NULL)
node->next = nullptr;
if (actorHead == nullptr)
actorHead = node;
if (actorTail != NULL)
if (actorTail != nullptr)
actorTail->next = node;
actorTail = node;
actor.addStage(*this);
@@ -24,15 +23,15 @@ namespace cpp3ds {
void Stage::removeActor(Actor& actor){
ActorNode* cur = actorHead;
while (cur != NULL) {
while (cur != nullptr) {
if (cur->actor == &actor) {
if (cur == actorHead)
actorHead = cur->next;
if (cur == actorTail)
actorTail = cur->prev;
if (cur->prev != NULL)
if (cur->prev != nullptr)
cur->prev->next = cur->next;
if (cur->next != NULL)
if (cur->next != nullptr)
cur->next->prev = cur->prev;
delete cur;
break;
@@ -46,7 +45,7 @@ namespace cpp3ds {
ActorNode* cur = actorTail;
x += this->x;
y += this->y;
while (cur != NULL) {
while (cur != nullptr) {
Actor& actor = *cur->actor;
if (use3D) {
float slider = Input::get3DSlider() * actor.depth3d;