From 942b63b48d15520df48420bdd7cff21eb055a40a Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Thu, 19 May 2016 22:47:19 +0200 Subject: [PATCH] Replace NULL pointer by nullptr --- src/engine/ContactSolver.cpp | 4 ++-- testbed/common/Box.cpp | 6 +++--- testbed/common/Capsule.cpp | 8 ++++---- testbed/common/ConcaveMesh.cpp | 8 ++++---- testbed/common/Cone.cpp | 8 ++++---- testbed/common/ConvexMesh.cpp | 8 ++++---- testbed/common/Cylinder.cpp | 8 ++++---- 7 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/engine/ContactSolver.cpp b/src/engine/ContactSolver.cpp index dcc29bc9..f2ee0ef2 100644 --- a/src/engine/ContactSolver.cpp +++ b/src/engine/ContactSolver.cpp @@ -906,8 +906,8 @@ void ContactSolver::computeFrictionVectors(const Vector3& deltaVelocity, // Clean up the constraint solver void ContactSolver::cleanup() { - if (mContactConstraints != NULL) { + if (mContactConstraints != nullptr) { delete[] mContactConstraints; - mContactConstraints = NULL; + mContactConstraints = nullptr; } } diff --git a/testbed/common/Box.cpp b/testbed/common/Box.cpp index ff6ab12c..549b86bb 100644 --- a/testbed/common/Box.cpp +++ b/testbed/common/Box.cpp @@ -257,12 +257,12 @@ void Box::render(openglframework::Shader& shader, GLint vertexNormalLoc = shader.getAttribLocation("vertexNormal", false); glEnableVertexAttribArray(vertexPositionLoc); - glVertexAttribPointer(vertexPositionLoc, 3, GL_FLOAT, GL_FALSE, 0, NULL); + glVertexAttribPointer(vertexPositionLoc, 3, GL_FLOAT, GL_FALSE, 0, nullptr); mVBONormals.bind(); if (vertexNormalLoc != -1) glEnableVertexAttribArray(vertexNormalLoc); - if (vertexNormalLoc != -1) glVertexAttribPointer(vertexNormalLoc, 3, GL_FLOAT, GL_FALSE, 0, NULL); + if (vertexNormalLoc != -1) glVertexAttribPointer(vertexNormalLoc, 3, GL_FLOAT, GL_FALSE, 0, nullptr); // Draw the geometry of the box glDrawArrays(GL_TRIANGLES, 0, 36); @@ -321,7 +321,7 @@ void Box::resetTransform(const rp3d::Transform& transform) { // Reset the velocity of the rigid body rp3d::RigidBody* rigidBody = dynamic_cast(mBody); - if (rigidBody != NULL) { + if (rigidBody != nullptr) { rigidBody->setLinearVelocity(rp3d::Vector3(0, 0, 0)); rigidBody->setAngularVelocity(rp3d::Vector3(0, 0, 0)); } diff --git a/testbed/common/Capsule.cpp b/testbed/common/Capsule.cpp index a953fcfc..7b83f6b3 100644 --- a/testbed/common/Capsule.cpp +++ b/testbed/common/Capsule.cpp @@ -183,16 +183,16 @@ void Capsule::render(openglframework::Shader& shader, GLint vertexNormalLoc = shader.getAttribLocation("vertexNormal", false); glEnableVertexAttribArray(vertexPositionLoc); - glVertexAttribPointer(vertexPositionLoc, 3, GL_FLOAT, GL_FALSE, 0, (char*)NULL); + glVertexAttribPointer(vertexPositionLoc, 3, GL_FLOAT, GL_FALSE, 0, (char*)nullptr); mVBONormals.bind(); - if (vertexNormalLoc != -1) glVertexAttribPointer(vertexNormalLoc, 3, GL_FLOAT, GL_FALSE, 0, (char*)NULL); + if (vertexNormalLoc != -1) glVertexAttribPointer(vertexNormalLoc, 3, GL_FLOAT, GL_FALSE, 0, (char*)nullptr); if (vertexNormalLoc != -1) glEnableVertexAttribArray(vertexNormalLoc); // For each part of the mesh for (unsigned int i=0; i(mBody); - if (rigidBody != NULL) { + if (rigidBody != nullptr) { rigidBody->setLinearVelocity(rp3d::Vector3(0, 0, 0)); rigidBody->setAngularVelocity(rp3d::Vector3(0, 0, 0)); } diff --git a/testbed/common/ConcaveMesh.cpp b/testbed/common/ConcaveMesh.cpp index 26a27920..0f8d7cb1 100644 --- a/testbed/common/ConcaveMesh.cpp +++ b/testbed/common/ConcaveMesh.cpp @@ -196,16 +196,16 @@ void ConcaveMesh::render(openglframework::Shader& shader, GLint vertexNormalLoc = shader.getAttribLocation("vertexNormal", false); glEnableVertexAttribArray(vertexPositionLoc); - glVertexAttribPointer(vertexPositionLoc, 3, GL_FLOAT, GL_FALSE, 0, (char*)NULL); + glVertexAttribPointer(vertexPositionLoc, 3, GL_FLOAT, GL_FALSE, 0, (char*)nullptr); mVBONormals.bind(); - if (vertexNormalLoc != -1) glVertexAttribPointer(vertexNormalLoc, 3, GL_FLOAT, GL_FALSE, 0, (char*)NULL); + if (vertexNormalLoc != -1) glVertexAttribPointer(vertexNormalLoc, 3, GL_FLOAT, GL_FALSE, 0, (char*)nullptr); if (vertexNormalLoc != -1) glEnableVertexAttribArray(vertexNormalLoc); // For each part of the mesh for (unsigned int i=0; i(mBody); - if (rigidBody != NULL) { + if (rigidBody != nullptr) { rigidBody->setLinearVelocity(rp3d::Vector3(0, 0, 0)); rigidBody->setAngularVelocity(rp3d::Vector3(0, 0, 0)); } diff --git a/testbed/common/Cone.cpp b/testbed/common/Cone.cpp index ca8d9ee8..1a971922 100644 --- a/testbed/common/Cone.cpp +++ b/testbed/common/Cone.cpp @@ -180,16 +180,16 @@ void Cone::render(openglframework::Shader& shader, GLint vertexNormalLoc = shader.getAttribLocation("vertexNormal", false); glEnableVertexAttribArray(vertexPositionLoc); - glVertexAttribPointer(vertexPositionLoc, 3, GL_FLOAT, GL_FALSE, 0, (char*)NULL); + glVertexAttribPointer(vertexPositionLoc, 3, GL_FLOAT, GL_FALSE, 0, (char*)nullptr); mVBONormals.bind(); - if (vertexNormalLoc != -1) glVertexAttribPointer(vertexNormalLoc, 3, GL_FLOAT, GL_FALSE, 0, (char*)NULL); + if (vertexNormalLoc != -1) glVertexAttribPointer(vertexNormalLoc, 3, GL_FLOAT, GL_FALSE, 0, (char*)nullptr); if (vertexNormalLoc != -1) glEnableVertexAttribArray(vertexNormalLoc); // For each part of the mesh for (unsigned int i=0; i(mBody); - if (rigidBody != NULL) { + if (rigidBody != nullptr) { rigidBody->setLinearVelocity(rp3d::Vector3(0, 0, 0)); rigidBody->setAngularVelocity(rp3d::Vector3(0, 0, 0)); } diff --git a/testbed/common/ConvexMesh.cpp b/testbed/common/ConvexMesh.cpp index 2c6d4368..ffdbca04 100644 --- a/testbed/common/ConvexMesh.cpp +++ b/testbed/common/ConvexMesh.cpp @@ -177,16 +177,16 @@ void ConvexMesh::render(openglframework::Shader& shader, GLint vertexNormalLoc = shader.getAttribLocation("vertexNormal", false); glEnableVertexAttribArray(vertexPositionLoc); - glVertexAttribPointer(vertexPositionLoc, 3, GL_FLOAT, GL_FALSE, 0, (char*)NULL); + glVertexAttribPointer(vertexPositionLoc, 3, GL_FLOAT, GL_FALSE, 0, (char*)nullptr); mVBONormals.bind(); - if (vertexNormalLoc != -1) glVertexAttribPointer(vertexNormalLoc, 3, GL_FLOAT, GL_FALSE, 0, (char*)NULL); + if (vertexNormalLoc != -1) glVertexAttribPointer(vertexNormalLoc, 3, GL_FLOAT, GL_FALSE, 0, (char*)nullptr); if (vertexNormalLoc != -1) glEnableVertexAttribArray(vertexNormalLoc); // For each part of the mesh for (unsigned int i=0; i(mBody); - if (rigidBody != NULL) { + if (rigidBody != nullptr) { rigidBody->setLinearVelocity(rp3d::Vector3(0, 0, 0)); rigidBody->setAngularVelocity(rp3d::Vector3(0, 0, 0)); } diff --git a/testbed/common/Cylinder.cpp b/testbed/common/Cylinder.cpp index 188cdd57..f791317b 100644 --- a/testbed/common/Cylinder.cpp +++ b/testbed/common/Cylinder.cpp @@ -181,16 +181,16 @@ void Cylinder::render(openglframework::Shader& shader, GLint vertexNormalLoc = shader.getAttribLocation("vertexNormal", false); glEnableVertexAttribArray(vertexPositionLoc); - glVertexAttribPointer(vertexPositionLoc, 3, GL_FLOAT, GL_FALSE, 0, (char*)NULL); + glVertexAttribPointer(vertexPositionLoc, 3, GL_FLOAT, GL_FALSE, 0, (char*)nullptr); mVBONormals.bind(); - if (vertexNormalLoc != -1) glVertexAttribPointer(vertexNormalLoc, 3, GL_FLOAT, GL_FALSE, 0, (char*)NULL); + if (vertexNormalLoc != -1) glVertexAttribPointer(vertexNormalLoc, 3, GL_FLOAT, GL_FALSE, 0, (char*)nullptr); if (vertexNormalLoc != -1) glEnableVertexAttribArray(vertexNormalLoc); // For each part of the mesh for (unsigned int i=0; i(mBody); - if (rigidBody != NULL) { + if (rigidBody != nullptr) { rigidBody->setLinearVelocity(rp3d::Vector3(0, 0, 0)); rigidBody->setAngularVelocity(rp3d::Vector3(0, 0, 0)); }