[Scummvm-git-logs] scummvm master -> 6c155c298ace72635da81550ed2b0608e1e59238
bluegr
noreply at scummvm.org
Sat Nov 28 21:58:18 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
6c155c298a NGI: BOX2D: Replace NULL with nullptr
Commit: 6c155c298ace72635da81550ed2b0608e1e59238
https://github.com/scummvm/scummvm/commit/6c155c298ace72635da81550ed2b0608e1e59238
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2026-11-28T23:57:53+02:00
Commit Message:
NGI: BOX2D: Replace NULL with nullptr
Changed paths:
engines/ngi/box2d/Collision/Shapes/b2ChainShape.cpp
engines/ngi/box2d/Collision/Shapes/b2ChainShape.h
engines/ngi/box2d/Collision/b2BroadPhase.h
engines/ngi/box2d/Collision/b2Distance.h
engines/ngi/box2d/Collision/b2DynamicTree.cpp
engines/ngi/box2d/Common/b2BlockAllocator.cpp
engines/ngi/box2d/Common/b2GrowableStack.h
engines/ngi/box2d/Common/b2StackAllocator.cpp
engines/ngi/box2d/Dynamics/Contacts/b2Contact.cpp
engines/ngi/box2d/Dynamics/Contacts/b2Contact.h
engines/ngi/box2d/Dynamics/Joints/b2GearJoint.h
engines/ngi/box2d/Dynamics/Joints/b2Joint.cpp
engines/ngi/box2d/Dynamics/Joints/b2Joint.h
engines/ngi/box2d/Dynamics/b2Body.cpp
engines/ngi/box2d/Dynamics/b2Body.h
engines/ngi/box2d/Dynamics/b2ContactManager.cpp
engines/ngi/box2d/Dynamics/b2Fixture.cpp
engines/ngi/box2d/Dynamics/b2Fixture.h
engines/ngi/box2d/Dynamics/b2Island.cpp
engines/ngi/box2d/Dynamics/b2World.cpp
engines/ngi/box2d/Dynamics/b2World.h
engines/ngi/box2d/Rope/b2Rope.cpp
diff --git a/engines/ngi/box2d/Collision/Shapes/b2ChainShape.cpp b/engines/ngi/box2d/Collision/Shapes/b2ChainShape.cpp
index fcba6d01d7f..672c79675a2 100644
--- a/engines/ngi/box2d/Collision/Shapes/b2ChainShape.cpp
+++ b/engines/ngi/box2d/Collision/Shapes/b2ChainShape.cpp
@@ -27,13 +27,13 @@ using namespace std;
b2ChainShape::~b2ChainShape()
{
b2Free(m_vertices);
- m_vertices = NULL;
+ m_vertices = nullptr;
m_count = 0;
}
void b2ChainShape::CreateLoop(const b2Vec2* vertices, int32 count)
{
- b2Assert(m_vertices == NULL && m_count == 0);
+ b2Assert(m_vertices == nullptr && m_count == 0);
b2Assert(count >= 3);
m_count = count + 1;
m_vertices = (b2Vec2*)b2Alloc(m_count * sizeof(b2Vec2));
@@ -47,7 +47,7 @@ void b2ChainShape::CreateLoop(const b2Vec2* vertices, int32 count)
void b2ChainShape::CreateChain(const b2Vec2* vertices, int32 count)
{
- b2Assert(m_vertices == NULL && m_count == 0);
+ b2Assert(m_vertices == nullptr && m_count == 0);
b2Assert(count >= 2);
m_count = count;
m_vertices = (b2Vec2*)b2Alloc(count * sizeof(b2Vec2));
diff --git a/engines/ngi/box2d/Collision/Shapes/b2ChainShape.h b/engines/ngi/box2d/Collision/Shapes/b2ChainShape.h
index a78e62cb0b2..e3fca30cd5e 100644
--- a/engines/ngi/box2d/Collision/Shapes/b2ChainShape.h
+++ b/engines/ngi/box2d/Collision/Shapes/b2ChainShape.h
@@ -95,10 +95,10 @@ inline b2ChainShape::b2ChainShape()
{
m_type = e_chain;
m_radius = b2_polygonRadius;
- m_vertices = NULL;
+ m_vertices = nullptr;
m_count = 0;
- m_hasPrevVertex = NULL;
- m_hasNextVertex = NULL;
+ m_hasPrevVertex = false;
+ m_hasNextVertex = false;
}
} // End of namespace NGI
diff --git a/engines/ngi/box2d/Collision/b2BroadPhase.h b/engines/ngi/box2d/Collision/b2BroadPhase.h
index a23ab5185d8..b0e97e2e5e1 100644
--- a/engines/ngi/box2d/Collision/b2BroadPhase.h
+++ b/engines/ngi/box2d/Collision/b2BroadPhase.h
@@ -65,7 +65,7 @@ public:
/// Get the fat AABB for a proxy.
const b2AABB& GetFatAABB(int32 proxyId) const;
- /// Get user data from a proxy. Returns NULL if the id is invalid.
+ /// Get user data from a proxy. Returns nullptr if the id is invalid.
void* GetUserData(int32 proxyId) const;
/// Test overlap of fat AABBs.
diff --git a/engines/ngi/box2d/Collision/b2Distance.h b/engines/ngi/box2d/Collision/b2Distance.h
index 407c4ee9385..bbcffe0b115 100644
--- a/engines/ngi/box2d/Collision/b2Distance.h
+++ b/engines/ngi/box2d/Collision/b2Distance.h
@@ -30,7 +30,7 @@ class b2Shape;
/// It encapsulates any shape.
struct b2DistanceProxy
{
- b2DistanceProxy() : m_vertices(NULL), m_count(0), m_radius(0.0f) {}
+ b2DistanceProxy() : m_vertices(nullptr), m_count(0), m_radius(0.0f) {}
/// Initialize the proxy using the given shape. The shape
/// must remain in scope while the proxy is in use.
diff --git a/engines/ngi/box2d/Collision/b2DynamicTree.cpp b/engines/ngi/box2d/Collision/b2DynamicTree.cpp
index 1339d6886f1..78ea9051304 100644
--- a/engines/ngi/box2d/Collision/b2DynamicTree.cpp
+++ b/engines/ngi/box2d/Collision/b2DynamicTree.cpp
@@ -88,7 +88,7 @@ int32 b2DynamicTree::AllocateNode()
m_nodes[nodeId].child1 = b2_nullNode;
m_nodes[nodeId].child2 = b2_nullNode;
m_nodes[nodeId].height = 0;
- m_nodes[nodeId].userData = NULL;
+ m_nodes[nodeId].userData = nullptr;
++m_nodeCount;
return nodeId;
}
@@ -266,7 +266,7 @@ void b2DynamicTree::InsertLeaf(int32 leaf)
int32 oldParent = m_nodes[sibling].parent;
int32 newParent = AllocateNode();
m_nodes[newParent].parent = oldParent;
- m_nodes[newParent].userData = NULL;
+ m_nodes[newParent].userData = nullptr;
m_nodes[newParent].aabb.Combine(leafAABB, m_nodes[sibling].aabb);
m_nodes[newParent].height = m_nodes[sibling].height + 1;
diff --git a/engines/ngi/box2d/Common/b2BlockAllocator.cpp b/engines/ngi/box2d/Common/b2BlockAllocator.cpp
index 0537d303c6e..a6f402d8420 100644
--- a/engines/ngi/box2d/Common/b2BlockAllocator.cpp
+++ b/engines/ngi/box2d/Common/b2BlockAllocator.cpp
@@ -101,7 +101,7 @@ b2BlockAllocator::~b2BlockAllocator()
void* b2BlockAllocator::Allocate(int32 size)
{
if (size == 0)
- return NULL;
+ return nullptr;
b2Assert(0 < size);
@@ -147,7 +147,7 @@ void* b2BlockAllocator::Allocate(int32 size)
block->next = next;
}
b2Block* last = (b2Block*)((int8*)chunk->blocks + blockSize * (blockCount - 1));
- last->next = NULL;
+ last->next = nullptr;
m_freeLists[index] = chunk->blocks->next;
++m_chunkCount;
diff --git a/engines/ngi/box2d/Common/b2GrowableStack.h b/engines/ngi/box2d/Common/b2GrowableStack.h
index 1cc3c26d446..c8baca28f17 100644
--- a/engines/ngi/box2d/Common/b2GrowableStack.h
+++ b/engines/ngi/box2d/Common/b2GrowableStack.h
@@ -42,7 +42,7 @@ public:
if (m_stack != m_array)
{
b2Free(m_stack);
- m_stack = NULL;
+ m_stack = nullptr;
}
}
diff --git a/engines/ngi/box2d/Common/b2StackAllocator.cpp b/engines/ngi/box2d/Common/b2StackAllocator.cpp
index 2ece9f2682d..126848d5bb2 100644
--- a/engines/ngi/box2d/Common/b2StackAllocator.cpp
+++ b/engines/ngi/box2d/Common/b2StackAllocator.cpp
@@ -76,7 +76,7 @@ void b2StackAllocator::Free(void* p)
m_allocation -= entry->size;
--m_entryCount;
- p = NULL;
+ p = nullptr;
}
int32 b2StackAllocator::GetMaxAllocation() const
diff --git a/engines/ngi/box2d/Dynamics/Contacts/b2Contact.cpp b/engines/ngi/box2d/Dynamics/Contacts/b2Contact.cpp
index f95c78775fa..f67fc6a9c55 100644
--- a/engines/ngi/box2d/Dynamics/Contacts/b2Contact.cpp
+++ b/engines/ngi/box2d/Dynamics/Contacts/b2Contact.cpp
@@ -96,7 +96,7 @@ b2Contact* b2Contact::Create(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtu
}
else
{
- return NULL;
+ return nullptr;
}
}
@@ -132,18 +132,18 @@ b2Contact::b2Contact(b2Fixture* fA, int32 indexA, b2Fixture* fB, int32 indexB)
m_manifold.pointCount = 0;
- m_prev = NULL;
- m_next = NULL;
+ m_prev = nullptr;
+ m_next = nullptr;
- m_nodeA.contact = NULL;
- m_nodeA.prev = NULL;
- m_nodeA.next = NULL;
- m_nodeA.other = NULL;
+ m_nodeA.contact = nullptr;
+ m_nodeA.prev = nullptr;
+ m_nodeA.next = nullptr;
+ m_nodeA.other = nullptr;
- m_nodeB.contact = NULL;
- m_nodeB.prev = NULL;
- m_nodeB.next = NULL;
- m_nodeB.other = NULL;
+ m_nodeB.contact = nullptr;
+ m_nodeB.prev = nullptr;
+ m_nodeB.next = nullptr;
+ m_nodeB.other = nullptr;
m_toiCount = 0;
diff --git a/engines/ngi/box2d/Dynamics/Contacts/b2Contact.h b/engines/ngi/box2d/Dynamics/Contacts/b2Contact.h
index a82f9808826..3ed57c6fe09 100644
--- a/engines/ngi/box2d/Dynamics/Contacts/b2Contact.h
+++ b/engines/ngi/box2d/Dynamics/Contacts/b2Contact.h
@@ -179,7 +179,7 @@ protected:
static void Destroy(b2Contact* contact, b2Shape::Type typeA, b2Shape::Type typeB, b2BlockAllocator* allocator);
static void Destroy(b2Contact* contact, b2BlockAllocator* allocator);
- b2Contact() : m_fixtureA(NULL), m_fixtureB(NULL) {}
+ b2Contact() : m_fixtureA(nullptr), m_fixtureB(nullptr) {}
b2Contact(b2Fixture* fixtureA, int32 indexA, b2Fixture* fixtureB, int32 indexB);
virtual ~b2Contact() {}
diff --git a/engines/ngi/box2d/Dynamics/Joints/b2GearJoint.h b/engines/ngi/box2d/Dynamics/Joints/b2GearJoint.h
index 77831004bb9..31439ff9ab9 100644
--- a/engines/ngi/box2d/Dynamics/Joints/b2GearJoint.h
+++ b/engines/ngi/box2d/Dynamics/Joints/b2GearJoint.h
@@ -30,8 +30,8 @@ struct b2GearJointDef : public b2JointDef
b2GearJointDef()
{
type = e_gearJoint;
- joint1 = NULL;
- joint2 = NULL;
+ joint1 = nullptr;
+ joint2 = nullptr;
ratio = 1.0f;
}
diff --git a/engines/ngi/box2d/Dynamics/Joints/b2Joint.cpp b/engines/ngi/box2d/Dynamics/Joints/b2Joint.cpp
index 0a9a4f64850..274a6e02396 100644
--- a/engines/ngi/box2d/Dynamics/Joints/b2Joint.cpp
+++ b/engines/ngi/box2d/Dynamics/Joints/b2Joint.cpp
@@ -37,7 +37,7 @@ namespace NGI {
b2Joint* b2Joint::Create(const b2JointDef* def, b2BlockAllocator* allocator)
{
- b2Joint* joint = NULL;
+ b2Joint* joint = nullptr;
switch (def->type)
{
@@ -175,8 +175,8 @@ b2Joint::b2Joint(const b2JointDef* def)
b2Assert(def->bodyA != def->bodyB);
m_type = def->type;
- m_prev = NULL;
- m_next = NULL;
+ m_prev = nullptr;
+ m_next = nullptr;
m_bodyA = def->bodyA;
m_bodyB = def->bodyB;
m_index = 0;
@@ -184,15 +184,15 @@ b2Joint::b2Joint(const b2JointDef* def)
m_islandFlag = false;
m_userData = def->userData;
- m_edgeA.joint = NULL;
- m_edgeA.other = NULL;
- m_edgeA.prev = NULL;
- m_edgeA.next = NULL;
+ m_edgeA.joint = nullptr;
+ m_edgeA.other = nullptr;
+ m_edgeA.prev = nullptr;
+ m_edgeA.next = nullptr;
- m_edgeB.joint = NULL;
- m_edgeB.other = NULL;
- m_edgeB.prev = NULL;
- m_edgeB.next = NULL;
+ m_edgeB.joint = nullptr;
+ m_edgeB.other = nullptr;
+ m_edgeB.prev = nullptr;
+ m_edgeB.next = nullptr;
}
bool b2Joint::IsActive() const
diff --git a/engines/ngi/box2d/Dynamics/Joints/b2Joint.h b/engines/ngi/box2d/Dynamics/Joints/b2Joint.h
index 56f560a71be..923a6e8a6d3 100644
--- a/engines/ngi/box2d/Dynamics/Joints/b2Joint.h
+++ b/engines/ngi/box2d/Dynamics/Joints/b2Joint.h
@@ -77,9 +77,9 @@ struct b2JointDef
b2JointDef()
{
type = e_unknownJoint;
- userData = NULL;
- bodyA = NULL;
- bodyB = NULL;
+ userData = nullptr;
+ bodyA = nullptr;
+ bodyB = nullptr;
collideConnected = false;
}
diff --git a/engines/ngi/box2d/Dynamics/b2Body.cpp b/engines/ngi/box2d/Dynamics/b2Body.cpp
index d021d98b7ec..409397f1716 100644
--- a/engines/ngi/box2d/Dynamics/b2Body.cpp
+++ b/engines/ngi/box2d/Dynamics/b2Body.cpp
@@ -68,10 +68,10 @@ b2Body::b2Body(const b2BodyDef* bd, b2World* world)
m_sweep.a = bd->angle;
m_sweep.alpha0 = 0.0f;
- m_jointList = NULL;
- m_contactList = NULL;
- m_prev = NULL;
- m_next = NULL;
+ m_jointList = nullptr;
+ m_contactList = nullptr;
+ m_prev = nullptr;
+ m_next = nullptr;
m_linearVelocity = bd->linearVelocity;
m_angularVelocity = bd->angularVelocity;
@@ -103,7 +103,7 @@ b2Body::b2Body(const b2BodyDef* bd, b2World* world)
m_userData = bd->userData;
- m_fixtureList = NULL;
+ m_fixtureList = nullptr;
m_fixtureCount = 0;
}
@@ -155,7 +155,7 @@ b2Fixture* b2Body::CreateFixture(const b2FixtureDef* def)
b2Assert(m_world->IsLocked() == false);
if (m_world->IsLocked() == true)
{
- return NULL;
+ return nullptr;
}
b2BlockAllocator* allocator = &m_world->m_blockAllocator;
@@ -212,7 +212,7 @@ void b2Body::DestroyFixture(b2Fixture* fixture)
b2Assert(m_fixtureCount > 0);
b2Fixture** node = &m_fixtureList;
bool found = false;
- while (*node != NULL)
+ while (*node != nullptr)
{
if (*node == fixture)
{
@@ -254,8 +254,8 @@ void b2Body::DestroyFixture(b2Fixture* fixture)
}
fixture->Destroy(allocator);
- fixture->m_body = NULL;
- fixture->m_next = NULL;
+ fixture->m_body = nullptr;
+ fixture->m_next = nullptr;
fixture->~b2Fixture();
allocator->Free(fixture, sizeof(b2Fixture));
@@ -481,7 +481,7 @@ void b2Body::SetActive(bool flag)
ce = ce->next;
m_world->m_contactManager.Destroy(ce0->contact);
}
- m_contactList = NULL;
+ m_contactList = nullptr;
}
}
diff --git a/engines/ngi/box2d/Dynamics/b2Body.h b/engines/ngi/box2d/Dynamics/b2Body.h
index ee732c24b8e..6124886318d 100644
--- a/engines/ngi/box2d/Dynamics/b2Body.h
+++ b/engines/ngi/box2d/Dynamics/b2Body.h
@@ -55,7 +55,7 @@ struct b2BodyDef
/// This constructor sets the body definition default values.
b2BodyDef()
{
- userData = NULL;
+ userData = nullptr;
position.Set(0.0f, 0.0f);
angle = 0.0f;
linearVelocity.Set(0.0f, 0.0f);
diff --git a/engines/ngi/box2d/Dynamics/b2ContactManager.cpp b/engines/ngi/box2d/Dynamics/b2ContactManager.cpp
index 5d00dfd399d..a0f049169ad 100644
--- a/engines/ngi/box2d/Dynamics/b2ContactManager.cpp
+++ b/engines/ngi/box2d/Dynamics/b2ContactManager.cpp
@@ -26,11 +26,11 @@ namespace NGI {
b2ContactManager::b2ContactManager()
{
- m_contactList = NULL;
+ m_contactList = nullptr;
m_contactCount = 0;
m_contactFilter = &m_defaultFilter;
m_contactListener = &m_defaultListener;
- m_allocator = NULL;
+ m_allocator = nullptr;
}
void b2ContactManager::Destroy(b2Contact* c)
@@ -236,7 +236,7 @@ void b2ContactManager::AddPair(void* proxyUserDataA, void* proxyUserDataB)
// Call the factory.
b2Contact* c = b2Contact::Create(fixtureA, indexA, fixtureB, indexB, m_allocator);
- if (c == NULL)
+ if (c == nullptr)
{
return;
}
@@ -250,9 +250,9 @@ void b2ContactManager::AddPair(void* proxyUserDataA, void* proxyUserDataB)
bodyB = fixtureB->GetBody();
// Insert into the world.
- c->m_prev = NULL;
+ c->m_prev = nullptr;
c->m_next = m_contactList;
- if (m_contactList != NULL)
+ if (m_contactList != nullptr)
{
m_contactList->m_prev = c;
}
@@ -264,9 +264,9 @@ void b2ContactManager::AddPair(void* proxyUserDataA, void* proxyUserDataB)
c->m_nodeA.contact = c;
c->m_nodeA.other = bodyB;
- c->m_nodeA.prev = NULL;
+ c->m_nodeA.prev = nullptr;
c->m_nodeA.next = bodyA->m_contactList;
- if (bodyA->m_contactList != NULL)
+ if (bodyA->m_contactList != nullptr)
{
bodyA->m_contactList->prev = &c->m_nodeA;
}
@@ -276,9 +276,9 @@ void b2ContactManager::AddPair(void* proxyUserDataA, void* proxyUserDataB)
c->m_nodeB.contact = c;
c->m_nodeB.other = bodyA;
- c->m_nodeB.prev = NULL;
+ c->m_nodeB.prev = nullptr;
c->m_nodeB.next = bodyB->m_contactList;
- if (bodyB->m_contactList != NULL)
+ if (bodyB->m_contactList != nullptr)
{
bodyB->m_contactList->prev = &c->m_nodeB;
}
diff --git a/engines/ngi/box2d/Dynamics/b2Fixture.cpp b/engines/ngi/box2d/Dynamics/b2Fixture.cpp
index 7f292442926..1a51c77b193 100644
--- a/engines/ngi/box2d/Dynamics/b2Fixture.cpp
+++ b/engines/ngi/box2d/Dynamics/b2Fixture.cpp
@@ -31,12 +31,12 @@ namespace NGI {
b2Fixture::b2Fixture()
{
- m_userData = NULL;
- m_body = NULL;
- m_next = NULL;
- m_proxies = NULL;
+ m_userData = nullptr;
+ m_body = nullptr;
+ m_next = nullptr;
+ m_proxies = nullptr;
m_proxyCount = 0;
- m_shape = NULL;
+ m_shape = nullptr;
m_density = 0.0f;
}
@@ -47,7 +47,7 @@ void b2Fixture::Create(b2BlockAllocator* allocator, b2Body* body, const b2Fixtur
m_restitution = def->restitution;
m_body = body;
- m_next = NULL;
+ m_next = nullptr;
m_filter = def->filter;
@@ -60,7 +60,7 @@ void b2Fixture::Create(b2BlockAllocator* allocator, b2Body* body, const b2Fixtur
m_proxies = (b2FixtureProxy*)allocator->Allocate(childCount * sizeof(b2FixtureProxy));
for (int32 i = 0; i < childCount; ++i)
{
- m_proxies[i].fixture = NULL;
+ m_proxies[i].fixture = nullptr;
m_proxies[i].proxyId = b2BroadPhase::e_nullProxy;
}
m_proxyCount = 0;
@@ -76,7 +76,7 @@ void b2Fixture::Destroy(b2BlockAllocator* allocator)
// Free the proxy array.
int32 childCount = m_shape->GetChildCount();
allocator->Free(m_proxies, childCount * sizeof(b2FixtureProxy));
- m_proxies = NULL;
+ m_proxies = nullptr;
// Free the child shape.
switch (m_shape->m_type)
@@ -118,7 +118,7 @@ void b2Fixture::Destroy(b2BlockAllocator* allocator)
break;
}
- m_shape = NULL;
+ m_shape = nullptr;
}
void b2Fixture::CreateProxies(b2BroadPhase* broadPhase, const b2Transform& xf)
@@ -184,7 +184,7 @@ void b2Fixture::SetFilterData(const b2Filter& filter)
void b2Fixture::Refilter()
{
- if (m_body == NULL)
+ if (m_body == nullptr)
{
return;
}
@@ -206,7 +206,7 @@ void b2Fixture::Refilter()
b2World* world = m_body->GetWorld();
- if (world == NULL)
+ if (world == nullptr)
{
return;
}
diff --git a/engines/ngi/box2d/Dynamics/b2Fixture.h b/engines/ngi/box2d/Dynamics/b2Fixture.h
index 7e20c6a3e07..1bcf3e8f190 100644
--- a/engines/ngi/box2d/Dynamics/b2Fixture.h
+++ b/engines/ngi/box2d/Dynamics/b2Fixture.h
@@ -60,8 +60,8 @@ struct b2FixtureDef
/// The constructor sets the default fixture definition values.
b2FixtureDef()
{
- shape = NULL;
- userData = NULL;
+ shape = nullptr;
+ userData = nullptr;
friction = 0.2f;
restitution = 0.0f;
density = 0.0f;
@@ -137,7 +137,7 @@ public:
/// Call this if you want to establish collision that was previously disabled by b2ContactFilter::ShouldCollide.
void Refilter();
- /// Get the parent body of this fixture. This is NULL if the fixture is not attached.
+ /// Get the parent body of this fixture. This is nullptr if the fixture is not attached.
/// @return the parent body.
b2Body* GetBody();
const b2Body* GetBody() const;
diff --git a/engines/ngi/box2d/Dynamics/b2Island.cpp b/engines/ngi/box2d/Dynamics/b2Island.cpp
index e274d0a8786..232c671815d 100644
--- a/engines/ngi/box2d/Dynamics/b2Island.cpp
+++ b/engines/ngi/box2d/Dynamics/b2Island.cpp
@@ -517,7 +517,7 @@ void b2Island::SolveTOI(const b2TimeStep& subStep, int32 toiIndexA, int32 toiInd
void b2Island::Report(const b2ContactVelocityConstraint* constraints)
{
- if (m_listener == NULL)
+ if (m_listener == nullptr)
{
return;
}
diff --git a/engines/ngi/box2d/Dynamics/b2World.cpp b/engines/ngi/box2d/Dynamics/b2World.cpp
index a6149858234..11fdc9e2b83 100644
--- a/engines/ngi/box2d/Dynamics/b2World.cpp
+++ b/engines/ngi/box2d/Dynamics/b2World.cpp
@@ -38,11 +38,11 @@ namespace NGI {
b2World::b2World(const b2Vec2& gravity)
{
- m_destructionListener = NULL;
- m_debugDraw = NULL;
+ m_destructionListener = nullptr;
+ m_debugDraw = nullptr;
- m_bodyList = NULL;
- m_jointList = NULL;
+ m_bodyList = nullptr;
+ m_jointList = nullptr;
m_bodyCount = 0;
m_jointCount = 0;
@@ -111,14 +111,14 @@ b2Body* b2World::CreateBody(const b2BodyDef* def)
b2Assert(IsLocked() == false);
if (IsLocked())
{
- return NULL;
+ return nullptr;
}
void* mem = m_blockAllocator.Allocate(sizeof(b2Body));
b2Body* b = new (mem) b2Body(def, this);
// Add to world doubly linked list.
- b->m_prev = NULL;
+ b->m_prev = nullptr;
b->m_next = m_bodyList;
if (m_bodyList)
{
@@ -155,7 +155,7 @@ void b2World::DestroyBody(b2Body* b)
b->m_jointList = je;
}
- b->m_jointList = NULL;
+ b->m_jointList = nullptr;
// Delete the attached contacts.
b2ContactEdge* ce = b->m_contactList;
@@ -165,7 +165,7 @@ void b2World::DestroyBody(b2Body* b)
ce = ce->next;
m_contactManager.Destroy(ce0->contact);
}
- b->m_contactList = NULL;
+ b->m_contactList = nullptr;
// Delete the attached fixtures. This destroys broad-phase proxies.
b2Fixture* f = b->m_fixtureList;
@@ -187,7 +187,7 @@ void b2World::DestroyBody(b2Body* b)
b->m_fixtureList = f;
b->m_fixtureCount -= 1;
}
- b->m_fixtureList = NULL;
+ b->m_fixtureList = nullptr;
b->m_fixtureCount = 0;
// Remove world body list.
@@ -216,13 +216,13 @@ b2Joint* b2World::CreateJoint(const b2JointDef* def)
b2Assert(IsLocked() == false);
if (IsLocked())
{
- return NULL;
+ return nullptr;
}
b2Joint* j = b2Joint::Create(def, &m_blockAllocator);
// Connect to the world list.
- j->m_prev = NULL;
+ j->m_prev = nullptr;
j->m_next = m_jointList;
if (m_jointList)
{
@@ -234,14 +234,14 @@ b2Joint* b2World::CreateJoint(const b2JointDef* def)
// Connect to the bodies' doubly linked lists.
j->m_edgeA.joint = j;
j->m_edgeA.other = j->m_bodyB;
- j->m_edgeA.prev = NULL;
+ j->m_edgeA.prev = nullptr;
j->m_edgeA.next = j->m_bodyA->m_jointList;
if (j->m_bodyA->m_jointList) j->m_bodyA->m_jointList->prev = &j->m_edgeA;
j->m_bodyA->m_jointList = &j->m_edgeA;
j->m_edgeB.joint = j;
j->m_edgeB.other = j->m_bodyA;
- j->m_edgeB.prev = NULL;
+ j->m_edgeB.prev = nullptr;
j->m_edgeB.next = j->m_bodyB->m_jointList;
if (j->m_bodyB->m_jointList) j->m_bodyB->m_jointList->prev = &j->m_edgeB;
j->m_bodyB->m_jointList = &j->m_edgeB;
@@ -321,8 +321,8 @@ void b2World::DestroyJoint(b2Joint* j)
bodyA->m_jointList = j->m_edgeA.next;
}
- j->m_edgeA.prev = NULL;
- j->m_edgeA.next = NULL;
+ j->m_edgeA.prev = nullptr;
+ j->m_edgeA.next = nullptr;
// Remove from body 2
if (j->m_edgeB.prev)
@@ -340,8 +340,8 @@ void b2World::DestroyJoint(b2Joint* j)
bodyB->m_jointList = j->m_edgeB.next;
}
- j->m_edgeB.prev = NULL;
- j->m_edgeB.next = NULL;
+ j->m_edgeB.prev = nullptr;
+ j->m_edgeB.next = nullptr;
b2Joint::Destroy(j, &m_blockAllocator);
@@ -601,7 +601,7 @@ void b2World::SolveTOI(const b2TimeStep& step)
for (;;)
{
// Find the first TOI.
- b2Contact* minContact = NULL;
+ b2Contact* minContact = nullptr;
float32 minAlpha = 1.0f;
for (b2Contact* c = m_contactManager.m_contactList; c; c = c->m_next)
@@ -714,7 +714,7 @@ void b2World::SolveTOI(const b2TimeStep& step)
}
}
- if (minContact == NULL || 1.0f - 10.0f * b2_epsilon < minAlpha)
+ if (minContact == nullptr || 1.0f - 10.0f * b2_epsilon < minAlpha)
{
// No more TOI events. Done!
m_stepComplete = true;
@@ -1136,7 +1136,7 @@ void b2World::DrawJoint(b2Joint* joint)
void b2World::DrawDebugData()
{
- if (m_debugDraw == NULL)
+ if (m_debugDraw == nullptr)
{
return;
}
@@ -1313,8 +1313,8 @@ void b2World::Dump()
b2Log("b2Free(joints);\n");
b2Log("b2Free(bodies);\n");
- b2Log("joints = NULL;\n");
- b2Log("bodies = NULL;\n");
+ b2Log("joints = nullptr;\n");
+ b2Log("bodies = nullptr;\n");
}
} // End of namespace NGI
diff --git a/engines/ngi/box2d/Dynamics/b2World.h b/engines/ngi/box2d/Dynamics/b2World.h
index d3aaf33beae..fa5a0cb53c7 100644
--- a/engines/ngi/box2d/Dynamics/b2World.h
+++ b/engines/ngi/box2d/Dynamics/b2World.h
@@ -124,19 +124,19 @@ public:
void RayCast(b2RayCastCallback* callback, const b2Vec2& point1, const b2Vec2& point2) const;
/// Get the world body list. With the returned body, use b2Body::GetNext to get
- /// the next body in the world list. A NULL body indicates the end of the list.
+ /// the next body in the world list. A nullptr body indicates the end of the list.
/// @return the head of the world body list.
b2Body* GetBodyList();
const b2Body* GetBodyList() const;
/// Get the world joint list. With the returned joint, use b2Joint::GetNext to get
- /// the next joint in the world list. A NULL joint indicates the end of the list.
+ /// the next joint in the world list. A nullptr joint indicates the end of the list.
/// @return the head of the world joint list.
b2Joint* GetJointList();
const b2Joint* GetJointList() const;
/// Get the world contact list. With the returned contact, use b2Contact::GetNext to get
- /// the next contact in the world list. A NULL contact indicates the end of the list.
+ /// the next contact in the world list. A nullptr contact indicates the end of the list.
/// @return the head of the world contact list.
/// @warning contacts are created and destroyed in the middle of a time step.
/// Use b2ContactListener to avoid missing contacts.
diff --git a/engines/ngi/box2d/Rope/b2Rope.cpp b/engines/ngi/box2d/Rope/b2Rope.cpp
index 119566b8c19..edd2c6d7f39 100644
--- a/engines/ngi/box2d/Rope/b2Rope.cpp
+++ b/engines/ngi/box2d/Rope/b2Rope.cpp
@@ -24,12 +24,12 @@ namespace NGI {
b2Rope::b2Rope()
{
m_count = 0;
- m_ps = NULL;
- m_p0s = NULL;
- m_vs = NULL;
- m_ims = NULL;
- m_Ls = NULL;
- m_as = NULL;
+ m_ps = nullptr;
+ m_p0s = nullptr;
+ m_vs = nullptr;
+ m_ims = nullptr;
+ m_Ls = nullptr;
+ m_as = nullptr;
m_gravity.SetZero();
m_k2 = 1.0f;
m_k3 = 0.1f;
More information about the Scummvm-git-logs
mailing list