mirror of
https://github.com/SWG-Source/src.git
synced 2026-07-29 23:15:56 -04:00
newer standards prefer nullptr over NULL - this is most of them but there are others too
This commit is contained in:
@@ -245,7 +245,7 @@ void DataTableTool::createOutputDirectoryForFile(const std::string & fileName)
|
||||
|
||||
std::string directoryName(fileName, 0, slashPos);
|
||||
#if defined(PLATFORM_WIN32)
|
||||
int result = CreateDirectory(directoryName.c_str(), NULL);
|
||||
int result = CreateDirectory(directoryName.c_str(), nullptr);
|
||||
#elif defined(PLATFORM_LINUX)
|
||||
// make sure slashes are forward
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ static const int SUBMIT_NO_FILE_ERR = 17; // need to add file before submitting
|
||||
// virtual ~MyPerforceUser() {}
|
||||
// virtual void HandleError( Error *err )
|
||||
// {
|
||||
// if (err != NULL && err->Test())
|
||||
// if (err != nullptr && err->Test())
|
||||
// {
|
||||
// m_errorOccurred = true;
|
||||
// m_lastError = err->GetGeneric();
|
||||
@@ -154,7 +154,7 @@ int generateTemplate(File &definitionFp, File &templateFp)
|
||||
|
||||
// we now need to move down the template definition heiarchy and write the
|
||||
// parameters of the base class
|
||||
Filename basename(NULL, definitionFp.getFilename().getPath().c_str(),
|
||||
Filename basename(nullptr, definitionFp.getFilename().getPath().c_str(),
|
||||
TemplateDefinitionFile.getBaseFilename().c_str(), TEMPLATE_DEFINITION_EXTENSION);
|
||||
if (basename.getName().size() == 0)
|
||||
return 0;
|
||||
@@ -185,8 +185,8 @@ int generateTemplate(File &definitionFp, File &templateFp)
|
||||
int generateTemplate(const char *definitionFile, const char *templateFile)
|
||||
{
|
||||
// check filename extensions
|
||||
Filename defFile(NULL, NULL, definitionFile, TEMPLATE_DEFINITION_EXTENSION);
|
||||
Filename temFile(NULL, NULL, templateFile, TEMPLATE_EXTENSION);
|
||||
Filename defFile(nullptr, nullptr, definitionFile, TEMPLATE_DEFINITION_EXTENSION);
|
||||
Filename temFile(nullptr, nullptr, templateFile, TEMPLATE_EXTENSION);
|
||||
|
||||
File definitionFp;
|
||||
int i = 0;
|
||||
@@ -231,8 +231,8 @@ int generateTemplate(const char *definitionFile, const char *templateFile)
|
||||
int deriveTemplate(const char *baseFile, const char *templateFile)
|
||||
{
|
||||
// check filename extensions
|
||||
Filename basFile(NULL, NULL, baseFile, TEMPLATE_EXTENSION);
|
||||
Filename temFile(NULL, NULL, templateFile, TEMPLATE_EXTENSION);
|
||||
Filename basFile(nullptr, nullptr, baseFile, TEMPLATE_EXTENSION);
|
||||
Filename temFile(nullptr, nullptr, templateFile, TEMPLATE_EXTENSION);
|
||||
|
||||
File basFp;
|
||||
if (!basFp.open(basFile, "rt"))
|
||||
@@ -263,7 +263,7 @@ int compileTemplate(const char *filename)
|
||||
{
|
||||
TpfFile templateFile;
|
||||
|
||||
Filename templateFileName(NULL, NULL, filename, TEMPLATE_EXTENSION);
|
||||
Filename templateFileName(nullptr, nullptr, filename, TEMPLATE_EXTENSION);
|
||||
return templateFile.makeIffFiles(templateFileName);
|
||||
} // compileTemplate
|
||||
|
||||
@@ -279,7 +279,7 @@ int verifyTemplate(const char *filename)
|
||||
TpfFile templateFile;
|
||||
|
||||
printf("Verifying %s: ", filename);
|
||||
Filename templateFileName(NULL, NULL, filename, TEMPLATE_EXTENSION);
|
||||
Filename templateFileName(nullptr, nullptr, filename, TEMPLATE_EXTENSION);
|
||||
int result = templateFile.loadTemplate(templateFileName);
|
||||
if (result == 0)
|
||||
printf("file ok");
|
||||
@@ -299,7 +299,7 @@ int updateTemplate(const char *filename)
|
||||
{
|
||||
TpfFile templateFile;
|
||||
|
||||
Filename templateFileName(NULL, NULL, filename, TEMPLATE_EXTENSION);
|
||||
Filename templateFileName(nullptr, nullptr, filename, TEMPLATE_EXTENSION);
|
||||
return templateFile.updateTemplate(templateFileName);
|
||||
} // updateTemplate
|
||||
*/
|
||||
@@ -317,7 +317,7 @@ TpfFile templateFile;
|
||||
//Error e;
|
||||
//
|
||||
// // check filename extensions
|
||||
// Filename templateFileName(NULL, NULL, filename, TEMPLATE_EXTENSION);
|
||||
// Filename templateFileName(nullptr, nullptr, filename, TEMPLATE_EXTENSION);
|
||||
// Filename iffFileName = templateFileName;
|
||||
// iffFileName.setExtension(IFF_EXTENSION);
|
||||
//
|
||||
@@ -345,7 +345,7 @@ TpfFile templateFile;
|
||||
// IGNORE_RETURN(templateFile.loadTemplate(templateFileName));
|
||||
//
|
||||
// // check out the client template iff file
|
||||
// Filename iffName(NULL, templateFile.getIffPath().c_str(), iffFileName, IFF_EXTENSION);
|
||||
// Filename iffName(nullptr, templateFile.getIffPath().c_str(), iffFileName, IFF_EXTENSION);
|
||||
// commands[1] = iffName;
|
||||
// client.SetArgv( 1, const_cast<char **>(&commands[1]) );
|
||||
// client.Run( commands[0], &ui );
|
||||
@@ -370,7 +370,7 @@ TpfFile templateFile;
|
||||
//Error e;
|
||||
//
|
||||
// // check filename extensions
|
||||
// Filename templateFileName(NULL, NULL, filename, TEMPLATE_EXTENSION);
|
||||
// Filename templateFileName(nullptr, nullptr, filename, TEMPLATE_EXTENSION);
|
||||
// Filename iffFileName = templateFileName;
|
||||
// iffFileName.setExtension(IFF_EXTENSION);
|
||||
//
|
||||
@@ -424,7 +424,7 @@ TpfFile templateFile;
|
||||
// return -1;
|
||||
//
|
||||
// // add the client iff file
|
||||
// Filename iffName(NULL, templateFile.getIffPath().c_str(), iffFileName, NULL);
|
||||
// Filename iffName(nullptr, templateFile.getIffPath().c_str(), iffFileName, nullptr);
|
||||
// commands[1] = iffName;
|
||||
// client.SetArgv( 1, const_cast<char **>(&commands[1]) );
|
||||
// client.Run( commands[0], &ui );
|
||||
@@ -591,7 +591,7 @@ int main(int argc, char *argv[ ])
|
||||
SetupSharedFoundation::Data data(SetupSharedFoundation::Data::D_console);
|
||||
#ifdef WIN32
|
||||
char buffer[1024];
|
||||
GetModuleFileName(GetModuleHandle(NULL), buffer, 1024);
|
||||
GetModuleFileName(GetModuleHandle(nullptr), buffer, 1024);
|
||||
Filename configName;
|
||||
configName.setName(buffer);
|
||||
configName.setName("templateCompiler.cfg");
|
||||
@@ -607,7 +607,7 @@ int main(int argc, char *argv[ ])
|
||||
|
||||
// setup the random number generator
|
||||
// @todo need a better seed
|
||||
SetupSharedRandom::install(static_cast<uint32>(time(NULL)));
|
||||
SetupSharedRandom::install(static_cast<uint32>(time(nullptr)));
|
||||
|
||||
// install templates
|
||||
SetupSharedTemplate::install();
|
||||
|
||||
+13
-13
@@ -30,7 +30,7 @@
|
||||
//==============================================================================
|
||||
// file variables
|
||||
|
||||
const TemplateData *currentTemplateData = NULL;
|
||||
const TemplateData *currentTemplateData = nullptr;
|
||||
|
||||
|
||||
//==============================================================================
|
||||
@@ -118,7 +118,7 @@ File fp;
|
||||
return;
|
||||
|
||||
File temp_fp;
|
||||
if (!temp_fp.open(tmpnam(NULL), "wt"))
|
||||
if (!temp_fp.open(tmpnam(nullptr), "wt"))
|
||||
{
|
||||
fprintf(stderr, "error opening temp file for template header "
|
||||
"replacement [%s]\n", temp_fp.getFilename().getFullFilename().c_str());
|
||||
@@ -244,7 +244,7 @@ int result;
|
||||
}
|
||||
|
||||
File temp_fp;
|
||||
if (!temp_fp.open(tmpnam(NULL), "wt"))
|
||||
if (!temp_fp.open(tmpnam(nullptr), "wt"))
|
||||
{
|
||||
fprintf(stderr, "error opening temp file for template source "
|
||||
"replacement [%s]\n", temp_fp.getFilename().getFullFilename().c_str());
|
||||
@@ -337,8 +337,8 @@ int result;
|
||||
// std::string oldTemplateName = tdfFile.getTemplateName();
|
||||
// std::string oldBaseName = tdfFile.getBaseName();
|
||||
|
||||
Filename fullName(NULL, path.getPath().c_str(), tdfFile.getTemplateName().c_str(),
|
||||
NULL);
|
||||
Filename fullName(nullptr, path.getPath().c_str(), tdfFile.getTemplateName().c_str(),
|
||||
nullptr);
|
||||
|
||||
writeTemplateHeader(tdfFile, fullName);
|
||||
result = writeTemplateSource(tdfFile, fullName);
|
||||
@@ -397,7 +397,7 @@ TemplateDefinitionFile tdfFile;
|
||||
//Error e;
|
||||
//
|
||||
// // check filename extensions
|
||||
// Filename templateFileName(NULL, NULL, filename, TEMPLATE_DEFINITION_EXTENSION);
|
||||
// Filename templateFileName(nullptr, nullptr, filename, TEMPLATE_DEFINITION_EXTENSION);
|
||||
//
|
||||
// // Connect to Perforce server
|
||||
// client.Init( &e );
|
||||
@@ -433,7 +433,7 @@ TemplateDefinitionFile tdfFile;
|
||||
// if (tdfFile.getPath().getFullFilename().size() != 0)
|
||||
// {
|
||||
// // check out the source files
|
||||
// Filename sourceName(NULL, tdfFile.getPath().getPath().c_str(),
|
||||
// Filename sourceName(nullptr, tdfFile.getPath().getPath().c_str(),
|
||||
// tdfFile.getTemplateName().c_str(), "cpp");
|
||||
// commands[1] = sourceName;
|
||||
// client.SetArgv( 1, const_cast<char **>(&commands[1]) );
|
||||
@@ -453,7 +453,7 @@ TemplateDefinitionFile tdfFile;
|
||||
// std::string compilerFilename;
|
||||
// compilerFilename = EnumLocationTypes[tdfFile.getTemplateLocation()] +
|
||||
// filenameLowerToUpper(templateFileName.getName());
|
||||
// Filename compilerName(NULL, tdfFile.getCompilerPath().getPath().c_str(),
|
||||
// Filename compilerName(nullptr, tdfFile.getCompilerPath().getPath().c_str(),
|
||||
// tdfFile.getTemplateName().c_str(), "cpp");
|
||||
// commands[1] = compilerName;
|
||||
// client.SetArgv( 1, const_cast<char **>(&commands[1]) );
|
||||
@@ -485,7 +485,7 @@ TemplateDefinitionFile tdfFile;
|
||||
//Error e;
|
||||
//
|
||||
// // check filename extensions
|
||||
// Filename templateFileName(NULL, NULL, filename, TEMPLATE_DEFINITION_EXTENSION);
|
||||
// Filename templateFileName(nullptr, nullptr, filename, TEMPLATE_DEFINITION_EXTENSION);
|
||||
//
|
||||
// // find the client and server paths
|
||||
// File fp(templateFileName, "rt");
|
||||
@@ -546,7 +546,7 @@ TemplateDefinitionFile tdfFile;
|
||||
// if (tdfFile.getPath().getFullFilename().size() != 0)
|
||||
// {
|
||||
// // check in the source files
|
||||
// Filename sourceName(NULL, tdfFile.getPath().getPath().c_str(),
|
||||
// Filename sourceName(nullptr, tdfFile.getPath().getPath().c_str(),
|
||||
// tdfFile.getTemplateName().c_str(), "cpp");
|
||||
// commands[1] = sourceName;
|
||||
// client.SetArgv( 1, const_cast<char **>(&commands[1]) );
|
||||
@@ -563,7 +563,7 @@ TemplateDefinitionFile tdfFile;
|
||||
// if (tdfFile.getCompilerPath().getFullFilename().size() != 0)
|
||||
// {
|
||||
// // check in the compiler source files
|
||||
// Filename compilerName(NULL, tdfFile.getCompilerPath().getPath().c_str(),
|
||||
// Filename compilerName(nullptr, tdfFile.getCompilerPath().getPath().c_str(),
|
||||
// tdfFile.getTemplateName().c_str(), "cpp");
|
||||
// commands[1] = compilerName;
|
||||
// client.SetArgv( 1, const_cast<char **>(&commands[1]) );
|
||||
@@ -669,7 +669,7 @@ int main(int argc, char *argv[ ])
|
||||
SetupSharedFoundation::Data data(SetupSharedFoundation::Data::D_console);
|
||||
#ifdef WIN32
|
||||
char buffer[1024];
|
||||
GetModuleFileName(GetModuleHandle(NULL), buffer, 1024);
|
||||
GetModuleFileName(GetModuleHandle(nullptr), buffer, 1024);
|
||||
Filename configName;
|
||||
configName.setName(buffer);
|
||||
configName.setName("templateCompiler.cfg");
|
||||
@@ -685,7 +685,7 @@ int main(int argc, char *argv[ ])
|
||||
|
||||
// setup the random number generator
|
||||
// @todo need a better seed
|
||||
SetupSharedRandom::install(static_cast<uint32>(time(NULL)));
|
||||
SetupSharedRandom::install(static_cast<uint32>(time(nullptr)));
|
||||
|
||||
int result = processArgs(argc, argv);
|
||||
|
||||
|
||||
@@ -38,14 +38,14 @@ public:
|
||||
|
||||
virtual bool canCollideWith ( CollisionProperty const * otherCollision ) const
|
||||
{
|
||||
if(otherCollision == NULL)
|
||||
if(otherCollision == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
BarrierObject const * barrier = safe_cast<BarrierObject const *>(&getOwner());
|
||||
|
||||
if(barrier == NULL)
|
||||
if(barrier == nullptr)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
@@ -180,7 +180,7 @@ void BarrierObject::createAppearance ( void )
|
||||
|
||||
Appearance * appearance = CellProperty::createPortalBarrier(verts,gs_barrierColor);
|
||||
|
||||
if(appearance != NULL)
|
||||
if(appearance != nullptr)
|
||||
{
|
||||
setAppearance( appearance );
|
||||
|
||||
|
||||
@@ -156,8 +156,8 @@ BoxTreeNode::BoxTreeNode()
|
||||
: m_box(),
|
||||
m_index(-1),
|
||||
m_userId(-1),
|
||||
m_childA(NULL),
|
||||
m_childB(NULL)
|
||||
m_childA(nullptr),
|
||||
m_childB(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -165,8 +165,8 @@ BoxTreeNode::BoxTreeNode ( AxialBox const & box, int userId )
|
||||
: m_box(box),
|
||||
m_index(-1),
|
||||
m_userId(userId),
|
||||
m_childA(NULL),
|
||||
m_childB(NULL)
|
||||
m_childA(nullptr),
|
||||
m_childB(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -195,10 +195,10 @@ void BoxTreeNode::drawDebugShapes ( DebugShapeRenderer * renderer, VectorArgb co
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(m_childA == NULL) return;
|
||||
if(m_childB == NULL) return;
|
||||
if(m_childA == nullptr) return;
|
||||
if(m_childB == nullptr) return;
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
VectorArgb newColor( color.a, color.r * 0.9f, color.g * 0.9f, color.b * 0.9f );
|
||||
|
||||
@@ -227,7 +227,7 @@ int BoxTreeNode::getNodeCount ( void ) const
|
||||
|
||||
float BoxTreeNode::calcWeight ( void ) const
|
||||
{
|
||||
if((m_childA == NULL) && (m_childB == NULL)) return 1.0f;
|
||||
if((m_childA == nullptr) && (m_childB == nullptr)) return 1.0f;
|
||||
|
||||
float accum = 0.0f;
|
||||
|
||||
@@ -241,9 +241,9 @@ float BoxTreeNode::calcWeight ( void ) const
|
||||
|
||||
float BoxTreeNode::calcBalance ( void ) const
|
||||
{
|
||||
if((m_childA == NULL) && (m_childB == NULL)) return 1.0f;
|
||||
if((m_childA == nullptr) && (m_childB == nullptr)) return 1.0f;
|
||||
|
||||
if((m_childA != NULL) && (m_childB != NULL))
|
||||
if((m_childA != nullptr) && (m_childB != nullptr))
|
||||
{
|
||||
return m_childA->calcWeight() / m_childB->calcWeight();
|
||||
}
|
||||
@@ -288,8 +288,8 @@ void BoxTreeNode::packInto ( BoxTreeNode * node, BoxTreeNode * base ) const
|
||||
node->m_box = m_box;
|
||||
node->m_index = m_index;
|
||||
|
||||
node->m_childA = m_childA ? (base + m_childA->m_index) : NULL;
|
||||
node->m_childB = m_childB ? (base + m_childB->m_index) : NULL;
|
||||
node->m_childA = m_childA ? (base + m_childA->m_index) : nullptr;
|
||||
node->m_childB = m_childB ? (base + m_childB->m_index) : nullptr;
|
||||
|
||||
node->m_userId = m_userId;
|
||||
}
|
||||
@@ -302,10 +302,10 @@ void BoxTreeNode::deleteChildren ( void )
|
||||
if(m_childB) m_childB->deleteChildren();
|
||||
|
||||
delete m_childA;
|
||||
m_childA = NULL;
|
||||
m_childA = nullptr;
|
||||
|
||||
delete m_childB;
|
||||
m_childB = NULL;
|
||||
m_childB = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -341,8 +341,8 @@ void BoxTreeNode::read ( Iff & iff, BoxTreeNode * base )
|
||||
int indexA = iff.read_int32();
|
||||
int indexB = iff.read_int32();
|
||||
|
||||
m_childA = ( indexA != -1 ? base + indexA : NULL );
|
||||
m_childB = ( indexB != -1 ? base + indexB : NULL );
|
||||
m_childA = ( indexA != -1 ? base + indexA : nullptr );
|
||||
m_childB = ( indexB != -1 ? base + indexB : nullptr );
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -361,7 +361,7 @@ bool BoxTreeNode::findClosest ( Vector const & V, float maxDistance, float & out
|
||||
// ----------
|
||||
// Leaf node case - this leaf node is closer
|
||||
|
||||
if((m_childA == NULL) && (m_childB == NULL))
|
||||
if((m_childA == nullptr) && (m_childB == nullptr))
|
||||
{
|
||||
outDistance = dist;
|
||||
outIndex = m_userId;
|
||||
@@ -417,8 +417,8 @@ void BoxTree::install()
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
BoxTree::BoxTree()
|
||||
: m_flatNodes(NULL),
|
||||
m_root(NULL),
|
||||
: m_flatNodes(nullptr),
|
||||
m_root(nullptr),
|
||||
m_testCounter(0)
|
||||
{
|
||||
}
|
||||
@@ -443,7 +443,7 @@ void BoxTree::build ( BoxVec const & boxes )
|
||||
|
||||
// ----------
|
||||
|
||||
BoxTreeNodePVec nodes(boxes.size(),NULL);
|
||||
BoxTreeNodePVec nodes(boxes.size(),nullptr);
|
||||
|
||||
int boxcount = boxes.size();
|
||||
|
||||
@@ -488,7 +488,7 @@ void BoxTree::drawDebugShapes ( DebugShapeRenderer * renderer ) const
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
if(m_root) m_root->drawDebugShapes( renderer, VectorArgb::solidWhite, 0 );
|
||||
|
||||
@@ -546,7 +546,7 @@ static inline void templateTestOverlapRecurse( BoxTreeNode const * node, TestSha
|
||||
template< class TestShape >
|
||||
static inline bool templateTestOverlap( BoxTree const & tree, TestShape const & testShape, IdVec & outIds )
|
||||
{
|
||||
if(tree.getRoot() == NULL) return false;
|
||||
if(tree.getRoot() == nullptr) return false;
|
||||
|
||||
int oldSize = outIds.size();
|
||||
|
||||
@@ -580,7 +580,7 @@ static inline void templateTestOverlapRecurse2( BoxTreeNode const * node, TestSh
|
||||
template< class TestShape >
|
||||
static inline bool templateTestOverlap2( BoxTree const & tree, TestShape const & testShape, IdVec & outIds )
|
||||
{
|
||||
if(tree.getRoot() == NULL) return false;
|
||||
if(tree.getRoot() == nullptr) return false;
|
||||
|
||||
int oldSize = outIds.size();
|
||||
|
||||
@@ -701,11 +701,11 @@ void BoxTree::clear ( void )
|
||||
m_root->deleteChildren();
|
||||
|
||||
delete m_root;
|
||||
m_root = NULL;
|
||||
m_root = nullptr;
|
||||
}
|
||||
|
||||
delete m_flatNodes;
|
||||
m_flatNodes = NULL;
|
||||
m_flatNodes = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -108,7 +108,7 @@ inline int BoxTree::getTestCounter ( void ) const
|
||||
|
||||
inline bool BoxTree::isFlat ( void ) const
|
||||
{
|
||||
return m_flatNodes != NULL;
|
||||
return m_flatNodes != nullptr;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -162,7 +162,7 @@ void CollisionBuckets::build(Vector const & minimumBounds, Vector const & maximu
|
||||
(*m_nodeMatrix)[xx].resize(m_bucketsAlongY);
|
||||
for (unsigned int yy = 0; yy < m_bucketsAlongY; ++yy)
|
||||
{
|
||||
// note that nodes are initialized to NULL
|
||||
// note that nodes are initialized to nullptr
|
||||
(*m_nodeMatrix)[xx][yy].resize(m_bucketsAlongZ, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,8 +106,8 @@ CollisionMesh::CollisionMesh()
|
||||
: CollisionSurface(),
|
||||
m_id(0),
|
||||
m_version(1),
|
||||
m_boxTree(NULL),
|
||||
m_extent(NULL),
|
||||
m_boxTree(nullptr),
|
||||
m_extent(nullptr),
|
||||
m_boundsDirty(true)
|
||||
{
|
||||
m_extent = new SimpleExtent( MultiShape(AxialBox()) );
|
||||
@@ -116,10 +116,10 @@ CollisionMesh::CollisionMesh()
|
||||
CollisionMesh::~CollisionMesh()
|
||||
{
|
||||
delete m_boxTree;
|
||||
m_boxTree = NULL;
|
||||
m_boxTree = nullptr;
|
||||
|
||||
delete m_extent;
|
||||
m_extent = NULL;
|
||||
m_extent = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -154,7 +154,7 @@ BaseExtent const * CollisionMesh::getExtent_p ( void ) const
|
||||
void CollisionMesh::clear ( void )
|
||||
{
|
||||
delete m_boxTree;
|
||||
m_boxTree = NULL;
|
||||
m_boxTree = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -1010,7 +1010,7 @@ void CollisionMesh::transform( CollisionMesh const * sourceMesh, Transform const
|
||||
|
||||
bool CollisionMesh::hasBoxTree ( void ) const
|
||||
{
|
||||
return m_boxTree != NULL;
|
||||
return m_boxTree != nullptr;
|
||||
}
|
||||
|
||||
// ----------
|
||||
|
||||
@@ -75,7 +75,7 @@ void CollisionNotification::purgeQueue ( void )
|
||||
|
||||
Object * object = entry.m_object;
|
||||
|
||||
if(object == NULL) continue;
|
||||
if(object == nullptr) continue;
|
||||
|
||||
if(entry.m_added)
|
||||
{
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
namespace CollisionPropertyNamespace
|
||||
{
|
||||
CollisionProperty * ms_activeListHead = NULL;
|
||||
CollisionProperty * ms_activeListHead = nullptr;
|
||||
};
|
||||
|
||||
using namespace CollisionPropertyNamespace;
|
||||
@@ -64,8 +64,8 @@ void CollisionProperty::detachList ( void )
|
||||
ms_activeListHead = m_next;
|
||||
}
|
||||
|
||||
m_prev = NULL;
|
||||
m_next = NULL;
|
||||
m_prev = nullptr;
|
||||
m_next = nullptr;
|
||||
}
|
||||
|
||||
// ----------
|
||||
@@ -76,7 +76,7 @@ void CollisionProperty::attachList ( CollisionProperty * & head )
|
||||
|
||||
if(head) head->m_prev = this;
|
||||
|
||||
m_prev = NULL;
|
||||
m_prev = nullptr;
|
||||
m_next = head;
|
||||
|
||||
head = this;
|
||||
@@ -129,7 +129,7 @@ CollisionProperty * CollisionProperty::getActiveHead ( void )
|
||||
|
||||
Transform getTransform_o2c( Object const * object )
|
||||
{
|
||||
if(object == NULL) return Transform::identity;
|
||||
if(object == nullptr) return Transform::identity;
|
||||
|
||||
// If this object is a cell, its o2c transform is the identity transform
|
||||
|
||||
@@ -164,23 +164,23 @@ CollisionProperty::CollisionProperty( Object & owner )
|
||||
: Property( CollisionProperty::getClassPropertyId(), owner ),
|
||||
m_lastTransform_w(Transform::identity),
|
||||
m_lastTransform_p(Transform::identity),
|
||||
m_lastCellObject(NULL),
|
||||
m_lastCellObject(nullptr),
|
||||
m_stepHeight(0.0f),
|
||||
m_defaultRadius(0.0f),
|
||||
m_offsetX(0.0f),
|
||||
m_offsetZ(0.0f),
|
||||
m_extentsDirty(true),
|
||||
m_extent_l(NULL),
|
||||
m_extent_p(NULL),
|
||||
m_extent_l(nullptr),
|
||||
m_extent_p(nullptr),
|
||||
m_sphere_l(),
|
||||
m_sphere_w(),
|
||||
m_scale(owner.getScale().x),
|
||||
m_spatialSubdivisionHandle(NULL),
|
||||
m_floor(NULL),
|
||||
m_footprint(NULL),
|
||||
m_spatialSubdivisionHandle(nullptr),
|
||||
m_floor(nullptr),
|
||||
m_footprint(nullptr),
|
||||
m_idleCounter(3),
|
||||
m_next(NULL),
|
||||
m_prev(NULL),
|
||||
m_next(nullptr),
|
||||
m_prev(nullptr),
|
||||
m_flags(F_collidable),
|
||||
m_spatialDatabaseStorageType(SpatialDatabase::Q_None)
|
||||
{
|
||||
@@ -200,7 +200,7 @@ CollisionProperty::CollisionProperty( Object & owner )
|
||||
{
|
||||
char const * const found = strstr(templateName,"lair");
|
||||
|
||||
if(found != NULL)
|
||||
if(found != nullptr)
|
||||
{
|
||||
setCollidable(false);
|
||||
}
|
||||
@@ -214,23 +214,23 @@ CollisionProperty::CollisionProperty( Object & owner, SharedObjectTemplate const
|
||||
: Property( CollisionProperty::getClassPropertyId(), owner ),
|
||||
m_lastTransform_w(Transform::identity),
|
||||
m_lastTransform_p(Transform::identity),
|
||||
m_lastCellObject(NULL),
|
||||
m_lastCellObject(nullptr),
|
||||
m_stepHeight(0.0f),
|
||||
m_defaultRadius(0.0f),
|
||||
m_offsetX(0.0f),
|
||||
m_offsetZ(0.0f),
|
||||
m_extentsDirty(true),
|
||||
m_extent_l(NULL),
|
||||
m_extent_p(NULL),
|
||||
m_extent_l(nullptr),
|
||||
m_extent_p(nullptr),
|
||||
m_sphere_l(),
|
||||
m_sphere_w(),
|
||||
m_scale(owner.getScale().x),
|
||||
m_spatialSubdivisionHandle(NULL),
|
||||
m_floor(NULL),
|
||||
m_footprint(NULL),
|
||||
m_spatialSubdivisionHandle(nullptr),
|
||||
m_floor(nullptr),
|
||||
m_footprint(nullptr),
|
||||
m_idleCounter(3),
|
||||
m_next(NULL),
|
||||
m_prev(NULL),
|
||||
m_next(nullptr),
|
||||
m_prev(nullptr),
|
||||
m_flags(F_collidable),
|
||||
m_spatialDatabaseStorageType(SpatialDatabase::Q_None)
|
||||
{
|
||||
@@ -248,7 +248,7 @@ CollisionProperty::CollisionProperty( Object & owner, SharedObjectTemplate const
|
||||
{
|
||||
char const * const found = strstr(templateName,"lair");
|
||||
|
||||
if(found != NULL)
|
||||
if(found != nullptr)
|
||||
{
|
||||
setCollidable(false);
|
||||
}
|
||||
@@ -373,7 +373,7 @@ CollisionProperty::~CollisionProperty()
|
||||
|
||||
static_cast<SphereTreeNode<CollisionProperty *, CollisionSphereAccessor>::NodeHandle *>(m_spatialSubdivisionHandle)->removeObject();
|
||||
|
||||
m_spatialSubdivisionHandle = NULL;
|
||||
m_spatialSubdivisionHandle = nullptr;
|
||||
}
|
||||
|
||||
FATAL(CollisionWorld::isUpdating(),("CollisionProperty::~CollisionProperty - Trying to destroy a collision property while the collision world is updating. This is baaaad\n"));
|
||||
@@ -382,16 +382,16 @@ CollisionProperty::~CollisionProperty()
|
||||
detachList();
|
||||
|
||||
delete m_extent_l;
|
||||
m_extent_l = NULL;
|
||||
m_extent_l = nullptr;
|
||||
|
||||
delete m_extent_p;
|
||||
m_extent_p = NULL;
|
||||
m_extent_p = nullptr;
|
||||
|
||||
delete m_floor;
|
||||
m_floor = NULL;
|
||||
m_floor = nullptr;
|
||||
|
||||
delete m_footprint;
|
||||
m_footprint = NULL;
|
||||
m_footprint = nullptr;
|
||||
|
||||
}
|
||||
|
||||
@@ -405,7 +405,7 @@ void CollisionProperty::attachSourceExtent ( BaseExtent * newSourceExtent ) cons
|
||||
m_extent_l = newSourceExtent;
|
||||
|
||||
delete m_extent_p;
|
||||
m_extent_p = NULL;
|
||||
m_extent_p = nullptr;
|
||||
|
||||
m_extentsDirty = true;
|
||||
}
|
||||
@@ -437,12 +437,12 @@ void CollisionProperty::initFloor ( void )
|
||||
if (isMobile())
|
||||
return;
|
||||
|
||||
if(m_floor != NULL)
|
||||
if(m_floor != nullptr)
|
||||
return;
|
||||
|
||||
// ----------
|
||||
|
||||
char const *floorName = NULL;
|
||||
char const *floorName = nullptr;
|
||||
|
||||
Appearance * appearance = getOwner().getAppearance();
|
||||
if(appearance)
|
||||
@@ -487,7 +487,7 @@ void CollisionProperty::addToCollisionWorld ( void )
|
||||
if (getOwner().getNetworkId() < NetworkId::cms_invalid)
|
||||
{
|
||||
delete m_footprint;
|
||||
m_footprint = NULL;
|
||||
m_footprint = nullptr;
|
||||
}
|
||||
|
||||
if (m_footprint)
|
||||
@@ -534,7 +534,7 @@ Transform CollisionProperty::getTransform_o2c ( void ) const
|
||||
|
||||
BaseExtent * convertToSimpleExtent ( BaseExtent const * sourceExtent )
|
||||
{
|
||||
if(!sourceExtent) return NULL;
|
||||
if(!sourceExtent) return nullptr;
|
||||
|
||||
switch(sourceExtent->getType())
|
||||
{
|
||||
@@ -549,7 +549,7 @@ BaseExtent * convertToSimpleExtent ( BaseExtent const * sourceExtent )
|
||||
{
|
||||
Extent const * extent = safe_cast<Extent const *>(sourceExtent);
|
||||
|
||||
if(!extent) return NULL;
|
||||
if(!extent) return nullptr;
|
||||
|
||||
return new SimpleExtent( MultiShape( extent->getShape() ) );
|
||||
}
|
||||
@@ -558,7 +558,7 @@ BaseExtent * convertToSimpleExtent ( BaseExtent const * sourceExtent )
|
||||
{
|
||||
CylinderExtent const * extent = safe_cast<CylinderExtent const *>(sourceExtent);
|
||||
|
||||
if(!extent) return NULL;
|
||||
if(!extent) return nullptr;
|
||||
|
||||
return new SimpleExtent( MultiShape( extent->getShape() ) );
|
||||
}
|
||||
@@ -567,7 +567,7 @@ BaseExtent * convertToSimpleExtent ( BaseExtent const * sourceExtent )
|
||||
{
|
||||
BoxExtent const * extent = safe_cast<BoxExtent const *>(sourceExtent);
|
||||
|
||||
if(!extent) return NULL;
|
||||
if(!extent) return nullptr;
|
||||
|
||||
return new SimpleExtent( MultiShape( extent->getShape() ) );
|
||||
}
|
||||
@@ -576,7 +576,7 @@ BaseExtent * convertToSimpleExtent ( BaseExtent const * sourceExtent )
|
||||
{
|
||||
MeshExtent const * extent = safe_cast<MeshExtent const *>(sourceExtent);
|
||||
|
||||
if(!extent) return NULL;
|
||||
if(!extent) return nullptr;
|
||||
|
||||
return extent->clone();
|
||||
}
|
||||
@@ -585,7 +585,7 @@ BaseExtent * convertToSimpleExtent ( BaseExtent const * sourceExtent )
|
||||
{
|
||||
DetailExtent const * extent = safe_cast<DetailExtent const *>(sourceExtent);
|
||||
|
||||
if(!extent) return NULL;
|
||||
if(!extent) return nullptr;
|
||||
|
||||
DetailExtent * newExtent = new DetailExtent();
|
||||
|
||||
@@ -603,7 +603,7 @@ BaseExtent * convertToSimpleExtent ( BaseExtent const * sourceExtent )
|
||||
{
|
||||
ComponentExtent const * extent = safe_cast<ComponentExtent const *>(sourceExtent);
|
||||
|
||||
if(!extent) return NULL;
|
||||
if(!extent) return nullptr;
|
||||
|
||||
ComponentExtent * newExtent = new ComponentExtent();
|
||||
|
||||
@@ -623,7 +623,7 @@ BaseExtent * convertToSimpleExtent ( BaseExtent const * sourceExtent )
|
||||
case ET_Null:
|
||||
case ET_ExtentTypeCount:
|
||||
default:
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -653,10 +653,10 @@ void CollisionProperty::updateExtents ( void ) const
|
||||
if(m_scale != newScale)
|
||||
{
|
||||
delete m_extent_l;
|
||||
m_extent_l = NULL;
|
||||
m_extent_l = nullptr;
|
||||
|
||||
delete m_extent_p;
|
||||
m_extent_p = NULL;
|
||||
m_extent_p = nullptr;
|
||||
|
||||
m_scale = newScale;
|
||||
}
|
||||
@@ -960,7 +960,7 @@ void CollisionProperty::drawDebugShapes ( DebugShapeRenderer * renderer ) const
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
if(ConfigSharedCollision::getDrawExtents())
|
||||
{
|
||||
@@ -1274,9 +1274,9 @@ void CollisionProperty::setLastPos ( CellProperty * cell, Transform const & tran
|
||||
{
|
||||
NAN_CHECK(transform_p);
|
||||
|
||||
if(cell == NULL)
|
||||
if(cell == nullptr)
|
||||
{
|
||||
m_lastCellObject = NULL;
|
||||
m_lastCellObject = nullptr;
|
||||
m_lastTransform_p = transform_p;
|
||||
m_lastTransform_w = transform_p;
|
||||
}
|
||||
@@ -1298,7 +1298,7 @@ Object const * CollisionProperty::getStandingOn ( void ) const
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace CollisionResolveNamespace
|
||||
|
||||
FloorContactList ms_floorContactList;
|
||||
|
||||
Floor const * ms_ignoreFloor = NULL;
|
||||
Floor const * ms_ignoreFloor = nullptr;
|
||||
int ms_ignoreTriId = -1;
|
||||
int ms_ignoreEdge = -1;
|
||||
Vector ms_ignoreNormal = Vector::zero;
|
||||
@@ -312,7 +312,7 @@ ResolutionResult CollisionResolve::resolveCollisions(CollisionProperty * collide
|
||||
|
||||
if(result == RR_Resolved)
|
||||
{
|
||||
colliderA->hitBy(NULL);
|
||||
colliderA->hitBy(nullptr);
|
||||
colliderA->setExtentsDirty(true);
|
||||
|
||||
Vector resetPos = moveSeg.getBegin(moveSeg.m_cellB);
|
||||
@@ -339,7 +339,7 @@ ResolutionResult CollisionResolve::resolveCollisions ( CellProperty const * cell
|
||||
|
||||
const int iterationCount = 8;
|
||||
|
||||
ms_ignoreFloor = NULL;
|
||||
ms_ignoreFloor = nullptr;
|
||||
ms_ignoreTriId = -1;
|
||||
ms_ignoreEdge = -1;
|
||||
ms_ignoreTime = REAL_MAX;
|
||||
@@ -484,12 +484,12 @@ ResolutionResult CollisionResolve::resolveCollisions ( CellProperty const * cell
|
||||
// ----------
|
||||
// Remove the hit obstacle from the extent list
|
||||
|
||||
if(obstacleList->at(minIndex).m_extent != NULL)
|
||||
if(obstacleList->at(minIndex).m_extent != nullptr)
|
||||
{
|
||||
obstacleList->at(minIndex) = obstacleList->back();
|
||||
obstacleList->resize(obstacleList->size()-1);
|
||||
|
||||
ms_ignoreFloor = NULL;
|
||||
ms_ignoreFloor = nullptr;
|
||||
ms_ignoreTriId = -1;
|
||||
ms_ignoreEdge = -1;
|
||||
ms_ignoreTime = REAL_MAX;
|
||||
@@ -561,13 +561,13 @@ void CollisionResolve::explodeExtent ( CellProperty const * cell, BaseExtent con
|
||||
|
||||
void CollisionResolve::explodeFootprint ( Footprint * foot, ObstacleList & obstacleList, FloorContactList & floorContacts )
|
||||
{
|
||||
if(foot == NULL) return;
|
||||
if(foot == nullptr) return;
|
||||
|
||||
for(ContactIterator it(foot->getFloorList()); it; ++it)
|
||||
{
|
||||
FloorContactShape * contact = (*it);
|
||||
|
||||
if(contact == NULL)
|
||||
if(contact == nullptr)
|
||||
continue;
|
||||
|
||||
obstacleList.push_back( ObstacleInfo(contact->m_contact.getCell(),contact) );
|
||||
@@ -594,7 +594,7 @@ void CollisionResolve::explodeCollider(CollisionProperty * colliderA, ColliderLi
|
||||
{
|
||||
CollisionProperty const * const colliderB = *ii;
|
||||
|
||||
if(colliderB == NULL) continue;
|
||||
if(colliderB == nullptr) continue;
|
||||
|
||||
BaseExtent const * const extentB = colliderB->getExtent_p();
|
||||
|
||||
@@ -613,7 +613,7 @@ void CollisionResolve::explodeCollider(CollisionProperty * colliderA, ColliderLi
|
||||
{
|
||||
FloorContactShape * const contact = (*it);
|
||||
|
||||
if(contact == NULL) continue;
|
||||
if(contact == nullptr) continue;
|
||||
|
||||
ms_floorContactList.push_back(contact);
|
||||
}
|
||||
@@ -713,7 +713,7 @@ Contact CollisionResolve::findContactWithFloor ( FloorContactShape * floorContac
|
||||
|
||||
Floor const * floor = loc.getFloor();
|
||||
|
||||
if(floor == NULL) return Contact::noContact;
|
||||
if(floor == nullptr) return Contact::noContact;
|
||||
|
||||
CellProperty const * floorCell = loc.getCell();
|
||||
|
||||
@@ -740,7 +740,7 @@ Contact CollisionResolve::findContactWithFloor ( FloorContactShape * floorContac
|
||||
return Contact::noContact;
|
||||
}
|
||||
|
||||
if((ms_ignoreFloor == NULL) || (floor != ms_ignoreFloor))
|
||||
if((ms_ignoreFloor == nullptr) || (floor != ms_ignoreFloor))
|
||||
{
|
||||
walkResult = floor->canMove(loc,delta,-1,-1,result);
|
||||
}
|
||||
@@ -776,7 +776,7 @@ Contact CollisionResolve::findContactWithFloor ( FloorContactShape * floorContac
|
||||
tempContact.m_surfaceId2 = result.getHitEdgeId();
|
||||
|
||||
tempContact.m_cell = floorCell;
|
||||
tempContact.m_extent = NULL;
|
||||
tempContact.m_extent = nullptr;
|
||||
tempContact.m_surface = result.getFloor();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,22 +27,22 @@ class Floor;
|
||||
struct ObstacleInfo
|
||||
{
|
||||
ObstacleInfo()
|
||||
: m_cell(NULL),
|
||||
m_extent(NULL),
|
||||
m_floorContact(NULL)
|
||||
: m_cell(nullptr),
|
||||
m_extent(nullptr),
|
||||
m_floorContact(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
ObstacleInfo ( CellProperty const * cell, SimpleExtent const * extent )
|
||||
: m_cell(cell),
|
||||
m_extent(extent),
|
||||
m_floorContact(NULL)
|
||||
m_floorContact(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
ObstacleInfo ( CellProperty const * cell, FloorContactShape * contact )
|
||||
: m_cell(cell),
|
||||
m_extent(NULL),
|
||||
m_extent(nullptr),
|
||||
m_floorContact(contact)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -881,7 +881,7 @@ void MergePolyPoly ( VertexList & polyA, VertexList & polyB, VertexList & outPol
|
||||
|
||||
void BuildConvexHull ( Vector const * sortedVerts, int vertCount, VertexList & outPoly )
|
||||
{
|
||||
if(sortedVerts == NULL) return;
|
||||
if(sortedVerts == nullptr) return;
|
||||
|
||||
if(vertCount <= 0) return;
|
||||
if(vertCount == 1) { outPoly.push_back(sortedVerts[0]); return; }
|
||||
@@ -1104,7 +1104,7 @@ RangeLoop CalcAvoidanceThetas ( Sphere const & S, BaseExtent const * extent );
|
||||
|
||||
RangeLoop CalcAvoidanceThetas ( Sphere const & S, SimpleExtent const * extent )
|
||||
{
|
||||
if(extent == NULL) return RangeLoop::empty;
|
||||
if(extent == nullptr) return RangeLoop::empty;
|
||||
|
||||
return CalcAvoidanceThetas(S,extent->getShape());
|
||||
}
|
||||
@@ -1113,7 +1113,7 @@ RangeLoop CalcAvoidanceThetas ( Sphere const & S, SimpleExtent const * extent )
|
||||
|
||||
RangeLoop CalcAvoidanceThetas ( Sphere const & S, ComponentExtent const * extent )
|
||||
{
|
||||
if(extent == NULL) return RangeLoop::empty;
|
||||
if(extent == nullptr) return RangeLoop::empty;
|
||||
|
||||
RangeLoop range = RangeLoop::empty;
|
||||
|
||||
@@ -1123,7 +1123,7 @@ RangeLoop CalcAvoidanceThetas ( Sphere const & S, ComponentExtent const * extent
|
||||
{
|
||||
BaseExtent const * child = extent->getExtent(i);
|
||||
|
||||
if(child == NULL) continue;
|
||||
if(child == nullptr) continue;
|
||||
|
||||
RangeLoop temp = CalcAvoidanceThetas(S,child);
|
||||
|
||||
@@ -1137,13 +1137,13 @@ RangeLoop CalcAvoidanceThetas ( Sphere const & S, ComponentExtent const * extent
|
||||
|
||||
RangeLoop CalcAvoidanceThetas ( Sphere const & S, DetailExtent const * extent )
|
||||
{
|
||||
if(extent == NULL) return RangeLoop::empty;
|
||||
if(extent == nullptr) return RangeLoop::empty;
|
||||
|
||||
int count = extent->getExtentCount();
|
||||
|
||||
BaseExtent const * child = extent->getExtent(count - 1);
|
||||
|
||||
if(child == NULL) return RangeLoop::empty;
|
||||
if(child == nullptr) return RangeLoop::empty;
|
||||
|
||||
return CalcAvoidanceThetas(S,child);
|
||||
}
|
||||
@@ -1152,7 +1152,7 @@ RangeLoop CalcAvoidanceThetas ( Sphere const & S, DetailExtent const * extent )
|
||||
|
||||
RangeLoop CalcAvoidanceThetas ( Sphere const & S, BaseExtent const * extent )
|
||||
{
|
||||
if(extent == NULL) return RangeLoop::empty;
|
||||
if(extent == nullptr) return RangeLoop::empty;
|
||||
|
||||
ExtentType type = extent->getType();
|
||||
|
||||
@@ -1176,7 +1176,7 @@ RangeLoop CalcAvoidanceThetas ( Sphere const & S, ExtentVec const & extents )
|
||||
{
|
||||
BaseExtent const * child = extents[i];
|
||||
|
||||
if(child == NULL) continue;
|
||||
if(child == nullptr) continue;
|
||||
|
||||
RangeLoop temp = CalcAvoidanceThetas(S,child);
|
||||
|
||||
@@ -1367,7 +1367,7 @@ void explodeObstacle ( Sphere const & sphere, Vector const & delta, SimpleExtent
|
||||
|
||||
void explodeObstacle ( Sphere const & sphere, Vector const & delta, DetailExtent const * extent, ExtentVec & outList )
|
||||
{
|
||||
if(extent == NULL) return;
|
||||
if(extent == nullptr) return;
|
||||
|
||||
int count = extent->getExtentCount();
|
||||
|
||||
@@ -1376,7 +1376,7 @@ void explodeObstacle ( Sphere const & sphere, Vector const & delta, DetailExtent
|
||||
|
||||
void explodeObstacle ( Sphere const & sphere, Vector const & delta, ComponentExtent const * extent, ExtentVec & outList )
|
||||
{
|
||||
if(extent == NULL) return;
|
||||
if(extent == nullptr) return;
|
||||
|
||||
int count = extent->getExtentCount();
|
||||
|
||||
@@ -1388,7 +1388,7 @@ void explodeObstacle ( Sphere const & sphere, Vector const & delta, ComponentExt
|
||||
|
||||
void explodeObstacle ( Sphere const & sphere, Vector const & delta, BaseExtent const * extent, ExtentVec & outList )
|
||||
{
|
||||
if(extent == NULL) return;
|
||||
if(extent == nullptr) return;
|
||||
|
||||
ExtentType type = extent->getType();
|
||||
|
||||
@@ -1411,7 +1411,7 @@ void explodeObstacle ( Sphere const & sphere, Vector const & delta, ExtentVec co
|
||||
|
||||
bool CalcAvoidancePoint ( Sphere const & sphere, Transform const & sphereTransform_p2w, Vector const & delta, CollisionProperty const * obstacle, Vector & out )
|
||||
{
|
||||
if(obstacle == NULL) return false;
|
||||
if(obstacle == nullptr) return false;
|
||||
|
||||
static ExtentVec tempExtents;
|
||||
|
||||
@@ -1455,12 +1455,12 @@ bool CalcAvoidancePoint ( Sphere const & sphere, Transform const & sphereTransfo
|
||||
|
||||
bool CalcAvoidancePoint ( CollisionProperty const * mob, Vector const & delta, CollisionProperty const * obstacle, Vector & out )
|
||||
{
|
||||
if(mob == NULL) return false;
|
||||
if(obstacle == NULL) return false;
|
||||
if(mob == nullptr) return false;
|
||||
if(obstacle == nullptr) return false;
|
||||
|
||||
BaseExtent const * mobExtent = mob->getExtent_p();
|
||||
|
||||
if(mobExtent == NULL) return false;
|
||||
if(mobExtent == nullptr) return false;
|
||||
|
||||
Sphere mobSphere = mobExtent->getBoundingSphere();
|
||||
|
||||
@@ -1471,8 +1471,8 @@ bool CalcAvoidancePoint ( CollisionProperty const * mob, Vector const & delta, C
|
||||
|
||||
bool CalcAvoidancePoint ( Object const * mob, Vector const & delta, Object const * obstacle, Vector & out )
|
||||
{
|
||||
if(mob == NULL) return false;
|
||||
if(obstacle == NULL) return false;
|
||||
if(mob == nullptr) return false;
|
||||
if(obstacle == nullptr) return false;
|
||||
|
||||
CollisionProperty const * mobCollision = mob->getCollisionProperty();
|
||||
CollisionProperty const * obstacleCollision = obstacle->getCollisionProperty();
|
||||
@@ -1601,8 +1601,8 @@ Vector transformToCell ( CellProperty const * cellA, Vector const & point_A, Cel
|
||||
{
|
||||
CellProperty const * worldCell = CellProperty::getWorldCellProperty();
|
||||
|
||||
if(cellA == NULL) cellA = worldCell;
|
||||
if(cellB == NULL) cellB = worldCell;
|
||||
if(cellA == nullptr) cellA = worldCell;
|
||||
if(cellB == nullptr) cellB = worldCell;
|
||||
|
||||
if(cellA == cellB) return point_A;
|
||||
|
||||
@@ -1627,8 +1627,8 @@ Vector rotateToCell ( CellProperty const * cellA, Vector const & point_A, CellPr
|
||||
{
|
||||
CellProperty const * worldCell = CellProperty::getWorldCellProperty();
|
||||
|
||||
if(cellA == NULL) cellA = worldCell;
|
||||
if(cellB == NULL) cellB = worldCell;
|
||||
if(cellA == nullptr) cellA = worldCell;
|
||||
if(cellB == nullptr) cellB = worldCell;
|
||||
|
||||
if(cellA == cellB) return point_A;
|
||||
|
||||
@@ -1655,8 +1655,8 @@ Transform transformToCell ( CellProperty const * cellA, Transform const & transf
|
||||
{
|
||||
CellProperty const * worldCell = CellProperty::getWorldCellProperty();
|
||||
|
||||
if(cellA == NULL) cellA = worldCell;
|
||||
if(cellB == NULL) cellB = worldCell;
|
||||
if(cellA == nullptr) cellA = worldCell;
|
||||
if(cellB == nullptr) cellB = worldCell;
|
||||
|
||||
if(cellA == cellB) return transform_A;
|
||||
|
||||
@@ -1743,8 +1743,8 @@ MultiShape transformToCell ( CellProperty const * cellA, MultiShape const & shap
|
||||
|
||||
bool testPortalVis ( CellProperty const * cellA, Vector const & pointA, CellProperty const * cellB, Vector const & pointB )
|
||||
{
|
||||
if(cellA == NULL) return false;
|
||||
if(cellB == NULL) return false;
|
||||
if(cellA == nullptr) return false;
|
||||
if(cellB == nullptr) return false;
|
||||
|
||||
float hitTime = 0.0f;
|
||||
|
||||
@@ -1753,7 +1753,7 @@ bool testPortalVis ( CellProperty const * cellA, Vector const & pointA, CellProp
|
||||
|
||||
if(cellA == cellB)
|
||||
{
|
||||
return cellA->getDestinationCell(pointA,pointB,hitTime) == NULL;
|
||||
return cellA->getDestinationCell(pointA,pointB,hitTime) == nullptr;
|
||||
}
|
||||
|
||||
// ----------
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace CollisionWorldNamespace
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
||||
|
||||
SpatialDatabase * ms_database = NULL;
|
||||
SpatialDatabase * ms_database = nullptr;
|
||||
|
||||
bool ms_updating = false;
|
||||
bool ms_serverSide = false;
|
||||
@@ -94,7 +94,7 @@ namespace CollisionWorldNamespace
|
||||
bool testPassableTerrain(Vector const & startPos, Vector const & delta, float & collisionTime)
|
||||
{
|
||||
TerrainObject const *const terrainObject = TerrainObject::getConstInstance();
|
||||
if (NULL != terrainObject)
|
||||
if (nullptr != terrainObject)
|
||||
{
|
||||
float totalDistance = delta.magnitude();
|
||||
float distanceTraversed = 0.0f;
|
||||
@@ -134,7 +134,7 @@ namespace CollisionWorldNamespace
|
||||
return;
|
||||
|
||||
TerrainObject const *const terrainObject = TerrainObject::getConstInstance();
|
||||
if (NULL != terrainObject && terrainObject->hasPassableAffectors())
|
||||
if (nullptr != terrainObject && terrainObject->hasPassableAffectors())
|
||||
{
|
||||
|
||||
// pointA_w is *not* the previous world position, but actually the world
|
||||
@@ -289,7 +289,7 @@ bool CollisionWorldNamespace::testFloorCollision(FloorLocator const &startFloorL
|
||||
if (!floor)
|
||||
{
|
||||
// For some reason this solid floor does not have an attached floor. No collision.
|
||||
WARNING(true, ("testFloorCollision(): attempted to test floor with a starting floor locator that had a NULL floor, unexpected. Check calling code's assumptions."));
|
||||
WARNING(true, ("testFloorCollision(): attempted to test floor with a starting floor locator that had a nullptr floor, unexpected. Check calling code's assumptions."));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -319,7 +319,7 @@ bool CollisionWorldNamespace::testFloorCollision(FloorLocator const &startFloorL
|
||||
// if statement above.
|
||||
WARNING(true,
|
||||
("testFloorCollision(): floor collision occurred while checking for floor collisions for floor of object id [%s] but collision floor location has no associated floor. Calling this a non-collision. PathWalkResult was [%d].",
|
||||
floor->getOwner() ? floor->getOwner()->getNetworkId().getValueString().c_str() : "<NULL floor owner>",
|
||||
floor->getOwner() ? floor->getOwner()->getNetworkId().getValueString().c_str() : "<nullptr floor owner>",
|
||||
static_cast<int>(pathWalkResult)
|
||||
));
|
||||
return false;
|
||||
@@ -328,8 +328,8 @@ bool CollisionWorldNamespace::testFloorCollision(FloorLocator const &startFloorL
|
||||
collisionObject = destinationFloor->getOwner();
|
||||
if (!collisionObject)
|
||||
{
|
||||
// We had a collision on a floor, but the floor had a NULL owner. Consider this a non-collision.
|
||||
WARNING(true, ("testFloorCollision(): floor collision occurred, destination collision floor location had a floor but floor reported a NULL owner. Calling this a non-collision."));
|
||||
// We had a collision on a floor, but the floor had a nullptr owner. Consider this a non-collision.
|
||||
WARNING(true, ("testFloorCollision(): floor collision occurred, destination collision floor location had a floor but floor reported a nullptr owner. Calling this a non-collision."));
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -447,11 +447,11 @@ void CollisionWorld::remove ( void )
|
||||
CollisionResolve::remove();
|
||||
FloorMesh::remove();
|
||||
|
||||
s_nearWarpWarningCallback = NULL;
|
||||
s_farWarpWarningCallback = NULL;
|
||||
s_nearWarpWarningCallback = nullptr;
|
||||
s_farWarpWarningCallback = nullptr;
|
||||
|
||||
delete ms_database;
|
||||
ms_database = NULL;
|
||||
ms_database = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -595,7 +595,7 @@ bool CollisionWorld::spatialSweepAndResolve(CollisionProperty * collider)
|
||||
|
||||
void CollisionWorld::update(CollisionProperty * collider, float time)
|
||||
{
|
||||
FATAL(!collider, ("CollisionWorld::update(): collider is NULL."));
|
||||
FATAL(!collider, ("CollisionWorld::update(): collider is nullptr."));
|
||||
|
||||
PROFILER_AUTO_BLOCK_DEFINE("CollisionWorld::update");
|
||||
|
||||
@@ -603,9 +603,9 @@ void CollisionWorld::update(CollisionProperty * collider, float time)
|
||||
|
||||
Footprint * foot = collider->getFootprint();
|
||||
|
||||
if(foot == NULL)
|
||||
if(foot == nullptr)
|
||||
{
|
||||
PROFILER_AUTO_BLOCK_DEFINE("CollisionWorld::update: foot == NULL");
|
||||
PROFILER_AUTO_BLOCK_DEFINE("CollisionWorld::update: foot == nullptr");
|
||||
|
||||
IGNORE_RETURN (CollisionWorld::spatialSweepAndResolve(collider));
|
||||
collider->storePosition();
|
||||
@@ -1076,11 +1076,11 @@ void CollisionWorld::setFarWarpWarningCallback(WarpWarningCallback callback)
|
||||
|
||||
void CollisionWorld::addObject ( Object * object )
|
||||
{
|
||||
if(object == NULL) return;
|
||||
if(object == nullptr) return;
|
||||
|
||||
CollisionProperty * collision = object->getCollisionProperty();
|
||||
|
||||
if((collision == NULL) || collision->getDisableCollisionWorldAddRemove()) return;
|
||||
if((collision == nullptr) || collision->getDisableCollisionWorldAddRemove()) return;
|
||||
|
||||
if(collision->isInCollisionWorld()) return;
|
||||
|
||||
@@ -1125,7 +1125,7 @@ void CollisionWorld::addObject ( Object * object )
|
||||
{
|
||||
char const * name = object->getObjectTemplateName();
|
||||
|
||||
if(name == NULL)
|
||||
if(name == nullptr)
|
||||
{
|
||||
Appearance const * appearance = object->getAppearance();
|
||||
|
||||
@@ -1162,11 +1162,11 @@ void CollisionWorld::addObject ( Object * object )
|
||||
|
||||
void CollisionWorld::removeObject ( Object * object )
|
||||
{
|
||||
if(object == NULL) return;
|
||||
if(object == nullptr) return;
|
||||
|
||||
CollisionProperty * collision = object->getCollisionProperty();
|
||||
|
||||
if((collision == NULL) || collision->getDisableCollisionWorldAddRemove()) return;
|
||||
if((collision == nullptr) || collision->getDisableCollisionWorldAddRemove()) return;
|
||||
|
||||
if(!collision->isInCollisionWorld()) return;
|
||||
|
||||
@@ -1218,11 +1218,11 @@ void CollisionWorld::removeObject ( Object * object )
|
||||
|
||||
void CollisionWorld::moveObject (Object * object)
|
||||
{
|
||||
if(object == NULL) return;
|
||||
if(object == nullptr) return;
|
||||
|
||||
CollisionProperty * collision = object->getCollisionProperty();
|
||||
|
||||
if(collision == NULL) return;
|
||||
if(collision == nullptr) return;
|
||||
|
||||
if(!collision->isInCollisionWorld()) return;
|
||||
|
||||
@@ -1248,11 +1248,11 @@ void CollisionWorld::moveObject (Object * object)
|
||||
|
||||
void CollisionWorld::cellChanged ( Object * object )
|
||||
{
|
||||
if(object == NULL) return;
|
||||
if(object == nullptr) return;
|
||||
|
||||
CollisionProperty * collision = object->getCollisionProperty();
|
||||
|
||||
if(collision == NULL) return;
|
||||
if(collision == nullptr) return;
|
||||
|
||||
if(!collision->isInCollisionWorld()) return;
|
||||
|
||||
@@ -1266,11 +1266,11 @@ void CollisionWorld::cellChanged ( Object * object )
|
||||
|
||||
void CollisionWorld::appearanceChanged ( Object * object )
|
||||
{
|
||||
if(object == NULL) return;
|
||||
if(object == nullptr) return;
|
||||
|
||||
CollisionProperty * collision = object->getCollisionProperty();
|
||||
|
||||
if(collision == NULL) return;
|
||||
if(collision == nullptr) return;
|
||||
|
||||
if(!collision->isInCollisionWorld()) return;
|
||||
|
||||
@@ -1333,12 +1333,12 @@ SpatialDatabase * CollisionWorld::getDatabase ( void )
|
||||
|
||||
void CollisionWorld::objectWarped ( Object * object )
|
||||
{
|
||||
if(object == NULL) return;
|
||||
if(object == nullptr) return;
|
||||
|
||||
CollisionProperty * collision = object->getCollisionProperty();
|
||||
|
||||
// object does not have a CollisionProperty
|
||||
if(collision == NULL) return;
|
||||
if(collision == nullptr) return;
|
||||
|
||||
// object is not in CollisionWorld
|
||||
if (!collision->isInCollisionWorld()) return;
|
||||
@@ -1458,7 +1458,7 @@ QueryInteractionResult CollisionWorld::queryInteraction ( CellProperty const * c
|
||||
if(hitTime < hitPortalTime)
|
||||
{
|
||||
outHitTime = hitTime;
|
||||
outHitObject = NULL;
|
||||
outHitObject = nullptr;
|
||||
|
||||
return QIR_HitTerrain;
|
||||
}
|
||||
@@ -1472,12 +1472,12 @@ QueryInteractionResult CollisionWorld::queryInteraction ( CellProperty const * c
|
||||
// If we did not hit a portal, the query ends in this cell.
|
||||
// If this cell is not the goal cell, then the query fails.
|
||||
|
||||
if(nextCell == NULL)
|
||||
if(nextCell == nullptr)
|
||||
{
|
||||
if(cellA != cellB)
|
||||
{
|
||||
outHitTime = 1.0f;
|
||||
outHitObject = NULL;
|
||||
outHitObject = nullptr;
|
||||
|
||||
return QIR_MissedTarget;
|
||||
}
|
||||
@@ -1702,7 +1702,7 @@ CanMoveResult CollisionWorld::canMove ( CellProperty const * startCell,
|
||||
|
||||
FloorLocator dummy;
|
||||
|
||||
return canMove( NULL, startCell, startLoc, goalPos, checkY, checkFlora, checkFauna, dummy );
|
||||
return canMove( nullptr, startCell, startLoc, goalPos, checkY, checkFlora, checkFauna, dummy );
|
||||
}
|
||||
|
||||
// ----------
|
||||
@@ -1714,7 +1714,7 @@ CanMoveResult CollisionWorld::canMove ( Object const * object,
|
||||
bool checkFlora,
|
||||
bool checkFauna )
|
||||
{
|
||||
if(object == NULL)
|
||||
if(object == nullptr)
|
||||
{
|
||||
return CMR_Error;
|
||||
}
|
||||
@@ -1766,7 +1766,7 @@ CanMoveResult CollisionWorld::canMove ( Object const * object,
|
||||
bool checkFauna,
|
||||
FloorLocator & endLoc )
|
||||
{
|
||||
if(startCell == NULL)
|
||||
if(startCell == nullptr)
|
||||
{
|
||||
startCell = CellProperty::getWorldCellProperty();
|
||||
}
|
||||
@@ -1858,7 +1858,7 @@ CanMoveResult CollisionWorld::canMove ( Object const * object,
|
||||
}
|
||||
|
||||
// ----------
|
||||
// A NULL goal cell means we don't care what cell we end up in as long as we make it to the goal
|
||||
// A nullptr goal cell means we don't care what cell we end up in as long as we make it to the goal
|
||||
|
||||
CanMoveResult CollisionWorld::canMove ( Object const * object,
|
||||
CellProperty const * startCell,
|
||||
@@ -1871,12 +1871,12 @@ CanMoveResult CollisionWorld::canMove ( Object const * object,
|
||||
{
|
||||
// ----------
|
||||
|
||||
if(startCell == NULL)
|
||||
if(startCell == nullptr)
|
||||
{
|
||||
startCell = CellProperty::getWorldCellProperty();
|
||||
}
|
||||
|
||||
if(goalCell == NULL)
|
||||
if(goalCell == nullptr)
|
||||
{
|
||||
FloorLocator dummy;
|
||||
|
||||
@@ -2233,17 +2233,17 @@ bool CollisionWorld::findFirstObstacle ( Object const * creature, float creature
|
||||
|
||||
Vector delta = testPos - startPos;
|
||||
|
||||
if(creature == NULL) return false;
|
||||
if(creature == nullptr) return false;
|
||||
|
||||
CollisionProperty const * collision = creature->getCollisionProperty();
|
||||
|
||||
if(collision == NULL) return false;
|
||||
if(collision == nullptr) return false;
|
||||
|
||||
BaseExtent const * baseExtent = collision->getExtent_p();
|
||||
|
||||
SimpleExtent const * simpleExtent = dynamic_cast<SimpleExtent const *>(baseExtent);
|
||||
|
||||
if(simpleExtent == NULL) return false;
|
||||
if(simpleExtent == nullptr) return false;
|
||||
|
||||
MultiShape const & shape = simpleExtent->getShape();
|
||||
|
||||
@@ -2253,7 +2253,7 @@ bool CollisionWorld::findFirstObstacle ( Object const * creature, float creature
|
||||
// Test collision extents
|
||||
|
||||
DetectResult minResult;
|
||||
Object const * minObject = NULL;
|
||||
Object const * minObject = nullptr;
|
||||
|
||||
typedef std::vector<Object*> ObjectVector;
|
||||
static ObjectVector statics;
|
||||
@@ -2262,7 +2262,7 @@ bool CollisionWorld::findFirstObstacle ( Object const * creature, float creature
|
||||
statics.clear();
|
||||
creatures.clear();
|
||||
|
||||
if(ms_database->queryObjects(creature->getParentCell(), shape, delta, (testStatics ? &statics : NULL), (testCreatures ? &creatures : NULL)))
|
||||
if(ms_database->queryObjects(creature->getParentCell(), shape, delta, (testStatics ? &statics : nullptr), (testCreatures ? &creatures : nullptr)))
|
||||
{
|
||||
ObjectVector::size_type const nStatics = statics.size();
|
||||
ObjectVector::size_type i;
|
||||
@@ -2271,7 +2271,7 @@ bool CollisionWorld::findFirstObstacle ( Object const * creature, float creature
|
||||
{
|
||||
Object const * obstacle = statics[i];
|
||||
|
||||
if(obstacle == NULL) continue;
|
||||
if(obstacle == nullptr) continue;
|
||||
|
||||
if(obstacle == creature) continue;
|
||||
|
||||
@@ -2292,7 +2292,7 @@ bool CollisionWorld::findFirstObstacle ( Object const * creature, float creature
|
||||
{
|
||||
Object const * obstacle = creatures[i];
|
||||
|
||||
if(obstacle == NULL) continue;
|
||||
if(obstacle == nullptr) continue;
|
||||
|
||||
if(obstacle == creature) continue;
|
||||
|
||||
@@ -2310,10 +2310,10 @@ bool CollisionWorld::findFirstObstacle ( Object const * creature, float creature
|
||||
|
||||
//-- Check for floor collisions.
|
||||
Footprint const *const footprint = collision->getFootprint();
|
||||
FloorLocator const *const floorLocator = (footprint ? footprint->getAnyContact() : NULL);
|
||||
FloorLocator const *const floorLocator = (footprint ? footprint->getAnyContact() : nullptr);
|
||||
if (floorLocator)
|
||||
{
|
||||
Object const *floorCollisionObject = NULL;
|
||||
Object const *floorCollisionObject = nullptr;
|
||||
Vector collisionLocation_w;
|
||||
|
||||
// Do the floor check.
|
||||
@@ -2372,7 +2372,7 @@ bool CollisionWorld::findFirstObstacle ( Sphere const & sphere, Vector const & g
|
||||
// Test collision extents
|
||||
|
||||
DetectResult minResult;
|
||||
Object const * minObject = NULL;
|
||||
Object const * minObject = nullptr;
|
||||
|
||||
static std::vector<Object*> statics;
|
||||
static std::vector<Object*> creatures;
|
||||
@@ -2380,7 +2380,7 @@ bool CollisionWorld::findFirstObstacle ( Sphere const & sphere, Vector const & g
|
||||
statics.clear();
|
||||
creatures.clear();
|
||||
|
||||
if(ms_database->queryObjects(CellProperty::getWorldCellProperty(), shape, delta, (testStatics ? &statics : NULL), (testCreatures ? &creatures : NULL)))
|
||||
if(ms_database->queryObjects(CellProperty::getWorldCellProperty(), shape, delta, (testStatics ? &statics : nullptr), (testCreatures ? &creatures : nullptr)))
|
||||
{
|
||||
size_t const nStatics = statics.size();
|
||||
size_t i;
|
||||
@@ -2389,7 +2389,7 @@ bool CollisionWorld::findFirstObstacle ( Sphere const & sphere, Vector const & g
|
||||
{
|
||||
Object const * obstacle = statics[i];
|
||||
|
||||
if(obstacle == NULL) continue;
|
||||
if(obstacle == nullptr) continue;
|
||||
|
||||
DetectResult result = CollisionDetect::testSphereObject(sphere,delta,obstacle);
|
||||
|
||||
@@ -2406,7 +2406,7 @@ bool CollisionWorld::findFirstObstacle ( Sphere const & sphere, Vector const & g
|
||||
{
|
||||
Object const * obstacle = creatures[i];
|
||||
|
||||
if(obstacle == NULL) continue;
|
||||
if(obstacle == nullptr) continue;
|
||||
|
||||
if(Distance2d::Distance2(obstacle->getPosition_w(),goalPos) < 0.000001) continue;
|
||||
|
||||
@@ -2437,7 +2437,7 @@ bool CollisionWorld::findFirstObstacle ( Sphere const & sphere, Vector const & g
|
||||
|
||||
bool CollisionWorld::calcBubble ( CellProperty const * cell, Vector const & point_p, float maxDistance, float & outRadius )
|
||||
{
|
||||
return calcBubble(cell,point_p,NULL,maxDistance,outRadius);
|
||||
return calcBubble(cell,point_p,nullptr,maxDistance,outRadius);
|
||||
}
|
||||
|
||||
bool CollisionWorld::calcBubble ( CellProperty const * cell, Vector const & point_p, Object const * ignoreObject, float maxDistance, float & outRadius )
|
||||
@@ -2698,16 +2698,16 @@ void CollisionWorld::handleSceneChange(std::string const & sceneId)
|
||||
Floor const * CollisionWorld::getFloorStandingOn(Object const & object)
|
||||
{
|
||||
CollisionProperty const * const objectCollisionProperty = object.getCollisionProperty();
|
||||
Footprint const * const objectFootprint = (objectCollisionProperty != NULL) ? objectCollisionProperty->getFootprint() : NULL;
|
||||
Footprint const * const objectFootprint = (objectCollisionProperty != nullptr) ? objectCollisionProperty->getFootprint() : nullptr;
|
||||
|
||||
if (objectFootprint == NULL)
|
||||
if (objectFootprint == nullptr)
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
MultiListHandle const & floorList = objectFootprint->getFloorList();
|
||||
float const objectHeight = object.getPosition_w().y;
|
||||
Floor const * resultFloor = NULL;
|
||||
Floor const * resultFloor = nullptr;
|
||||
float resultDistanceBelowObject = 0.0f;
|
||||
float dropTestHeight = std::numeric_limits<float>::min();
|
||||
|
||||
@@ -2750,7 +2750,7 @@ Floor const * CollisionWorld::getFloorStandingOn(Object const & object)
|
||||
{
|
||||
TerrainObject const * const terrainObject = TerrainObject::getConstInstance();
|
||||
|
||||
if (terrainObject != NULL)
|
||||
if (terrainObject != nullptr)
|
||||
{
|
||||
CellProperty const * const parentCell = object.getParentCell();
|
||||
|
||||
@@ -2775,7 +2775,7 @@ Floor const * CollisionWorld::getFloorStandingOn(Object const & object)
|
||||
{
|
||||
if (dropTestHeight < terrainHeight)
|
||||
{
|
||||
resultFloor = NULL;
|
||||
resultFloor = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,8 +68,8 @@ float ms_terrainLOSMaxDistance = 64.0f;
|
||||
float ms_losUprightScale = 1.5f;
|
||||
float ms_losProneScale = 1.0f;
|
||||
|
||||
PlayEffectHook ms_playEffectHook = NULL;
|
||||
IsPlayerHouseHook ms_isPlayerHouseHook = NULL;
|
||||
PlayEffectHook ms_playEffectHook = nullptr;
|
||||
IsPlayerHouseHook ms_isPlayerHouseHook = nullptr;
|
||||
|
||||
int ms_spatialSweepAndResolveDefaultMask = static_cast<int>(SpatialDatabase::Q_Static);
|
||||
|
||||
|
||||
@@ -52,9 +52,9 @@ public:
|
||||
m_normal(newNormal),
|
||||
m_surfaceId1(-1),
|
||||
m_surfaceId2(-1),
|
||||
m_cell(NULL),
|
||||
m_extent(NULL),
|
||||
m_surface(NULL)
|
||||
m_cell(nullptr),
|
||||
m_extent(nullptr),
|
||||
m_surface(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
ContactPoint::ContactPoint()
|
||||
: m_pSurface( NULL ),
|
||||
: m_pSurface( nullptr ),
|
||||
m_position( Vector::zero ),
|
||||
m_offset( 0.0f ),
|
||||
m_hitId( -1 )
|
||||
@@ -45,7 +45,7 @@ ContactPoint::ContactPoint ( ContactPoint const & locCopy )
|
||||
|
||||
bool ContactPoint::isAttached ( void ) const
|
||||
{
|
||||
return (m_hitId != -1) && (m_pSurface != NULL);
|
||||
return (m_hitId != -1) && (m_pSurface != nullptr);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -115,7 +115,7 @@ void ContactPoint::read_0000 ( Iff & iff )
|
||||
{
|
||||
m_position = iff.read_floatVector();
|
||||
m_offset = iff.read_float();
|
||||
m_pSurface = NULL;
|
||||
m_pSurface = nullptr;
|
||||
m_hitId = iff.read_int32();
|
||||
|
||||
NAN_CHECK(m_position);
|
||||
|
||||
@@ -99,11 +99,11 @@ DoorObject::DoorObject ( DoorInfo const & info, Portal * portal )
|
||||
m_doorHelper2 ( info ),
|
||||
m_delta ( info.m_delta ),
|
||||
m_portal ( portal ),
|
||||
m_neighbor ( NULL ),
|
||||
m_neighbor ( nullptr ),
|
||||
m_spring ( info.m_spring ),
|
||||
m_smoothness ( info.m_smoothness ),
|
||||
m_draw ( true ),
|
||||
m_barrier ( NULL ),
|
||||
m_barrier ( nullptr ),
|
||||
m_oldDoorPos ( Vector::maxXYZ ),
|
||||
m_wasOpen(false),
|
||||
m_isForceField( false ),
|
||||
@@ -119,7 +119,7 @@ DoorObject::DoorObject ( DoorInfo const & info, Portal * portal )
|
||||
setDebugName("Door object");
|
||||
|
||||
for (int i = 0; i < MAX_DRAWN_DOORS; ++i)
|
||||
m_drawnDoor[i] = NULL;
|
||||
m_drawnDoor[i] = nullptr;
|
||||
|
||||
createAppearance(info);
|
||||
createTrigger(info);
|
||||
@@ -131,7 +131,7 @@ DoorObject::DoorObject ( DoorInfo const & info, Portal * portal )
|
||||
DoorObject::~DoorObject()
|
||||
{
|
||||
m_hitByObjects.clear();
|
||||
m_portal = NULL;
|
||||
m_portal = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -181,7 +181,7 @@ DoorObject const * DoorObject::getNeighbor ( void ) const
|
||||
int DoorObject::getNumberOfDrawnDoors ( void )
|
||||
{
|
||||
for (int i = 0; i < MAX_DRAWN_DOORS; ++i)
|
||||
if (m_drawnDoor[i] == NULL)
|
||||
if (m_drawnDoor[i] == nullptr)
|
||||
return i;
|
||||
|
||||
return MAX_DRAWN_DOORS;
|
||||
@@ -210,7 +210,7 @@ void DoorObject::createAppearance ( DoorInfo const & info )
|
||||
{
|
||||
Appearance * const appearance = AppearanceTemplateList::createAppearance(info.m_frameAppearance);
|
||||
|
||||
if (appearance != NULL) {
|
||||
if (appearance != nullptr) {
|
||||
setAppearance(appearance);
|
||||
} else {
|
||||
DEBUG_WARNING(true, ("FIX ME: Appearance template for DoorObject::createAppearance missing, first stanza."));
|
||||
@@ -233,7 +233,7 @@ void DoorObject::createAppearance ( DoorInfo const & info )
|
||||
Collision3d::MovePolyOnto(verts,Vector::zero);
|
||||
Appearance * appearance = CellProperty::createForceField(verts,gs_forceFieldColor);
|
||||
|
||||
if(appearance != NULL)
|
||||
if(appearance != nullptr)
|
||||
{
|
||||
m_drawnDoor[0]->setAppearance( appearance );
|
||||
Extent * appearanceExtent = new Extent( Containment3d::EncloseSphere(verts) );
|
||||
@@ -249,7 +249,7 @@ void DoorObject::createAppearance ( DoorInfo const & info )
|
||||
{
|
||||
Appearance * const appearance = AppearanceTemplateList::createAppearance(info.m_doorAppearance);
|
||||
|
||||
if (appearance != NULL) {
|
||||
if (appearance != nullptr) {
|
||||
m_drawnDoor[0]->setAppearance(appearance);
|
||||
} else {
|
||||
DEBUG_WARNING(true, ("FIX ME: Appearance template for DoorObject::createAppearance missing, third stanza."));
|
||||
@@ -263,7 +263,7 @@ void DoorObject::createAppearance ( DoorInfo const & info )
|
||||
|
||||
Appearance * const appearance = AppearanceTemplateList::createAppearance(info.m_doorAppearance2);
|
||||
|
||||
if (appearance != NULL) {
|
||||
if (appearance != nullptr) {
|
||||
m_drawnDoor[1]->setAppearance(appearance);
|
||||
} else {
|
||||
DEBUG_WARNING(true, ("FIX ME: Appearance template for DoorObject::createAppearance missing, fourth stanza."));
|
||||
@@ -476,7 +476,7 @@ float DoorObject::tween ( float t ) const
|
||||
|
||||
void DoorObject::hitBy( CollisionProperty const * collision )
|
||||
{
|
||||
if(collision == NULL) return;
|
||||
if(collision == nullptr) return;
|
||||
|
||||
CellProperty const * doorCell = getParentCell();
|
||||
CellProperty const * doorNeighborCell = m_neighbor ? m_neighbor->getParentCell() : doorCell;
|
||||
@@ -533,7 +533,7 @@ void DoorObject::setNeighbor ( DoorObject * newNeighbor )
|
||||
if (newNeighbor)
|
||||
m_barrier->setNeighbor( newNeighbor->m_barrier );
|
||||
else
|
||||
m_barrier->setNeighbor( NULL );
|
||||
m_barrier->setNeighbor( nullptr );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -587,7 +587,7 @@ void DoorObject::trackHitByObject(Object const &hitByObject)
|
||||
if (static_cast<int>(m_hitByObjects.size()) >= cs_maxHitByObjectsToTrack)
|
||||
return;
|
||||
|
||||
// NOTE: This can't be a set because the key's value can change when a watcher's value changes from non-NULL to NULL.
|
||||
// NOTE: This can't be a set because the key's value can change when a watcher's value changes from non-nullptr to nullptr.
|
||||
// Check if the object already exists in the list.
|
||||
if (std::find(m_hitByObjects.begin(), m_hitByObjects.end(), ConstWatcher<Object>(&hitByObject)) != m_hitByObjects.end())
|
||||
return;
|
||||
@@ -607,7 +607,7 @@ void DoorObject::maintainHitByObjectVector()
|
||||
// Remove any objects that no longer exist or no longer are within the trigger radius.
|
||||
for (WatcherObjectVector::iterator it = m_hitByObjects.begin(); it != m_hitByObjects.end(); )
|
||||
{
|
||||
if (it->getPointer() == NULL)
|
||||
if (it->getPointer() == nullptr)
|
||||
{
|
||||
// This hit-by object has been deleted so clear it out of the tracking list.
|
||||
it = m_hitByObjects.erase(it);
|
||||
|
||||
@@ -49,8 +49,8 @@ Floor::Floor( FloorMesh const * pMesh, Object const * owner, Appearance const *
|
||||
m_mesh(pMesh),
|
||||
m_footList(this,1),
|
||||
m_databaseList(this,1),
|
||||
m_spatialSubdivisionHandle(NULL),
|
||||
m_extent(NULL),
|
||||
m_spatialSubdivisionHandle(nullptr),
|
||||
m_extent(nullptr),
|
||||
m_extentDirty(true),
|
||||
m_sphere_l(),
|
||||
m_sphere_w()
|
||||
@@ -104,15 +104,15 @@ Floor::~Floor()
|
||||
}
|
||||
|
||||
const_cast<FloorMesh*>(m_mesh)->releaseReference();
|
||||
m_mesh = NULL;
|
||||
m_mesh = nullptr;
|
||||
|
||||
m_owner = NULL;
|
||||
m_appearance = NULL;
|
||||
m_owner = nullptr;
|
||||
m_appearance = nullptr;
|
||||
|
||||
m_spatialSubdivisionHandle = NULL;
|
||||
m_spatialSubdivisionHandle = nullptr;
|
||||
|
||||
delete m_extent;
|
||||
m_extent = NULL;
|
||||
m_extent = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -255,7 +255,7 @@ bool Floor::segTestBounds ( Vector const & begin, Vector const & end ) const
|
||||
|
||||
Object const * Floor::getOwner ( void ) const
|
||||
{
|
||||
if(m_owner != NULL)
|
||||
if(m_owner != nullptr)
|
||||
{
|
||||
return m_owner;
|
||||
}
|
||||
@@ -265,7 +265,7 @@ Object const * Floor::getOwner ( void ) const
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ Object const * Floor::getOwner ( void ) const
|
||||
|
||||
Appearance const * Floor::getAppearance ( void ) const
|
||||
{
|
||||
if(m_appearance != NULL)
|
||||
if(m_appearance != nullptr)
|
||||
{
|
||||
return m_appearance;
|
||||
}
|
||||
@@ -283,7 +283,7 @@ Appearance const * Floor::getAppearance ( void ) const
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -301,7 +301,7 @@ CellProperty const * Floor::getCell ( void ) const
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -657,7 +657,7 @@ NetworkId const & Floor::getId() const
|
||||
{
|
||||
CellProperty const * const cellProperty = getCell();
|
||||
|
||||
return (cellProperty != NULL) ? cellProperty->getOwner().getNetworkId() : NetworkId::cms_invalid;
|
||||
return (cellProperty != nullptr) ? cellProperty->getOwner().getNetworkId() : NetworkId::cms_invalid;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -34,7 +34,7 @@ FloorTri gs_dummyFloorTri;
|
||||
FloorLocator::FloorLocator()
|
||||
: ContactPoint(),
|
||||
m_valid(false),
|
||||
m_floor(NULL),
|
||||
m_floor(nullptr),
|
||||
m_radius(0.0f),
|
||||
m_time(0.0f),
|
||||
m_edgeId(-1),
|
||||
@@ -47,7 +47,7 @@ FloorLocator::FloorLocator()
|
||||
// ----------
|
||||
|
||||
FloorLocator::FloorLocator( Floor const * floor, Vector const & localPoint, int triId, float dist, float radius )
|
||||
: ContactPoint((floor ? floor->getFloorMesh() : NULL),localPoint,triId,dist),
|
||||
: ContactPoint((floor ? floor->getFloorMesh() : nullptr),localPoint,triId,dist),
|
||||
m_valid(true),
|
||||
m_floor(floor),
|
||||
m_radius(radius),
|
||||
@@ -64,7 +64,7 @@ FloorLocator::FloorLocator( Floor const * floor, Vector const & localPoint, int
|
||||
FloorLocator::FloorLocator( CollisionSurface const * mesh, Vector const & point, int triId, float dist, float radius )
|
||||
: ContactPoint(mesh,point,triId,dist),
|
||||
m_valid(true),
|
||||
m_floor(NULL),
|
||||
m_floor(nullptr),
|
||||
m_radius(radius),
|
||||
m_time(0.0f),
|
||||
m_edgeId(-1),
|
||||
@@ -78,7 +78,7 @@ FloorLocator::FloorLocator( CollisionSurface const * mesh, Vector const & point,
|
||||
// ----------
|
||||
|
||||
FloorLocator::FloorLocator( Floor const * floor, Vector const & localPoint )
|
||||
: ContactPoint((floor ? floor->getFloorMesh() : NULL),localPoint,-1,0.0f),
|
||||
: ContactPoint((floor ? floor->getFloorMesh() : nullptr),localPoint,-1,0.0f),
|
||||
m_valid(true),
|
||||
m_floor(floor),
|
||||
m_radius(0.0f),
|
||||
@@ -95,7 +95,7 @@ FloorLocator::FloorLocator( Floor const * floor, Vector const & localPoint )
|
||||
FloorLocator::FloorLocator( CollisionSurface const * mesh, Vector const & point )
|
||||
: ContactPoint(mesh,point,-1,0.0f),
|
||||
m_valid(true),
|
||||
m_floor(NULL),
|
||||
m_floor(nullptr),
|
||||
m_radius(0.0f),
|
||||
m_time(0.0f),
|
||||
m_edgeId(-1),
|
||||
@@ -109,9 +109,9 @@ FloorLocator::FloorLocator( CollisionSurface const * mesh, Vector const & point
|
||||
// ----------
|
||||
|
||||
FloorLocator::FloorLocator( Vector const & point, float radius )
|
||||
: ContactPoint(NULL,point,-1,0.0f),
|
||||
: ContactPoint(nullptr,point,-1,0.0f),
|
||||
m_valid(true),
|
||||
m_floor(NULL),
|
||||
m_floor(nullptr),
|
||||
m_radius(radius),
|
||||
m_time(0.0f),
|
||||
m_edgeId(-1),
|
||||
@@ -226,7 +226,7 @@ void FloorLocator::setFloor ( Floor const * newFloor )
|
||||
}
|
||||
else
|
||||
{
|
||||
if(getFloorMesh() == NULL)
|
||||
if(getFloorMesh() == nullptr)
|
||||
{
|
||||
Vector oldPos = getPosition_p();
|
||||
|
||||
@@ -239,7 +239,7 @@ void FloorLocator::setFloor ( Floor const * newFloor )
|
||||
}
|
||||
else
|
||||
{
|
||||
m_floor = NULL;
|
||||
m_floor = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -289,7 +289,7 @@ CellProperty const * FloorLocator::getCell ( void ) const
|
||||
{
|
||||
if(getFloorMesh())
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -312,7 +312,7 @@ CellProperty * FloorLocator::getCell ( void )
|
||||
{
|
||||
if(getFloorMesh())
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -417,7 +417,7 @@ void FloorLocator::write ( Iff & iff ) const
|
||||
|
||||
void FloorLocator::detach ( void )
|
||||
{
|
||||
setFloor(NULL);
|
||||
setFloor(nullptr);
|
||||
setId(-1);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
namespace FloorManagerNamespace
|
||||
{
|
||||
|
||||
ObjectFactory ms_pathGraphFactory = NULL;
|
||||
ObjectWriter ms_pathGraphWriter = NULL;
|
||||
ObjectRenderer ms_pathGraphRenderer = NULL;
|
||||
ObjectFactory ms_pathGraphFactory = nullptr;
|
||||
ObjectWriter ms_pathGraphWriter = nullptr;
|
||||
ObjectRenderer ms_pathGraphRenderer = nullptr;
|
||||
|
||||
};
|
||||
|
||||
@@ -72,7 +72,7 @@ Floor * FloorManager::createFloor ( const char * floorMeshFilename, Object const
|
||||
if(!pMesh)
|
||||
{
|
||||
WARNING(true, ("Could not find floor mesh %s", floorMeshFilename));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------
|
||||
|
||||
@@ -78,8 +78,8 @@ const Tag TAG_BTRE = TAG(B,T,R,E);
|
||||
const Tag TAG_BEDG = TAG(B,E,D,G);
|
||||
const Tag TAG_PGRF = TAG(P,G,R,F);
|
||||
|
||||
template <> FloorMeshList::CreateDataResourceMap *FloorMeshList::ms_bindings = NULL;
|
||||
template <> FloorMeshList::LoadedDataResourceMap *FloorMeshList::ms_loaded = NULL;
|
||||
template <> FloorMeshList::CreateDataResourceMap *FloorMeshList::ms_bindings = nullptr;
|
||||
template <> FloorMeshList::LoadedDataResourceMap *FloorMeshList::ms_loaded = nullptr;
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -92,20 +92,20 @@ FloorMesh::FloorMesh(const std::string & filename)
|
||||
m_uncrossableEdges( new FloorEdgeIdVec() ),
|
||||
m_wallBaseEdges( new FloorEdgeIdVec() ),
|
||||
m_wallTopEdges( new FloorEdgeIdVec() ),
|
||||
m_pathGraph(NULL),
|
||||
m_appearance(NULL),
|
||||
m_pathGraph(nullptr),
|
||||
m_appearance(nullptr),
|
||||
m_triMarkCounter(1000), // just some random number
|
||||
m_objectFloor(false)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
|
||||
m_crossableLines = NULL;
|
||||
m_uncrossableLines = NULL;
|
||||
m_interiorLines = NULL;
|
||||
m_portalLines = NULL;
|
||||
m_rampLines = NULL;
|
||||
m_fallthroughTriLines = NULL;
|
||||
m_solidTriLines = NULL;
|
||||
m_crossableLines = nullptr;
|
||||
m_uncrossableLines = nullptr;
|
||||
m_interiorLines = nullptr;
|
||||
m_portalLines = nullptr;
|
||||
m_rampLines = nullptr;
|
||||
m_fallthroughTriLines = nullptr;
|
||||
m_solidTriLines = nullptr;
|
||||
|
||||
#endif
|
||||
}
|
||||
@@ -121,8 +121,8 @@ FloorMesh::FloorMesh( VectorVector const & vertices, IntVector const & indices )
|
||||
m_uncrossableEdges( new FloorEdgeIdVec() ),
|
||||
m_wallBaseEdges( new FloorEdgeIdVec() ),
|
||||
m_wallTopEdges( new FloorEdgeIdVec() ),
|
||||
m_pathGraph(NULL),
|
||||
m_appearance(NULL),
|
||||
m_pathGraph(nullptr),
|
||||
m_appearance(nullptr),
|
||||
m_triMarkCounter(1000),
|
||||
m_objectFloor(false)
|
||||
{
|
||||
@@ -130,13 +130,13 @@ FloorMesh::FloorMesh( VectorVector const & vertices, IntVector const & indices )
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
m_crossableLines = NULL;
|
||||
m_uncrossableLines = NULL;
|
||||
m_interiorLines = NULL;
|
||||
m_portalLines = NULL;
|
||||
m_rampLines = NULL;
|
||||
m_fallthroughTriLines = NULL;
|
||||
m_solidTriLines = NULL;
|
||||
m_crossableLines = nullptr;
|
||||
m_uncrossableLines = nullptr;
|
||||
m_interiorLines = nullptr;
|
||||
m_portalLines = nullptr;
|
||||
m_rampLines = nullptr;
|
||||
m_fallthroughTriLines = nullptr;
|
||||
m_solidTriLines = nullptr;
|
||||
|
||||
#endif
|
||||
}
|
||||
@@ -146,50 +146,50 @@ FloorMesh::FloorMesh( VectorVector const & vertices, IntVector const & indices )
|
||||
FloorMesh::~FloorMesh()
|
||||
{
|
||||
delete m_vertices;
|
||||
m_vertices = NULL;
|
||||
m_vertices = nullptr;
|
||||
|
||||
delete m_floorTris;
|
||||
m_floorTris = NULL;
|
||||
m_floorTris = nullptr;
|
||||
|
||||
delete m_crossableEdges;
|
||||
m_crossableEdges = NULL;
|
||||
m_crossableEdges = nullptr;
|
||||
|
||||
delete m_uncrossableEdges;
|
||||
m_crossableEdges = NULL;
|
||||
m_crossableEdges = nullptr;
|
||||
|
||||
delete m_wallBaseEdges;
|
||||
m_wallBaseEdges = NULL;
|
||||
m_wallBaseEdges = nullptr;
|
||||
|
||||
delete m_wallTopEdges;
|
||||
m_wallTopEdges = NULL;
|
||||
m_wallTopEdges = nullptr;
|
||||
|
||||
delete m_pathGraph;
|
||||
m_pathGraph = NULL;
|
||||
m_pathGraph = nullptr;
|
||||
|
||||
m_appearance = NULL;
|
||||
m_appearance = nullptr;
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
delete m_crossableLines;
|
||||
m_crossableLines = NULL;
|
||||
m_crossableLines = nullptr;
|
||||
|
||||
delete m_uncrossableLines;
|
||||
m_uncrossableLines = NULL;
|
||||
m_uncrossableLines = nullptr;
|
||||
|
||||
delete m_interiorLines;
|
||||
m_interiorLines = NULL;
|
||||
m_interiorLines = nullptr;
|
||||
|
||||
delete m_portalLines;
|
||||
m_portalLines = NULL;
|
||||
m_portalLines = nullptr;
|
||||
|
||||
delete m_rampLines;
|
||||
m_rampLines = NULL;
|
||||
m_rampLines = nullptr;
|
||||
|
||||
delete m_fallthroughTriLines;
|
||||
m_fallthroughTriLines = NULL;
|
||||
m_fallthroughTriLines = nullptr;
|
||||
|
||||
delete m_solidTriLines;
|
||||
m_solidTriLines = NULL;
|
||||
m_solidTriLines = nullptr;
|
||||
|
||||
#endif
|
||||
}
|
||||
@@ -833,7 +833,7 @@ void FloorMesh::write ( Iff & iff )
|
||||
|
||||
// ----------
|
||||
|
||||
if(m_boxTree != NULL)
|
||||
if(m_boxTree != nullptr)
|
||||
{
|
||||
m_boxTree->write(iff);
|
||||
}
|
||||
@@ -1772,7 +1772,7 @@ bool FloorMesh::canEnterEdge ( FloorLocator const & enterLoc ) const
|
||||
{
|
||||
if(enterLoc.getEdgeId() == -1) return false;
|
||||
if(enterLoc.getTriId() == -1) return false;
|
||||
if(enterLoc.getFloorMesh() == NULL) return false;
|
||||
if(enterLoc.getFloorMesh() == nullptr) return false;
|
||||
|
||||
// Can't enter the tri if it's facing down
|
||||
|
||||
@@ -1837,7 +1837,7 @@ bool FloorMesh::canExitEdge ( FloorLocator const & exitLoc, Vector const & delta
|
||||
{
|
||||
if(exitLoc.getTriId() == -1) return false;
|
||||
if(exitLoc.getEdgeId() == -1) return false;
|
||||
if(exitLoc.getFloorMesh() == NULL) return false;
|
||||
if(exitLoc.getFloorMesh() == nullptr) return false;
|
||||
|
||||
FloorEdgeType edgeType = exitLoc.getFloorTri().getEdgeType(exitLoc.getEdgeId());
|
||||
|
||||
@@ -3808,7 +3808,7 @@ void FloorMesh::drawDebugShapes ( DebugShapeRenderer * renderer, bool drawExtent
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
if(ConfigSharedCollision::getDrawFloors())
|
||||
{
|
||||
|
||||
@@ -92,7 +92,7 @@ static bool epsilonEqual( float value, float target, float epsilon )
|
||||
Footprint::Footprint ( Vector const & position, float radius, CollisionProperty * parent, const float swimHeight )
|
||||
: BaseClass(),
|
||||
m_parent(parent),
|
||||
m_cellObject(NULL),
|
||||
m_cellObject(nullptr),
|
||||
m_position_p(Vector::zero),
|
||||
m_position_w(Vector::zero),
|
||||
m_radius(radius),
|
||||
@@ -112,9 +112,9 @@ Footprint::Footprint ( Vector const & position, float radius, CollisionProperty
|
||||
#ifdef _DEBUG
|
||||
,
|
||||
m_backupPosition_p(position),
|
||||
m_backupCell(NULL),
|
||||
m_backupCell(nullptr),
|
||||
m_backupObjectPosition_p(position),
|
||||
m_backupObjectCell(NULL),
|
||||
m_backupObjectCell(nullptr),
|
||||
m_lineHitTime( -1.0f ),
|
||||
m_lineOrigin( Vector(0.0f,1.5f,0.0f) ),
|
||||
m_lineDelta( Vector(0.0f,0.0f,10.0f) ),
|
||||
@@ -137,8 +137,8 @@ Footprint::~Footprint()
|
||||
{
|
||||
detach();
|
||||
|
||||
m_parent = NULL;
|
||||
m_cellObject = NULL;
|
||||
m_parent = nullptr;
|
||||
m_cellObject = nullptr;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
@@ -334,7 +334,7 @@ Object * Footprint::getOwner ( void )
|
||||
|
||||
void Footprint::addContact ( FloorLocator const & loc )
|
||||
{
|
||||
if(loc.getFloor() == NULL)
|
||||
if(loc.getFloor() == nullptr)
|
||||
{
|
||||
FLOOR_LOG("Footprint::addContact - loc isn't attached to a floor\n");
|
||||
}
|
||||
@@ -445,7 +445,7 @@ void Footprint::setSwimHeight ( float swimHeight )
|
||||
|
||||
Vector const & Footprint::getPosition_p ( void ) const
|
||||
{
|
||||
if(m_cellObject.getPointer() == NULL)
|
||||
if(m_cellObject.getPointer() == nullptr)
|
||||
{
|
||||
WARNING(true,("Footprint::getPosition_p - Footprint's parent cell has disappeared"));
|
||||
|
||||
@@ -525,7 +525,7 @@ void Footprint::setPosition ( CellProperty * pNewCell, Vector const & pos )
|
||||
{
|
||||
NAN_CHECK(pos);
|
||||
|
||||
if(pNewCell == NULL) pNewCell = CellProperty::getWorldCellProperty();
|
||||
if(pNewCell == nullptr) pNewCell = CellProperty::getWorldCellProperty();
|
||||
|
||||
m_cellObject = &(pNewCell->getOwner());
|
||||
m_position_p = pos;
|
||||
@@ -808,13 +808,13 @@ void Footprint::runDebugTests ( void )
|
||||
IGNORE_RETURN(CollisionWorld::calcBubble(getCell(),getPosition_p(),20.0f,m_bubbleSize));
|
||||
*/
|
||||
|
||||
Object const * hitObject = NULL;
|
||||
Object const * hitObject = nullptr;
|
||||
|
||||
QueryInteractionResult result = CollisionWorld::queryInteraction(objCell,
|
||||
objPos + m_lineOrigin,
|
||||
objCell,
|
||||
objPos + m_lineOrigin + delta,
|
||||
NULL,
|
||||
nullptr,
|
||||
!ConfigSharedCollision::getIgnoreTerrainLos(),
|
||||
ConfigSharedCollision::getGenerateTerrainLos(),
|
||||
ConfigSharedCollision::getTerrainLOSMinDistance(),
|
||||
@@ -843,14 +843,14 @@ FloorLocator const * Footprint::getAnyContact ( void ) const
|
||||
if(contact->m_contact.isAttached()) return &contact->m_contact;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------
|
||||
|
||||
FloorLocator const * Footprint::getSolidContact ( void ) const
|
||||
{
|
||||
FloorLocator const * temp = NULL;
|
||||
FloorLocator const * temp = nullptr;
|
||||
|
||||
float maxHeight = -REAL_MAX;
|
||||
|
||||
@@ -883,11 +883,11 @@ Object const * Footprint::getStandingOn ( void ) const
|
||||
{
|
||||
FloorLocator const * contact = getSolidContact();
|
||||
|
||||
if(contact == NULL) return NULL;
|
||||
if(contact == nullptr) return nullptr;
|
||||
|
||||
Floor const * floor = contact->getFloor();
|
||||
|
||||
if(floor == NULL) return NULL;
|
||||
if(floor == nullptr) return nullptr;
|
||||
|
||||
return floor->getOwner();
|
||||
}
|
||||
@@ -921,9 +921,9 @@ bool Footprint::snapToCellFloor ( void )
|
||||
|
||||
bool Footprint::isAttachedTo ( Floor const * floor ) const
|
||||
{
|
||||
if(floor == NULL) return false;
|
||||
if(floor == nullptr) return false;
|
||||
|
||||
return getFloorList().find( floor->getFootList() ) != NULL;
|
||||
return getFloorList().find( floor->getFootList() ) != nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -1114,7 +1114,7 @@ void Footprint::updateOffsets ( void )
|
||||
|
||||
bool Footprint::attachTo ( Floor const * floor, bool fromObject )
|
||||
{
|
||||
if(floor == NULL) return false;
|
||||
if(floor == nullptr) return false;
|
||||
|
||||
if(isAttachedTo(floor)) return false;
|
||||
|
||||
@@ -1240,7 +1240,7 @@ int Footprint::elevatorMove ( int nFloors, Transform & outTransform )
|
||||
// ----------
|
||||
// Find the contact that's on the cell's floor
|
||||
|
||||
FloorContactShape const * cellContact = NULL;
|
||||
FloorContactShape const * cellContact = nullptr;
|
||||
|
||||
for(ConstContactIterator it(getFloorList()); it; ++it)
|
||||
{
|
||||
@@ -1261,7 +1261,7 @@ int Footprint::elevatorMove ( int nFloors, Transform & outTransform )
|
||||
}
|
||||
}
|
||||
|
||||
if(cellContact == NULL)
|
||||
if(cellContact == nullptr)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1328,7 +1328,7 @@ void Footprint::drawDebugShapes ( DebugShapeRenderer * renderer ) const
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
if(ConfigSharedCollision::getDrawFootprints())
|
||||
{
|
||||
@@ -1525,7 +1525,7 @@ void Footprint::alignToGroundNoFloat ( void )
|
||||
if (owner)
|
||||
DEBUG_WARNING(true, ("Footprint::alignToGroundNoFloat(): called on object id=[%s],template=[%s] when no ground could be found.", owner->getNetworkId().getValueString().c_str(), owner->getObjectTemplateName()));
|
||||
else
|
||||
DEBUG_WARNING(true, ("Footprint::alignToGroundNoFloat(): called on object id=[<NULL owner>],template=[<NULL owner>] when no ground could be found."));
|
||||
DEBUG_WARNING(true, ("Footprint::alignToGroundNoFloat(): called on object id=[<nullptr owner>],template=[<nullptr owner>] when no ground could be found."));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@ namespace FootprintForceReattachManagerNamespace
|
||||
|
||||
DataTable const * const dt = DataTableManager::getTable(ms_datatableName, true);
|
||||
|
||||
if (NULL == dt)
|
||||
if (nullptr == dt)
|
||||
WARNING(true, ("FootprintForceReattachManager unable to find [%s]", ms_datatableName));
|
||||
else
|
||||
{
|
||||
|
||||
@@ -14,8 +14,8 @@
|
||||
MultiListHandle::MultiListHandle( BaseClass * object, int color )
|
||||
: m_color(color),
|
||||
m_object(object),
|
||||
m_head(NULL),
|
||||
m_tail(NULL)
|
||||
m_head(nullptr),
|
||||
m_tail(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -23,9 +23,9 @@ MultiListHandle::~MultiListHandle()
|
||||
{
|
||||
IGNORE_RETURN( detach() );
|
||||
|
||||
m_object = NULL;
|
||||
m_head = NULL;
|
||||
m_tail = NULL;
|
||||
m_object = nullptr;
|
||||
m_head = nullptr;
|
||||
m_tail = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -55,7 +55,7 @@ MultiListNode * MultiListHandle::detachHead ( void )
|
||||
}
|
||||
else
|
||||
{
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ MultiListHandle * MultiListHandle::detach ( void )
|
||||
|
||||
bool MultiListHandle::isConnected ( void ) const
|
||||
{
|
||||
return m_head != NULL;
|
||||
return m_head != nullptr;
|
||||
}
|
||||
|
||||
// ----------
|
||||
@@ -97,7 +97,7 @@ void MultiListHandle::erase ( MultiListNode * node )
|
||||
|
||||
bool MultiListHandle::isEmpty ( void ) const
|
||||
{
|
||||
return m_head == NULL;
|
||||
return m_head == nullptr;
|
||||
}
|
||||
|
||||
// ----------
|
||||
@@ -109,8 +109,8 @@ void MultiListHandle::insert( MultiListNode * node, MultiListNode * prev, MultiL
|
||||
DEBUG_FATAL( next == node, ("MultiListHandle::insert - Next and node are the same "));
|
||||
DEBUG_FATAL( (prev || next) && (prev == next), ("MultiListHandle::insert - Prev and Next are the same"));
|
||||
|
||||
// verify that the node to insert is not null
|
||||
DEBUG_FATAL( node == NULL, ("MultiListHandle::insert - Cannot insert null node"));
|
||||
// verify that the node to insert is not nullptr
|
||||
DEBUG_FATAL( node == nullptr, ("MultiListHandle::insert - Cannot insert nullptr node"));
|
||||
|
||||
// verify that the nodes we're inserting between are adjacent
|
||||
DEBUG_FATAL( prev && (prev->m_next[m_color] != next), ("MultiListHandle::insert - Prev and Next are not adjacent"));
|
||||
@@ -155,7 +155,7 @@ void MultiListHandle::connectTo( MultiListHandle & handle, BaseClass * data )
|
||||
|
||||
void MultiListHandle::insert( MultiListNode * node )
|
||||
{
|
||||
insert( node, NULL, m_head );
|
||||
insert( node, nullptr, m_head );
|
||||
}
|
||||
|
||||
// ----------
|
||||
@@ -175,9 +175,9 @@ MultiListNode * MultiListHandle::detach ( MultiListNode * node )
|
||||
|
||||
// ----------
|
||||
|
||||
node->m_next[m_color] = NULL;
|
||||
node->m_prev[m_color] = NULL;
|
||||
node->m_list[m_color] = NULL;
|
||||
node->m_next[m_color] = nullptr;
|
||||
node->m_prev[m_color] = nullptr;
|
||||
node->m_list[m_color] = nullptr;
|
||||
}
|
||||
|
||||
return node;
|
||||
@@ -221,7 +221,7 @@ MultiListNode * MultiListHandle::find ( MultiListHandle & testHandle )
|
||||
cursor = cursor->m_next[m_color];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
} //lint !e1764 // testHandle could be made const ref
|
||||
|
||||
MultiListNode const * MultiListHandle::find ( MultiListHandle const & testHandle ) const
|
||||
@@ -240,7 +240,7 @@ MultiListNode const * MultiListHandle::find ( MultiListHandle const & testHandle
|
||||
cursor = cursor->m_next[m_color];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------
|
||||
@@ -288,13 +288,13 @@ void MultiListHandle::destroyNodes ( void )
|
||||
// ======================================================================
|
||||
|
||||
MultiListNode::MultiListNode()
|
||||
: m_data(NULL)
|
||||
: m_data(nullptr)
|
||||
{
|
||||
for(int i = 0; i < nColors; i++)
|
||||
{
|
||||
m_next[i] = NULL;
|
||||
m_prev[i] = NULL;
|
||||
m_list[i] = NULL;
|
||||
m_next[i] = nullptr;
|
||||
m_prev[i] = nullptr;
|
||||
m_list[i] = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,7 +303,7 @@ MultiListNode::~MultiListNode()
|
||||
IGNORE_RETURN( detach() );
|
||||
|
||||
BaseClass * data = m_data;
|
||||
m_data = NULL;
|
||||
m_data = nullptr;
|
||||
delete data;
|
||||
}
|
||||
|
||||
@@ -346,7 +346,7 @@ BaseClass * MultiListNode::getObject ( int color )
|
||||
if(m_list[color])
|
||||
return m_list[color]->getObject();
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
} //lint !e1762 // function could be const
|
||||
|
||||
|
||||
@@ -355,7 +355,7 @@ BaseClass const * MultiListNode::getObject ( int color ) const
|
||||
if(m_list[color])
|
||||
return m_list[color]->getObject();
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------
|
||||
@@ -375,7 +375,7 @@ void MultiListNode::setData( BaseClass * data )
|
||||
if(m_data == data) return;
|
||||
|
||||
BaseClass * deadData = m_data;
|
||||
m_data = NULL;
|
||||
m_data = nullptr;
|
||||
delete deadData;
|
||||
m_data = data;
|
||||
}
|
||||
@@ -403,7 +403,7 @@ void MultiListNode::swapNext ( int color )
|
||||
|
||||
/*
|
||||
MultiList::MultiList()
|
||||
: m_free(0,NULL)
|
||||
: m_free(0,nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -411,7 +411,7 @@ MultiList::MultiList()
|
||||
|
||||
bool MultiList::connect ( MultiListHandle * red, MultiListHandle * blue )
|
||||
{
|
||||
return connect(red,blue,NULL);
|
||||
return connect(red,blue,nullptr);
|
||||
}
|
||||
|
||||
// ----------
|
||||
@@ -436,7 +436,7 @@ bool MultiList::connect ( MultiListHandle & red, MultiListHandle & blue, BaseCla
|
||||
|
||||
bool MultiList::connected( MultiListHandle & red, MultiListHandle & blue )
|
||||
{
|
||||
return red.find(blue) != NULL;
|
||||
return red.find(blue) != nullptr;
|
||||
}
|
||||
|
||||
// ----------
|
||||
@@ -450,7 +450,7 @@ bool MultiList::disconnect( MultiListHandle & red, MultiListHandle & blue )
|
||||
|
||||
MultiListNode * MultiList::getFreeNode ( void )
|
||||
{
|
||||
if(m_free.m_head == NULL)
|
||||
if(m_free.m_head == nullptr)
|
||||
{
|
||||
return new MultiListNode();
|
||||
}
|
||||
@@ -502,8 +502,8 @@ void MultiList::insert( MultiListHandle * node, MultiListHandle * prev, MultiLis
|
||||
DEBUG_FATAL( next == node, ("MultiList::insert - Next and Node are the same"));
|
||||
DEBUG_FATAL( prev == next, ("MultiList::insert - Prev and Next are the same"));
|
||||
|
||||
// verify that the node to insert is not null
|
||||
DEBUG_FATAL( node == NULL, ("MultiList::insert - Cannot insert a null node"));
|
||||
// verify that the node to insert is not nullptr
|
||||
DEBUG_FATAL( node == nullptr, ("MultiList::insert - Cannot insert a nullptr node"));
|
||||
|
||||
// verify that the two nodes are adjacent
|
||||
DEBUG_FATAL( prev && (prev->m_next != next), ("MultiList::insert - Prev and Next are not adjacent"));
|
||||
@@ -539,7 +539,7 @@ void MultiList::insert( MultiListHandle * node, MultiListHandle * prev, MultiLis
|
||||
|
||||
MultiListHandle * MultiList::detach( MultiListHandle * node )
|
||||
{
|
||||
DEBUG_FATAL( node == NULL, ("MultiList::detach - Cannot detach null node"));
|
||||
DEBUG_FATAL( node == nullptr, ("MultiList::detach - Cannot detach nullptr node"));
|
||||
DEBUG_FATAL( node->m_list != this, ("MultiList::detach - Node is not part of this list"));
|
||||
|
||||
// ----------
|
||||
@@ -555,9 +555,9 @@ MultiListHandle * MultiList::detach( MultiListHandle * node )
|
||||
if(m_head[color] == node) m_head[color] = node->m_next;
|
||||
if(m_tail[color] == node) m_tail[color] = node->m_prev;
|
||||
|
||||
node->m_prev = NULL;
|
||||
node->m_next = NULL;
|
||||
node->m_list = NULL;
|
||||
node->m_prev = nullptr;
|
||||
node->m_next = nullptr;
|
||||
node->m_list = nullptr;
|
||||
|
||||
return node;
|
||||
}
|
||||
@@ -566,13 +566,13 @@ MultiListHandle * MultiList::detach( MultiListHandle * node )
|
||||
|
||||
void MultiList::insert( MultiListHandle * node )
|
||||
{
|
||||
DEBUG_FATAL(node == NULL, ("MultiList::insert - Cannot insert NULL node"));
|
||||
DEBUG_FATAL(node == nullptr, ("MultiList::insert - Cannot insert nullptr node"));
|
||||
|
||||
// ----------
|
||||
|
||||
int color = node->m_color;
|
||||
|
||||
insert(node,NULL,m_head[color]);
|
||||
insert(node,nullptr,m_head[color]);
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
@@ -168,12 +168,12 @@ public:
|
||||
if(m_node)
|
||||
return safe_cast<T const *>(m_node->getObject(m_valueColor));
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
operator bool ( void ) const
|
||||
{
|
||||
return m_node != NULL;
|
||||
return m_node != nullptr;
|
||||
}
|
||||
|
||||
void operator ++ ( void )
|
||||
@@ -212,12 +212,12 @@ public:
|
||||
if(m_node)
|
||||
return safe_cast<T *>(m_node->getObject(m_valueColor));
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
operator bool ( void ) const
|
||||
{
|
||||
return m_node != NULL;
|
||||
return m_node != nullptr;
|
||||
}
|
||||
|
||||
void operator ++ ( void )
|
||||
@@ -246,7 +246,7 @@ public:
|
||||
|
||||
MultiListConstDataIterator( void )
|
||||
{
|
||||
m_node = NULL;
|
||||
m_node = nullptr;
|
||||
m_color = -1;
|
||||
}
|
||||
|
||||
@@ -281,12 +281,12 @@ public:
|
||||
if(m_node)
|
||||
return safe_cast<T const *>(m_node->getData());
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
operator bool ( void ) const
|
||||
{
|
||||
return m_node != NULL;
|
||||
return m_node != nullptr;
|
||||
}
|
||||
|
||||
void operator ++ ( void )
|
||||
@@ -310,7 +310,7 @@ public:
|
||||
|
||||
MultiListDataIterator( void )
|
||||
{
|
||||
m_node = NULL;
|
||||
m_node = nullptr;
|
||||
m_color = -1;
|
||||
}
|
||||
|
||||
@@ -345,12 +345,12 @@ public:
|
||||
if(m_node)
|
||||
return safe_cast<T *>(m_node->getData());
|
||||
else
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
operator bool ( void ) const
|
||||
{
|
||||
return m_node != NULL;
|
||||
return m_node != nullptr;
|
||||
}
|
||||
|
||||
void operator ++ ( void )
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
NeighborObject::NeighborObject()
|
||||
: m_neighbor(NULL)
|
||||
: m_neighbor(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ SimpleCollisionMesh::SimpleCollisionMesh( IndexedTriangleList * tris )
|
||||
SimpleCollisionMesh::~SimpleCollisionMesh()
|
||||
{
|
||||
delete m_tris;
|
||||
m_tris = NULL;
|
||||
m_tris = nullptr;
|
||||
delete m_bucket;
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ void SimpleCollisionMesh::drawDebugShapes ( DebugShapeRenderer * renderer ) cons
|
||||
UNREF(renderer);
|
||||
|
||||
#ifdef _DEBUG
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
if (s_renderCollisionBuckets)
|
||||
{
|
||||
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
* This functionality is used on the client to prevent a door from visually opening for
|
||||
* a mounted creature or a rider. The actual stop logic for movement is on the server.
|
||||
*
|
||||
* @param callback If NULL, no check is made. If non-NULL, the callback is called
|
||||
* @param callback If nullptr, no check is made. If non-nullptr, the callback is called
|
||||
* any time a mobile is detected to have collided with a DoorObject.
|
||||
* The return value of the callback dictates whether the hit() and hitBy()
|
||||
* logic is called on the mobile and door. If the return value of callback
|
||||
@@ -152,29 +152,29 @@ SpatialDatabase::SpatialDatabase()
|
||||
SpatialDatabase::~SpatialDatabase ( void )
|
||||
{
|
||||
delete m_staticTree;
|
||||
m_staticTree = NULL;
|
||||
m_staticTree = nullptr;
|
||||
|
||||
delete m_dynamicTree;
|
||||
m_dynamicTree = NULL;
|
||||
m_dynamicTree = nullptr;
|
||||
|
||||
delete m_doorTree;
|
||||
m_doorTree = NULL;
|
||||
m_doorTree = nullptr;
|
||||
|
||||
delete m_barrierTree;
|
||||
m_barrierTree = NULL;
|
||||
m_barrierTree = nullptr;
|
||||
|
||||
delete m_floorTree;
|
||||
m_floorTree = NULL;
|
||||
m_floorTree = nullptr;
|
||||
|
||||
delete m_ignoreStack;
|
||||
m_ignoreStack = NULL;
|
||||
m_ignoreStack = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
bool SpatialDatabase::canCollideWithStatics ( CollisionProperty * collision ) const
|
||||
{
|
||||
if(collision == NULL) return false;
|
||||
if(collision == nullptr) return false;
|
||||
|
||||
// On the client, remote creatures and players don't collide with statics
|
||||
|
||||
@@ -207,10 +207,10 @@ bool SpatialDatabase::canCollideWithStatics ( CollisionProperty * collision ) co
|
||||
|
||||
bool SpatialDatabase::canCollideWithStatic ( Object const * mobObject, Object * staticObject ) const
|
||||
{
|
||||
// Objects can't collide with NULL
|
||||
// Objects can't collide with nullptr
|
||||
|
||||
if(mobObject == NULL) return false;
|
||||
if(staticObject == NULL) return false;
|
||||
if(mobObject == nullptr) return false;
|
||||
if(staticObject == nullptr) return false;
|
||||
|
||||
// Objects can't collide with themselves
|
||||
|
||||
@@ -223,7 +223,7 @@ bool SpatialDatabase::canCollideWithStatic ( Object const * mobObject, Object *
|
||||
|
||||
bool SpatialDatabase::canCollideWithCreatures ( CollisionProperty const * collision ) const
|
||||
{
|
||||
if(collision == NULL) return false;
|
||||
if(collision == nullptr) return false;
|
||||
|
||||
if(collision->isPlayerControlled() && collision->isServerSide())
|
||||
{
|
||||
@@ -253,9 +253,9 @@ bool SpatialDatabase::canCollideWithCreature ( Object * player, Object * creatur
|
||||
|
||||
bool SpatialDatabase::canWalkOnFloor ( CollisionProperty * collision ) const
|
||||
{
|
||||
if(collision == NULL) return false;
|
||||
if(collision == nullptr) return false;
|
||||
|
||||
if(collision->getFootprint() == NULL) return false;
|
||||
if(collision->getFootprint() == nullptr) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -470,12 +470,12 @@ void SpatialDatabase::updateCreatureCollision(CollisionProperty * playerCollisio
|
||||
|
||||
bool SpatialDatabase::addObject(Query const query, Object * const object)
|
||||
{
|
||||
if(object == NULL)
|
||||
if(object == nullptr)
|
||||
return false;
|
||||
|
||||
CollisionProperty * collision = object->getCollisionProperty();
|
||||
|
||||
if(collision == NULL)
|
||||
if(collision == nullptr)
|
||||
return false;
|
||||
|
||||
if(collision->getSpatialSubdivisionHandle())
|
||||
@@ -511,15 +511,15 @@ bool SpatialDatabase::addObject(Query const query, Object * const object)
|
||||
|
||||
bool SpatialDatabase::removeObject(Query const query, Object * const object)
|
||||
{
|
||||
if(object == NULL)
|
||||
if(object == nullptr)
|
||||
return false;
|
||||
|
||||
CollisionProperty * collision = object->getCollisionProperty();
|
||||
|
||||
if(collision == NULL)
|
||||
if(collision == nullptr)
|
||||
return false;
|
||||
|
||||
if(collision->getSpatialSubdivisionHandle() == NULL)
|
||||
if(collision->getSpatialSubdivisionHandle() == nullptr)
|
||||
return false;
|
||||
|
||||
switch (query)
|
||||
@@ -548,7 +548,7 @@ bool SpatialDatabase::removeObject(Query const query, Object * const object)
|
||||
break;
|
||||
}
|
||||
|
||||
collision->setSpatialSubdivisionHandle(NULL);
|
||||
collision->setSpatialSubdivisionHandle(nullptr);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -645,7 +645,7 @@ bool SpatialDatabase::checkIgnoreObject ( Object const * object ) const
|
||||
|
||||
bool SpatialDatabase::addFloor ( Floor * floor )
|
||||
{
|
||||
if(floor == NULL) return false;
|
||||
if(floor == nullptr) return false;
|
||||
|
||||
if(floor->getSpatialSubdivisionHandle()) return false;
|
||||
|
||||
@@ -660,15 +660,15 @@ bool SpatialDatabase::addFloor ( Floor * floor )
|
||||
|
||||
bool SpatialDatabase::removeFloor ( Floor * floor )
|
||||
{
|
||||
if(floor == NULL) return false;
|
||||
if(floor == nullptr) return false;
|
||||
|
||||
if(floor->getSpatialSubdivisionHandle() == NULL) return false;
|
||||
if(floor->getSpatialSubdivisionHandle() == nullptr) return false;
|
||||
|
||||
// ----------
|
||||
|
||||
m_floorTree->removeObject( floor->getSpatialSubdivisionHandle() );
|
||||
|
||||
floor->setSpatialSubdivisionHandle(NULL);
|
||||
floor->setSpatialSubdivisionHandle(nullptr);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -684,11 +684,11 @@ int SpatialDatabase::getFloorCount ( void ) const
|
||||
|
||||
bool SpatialDatabase::moveObject ( CollisionProperty * collision )
|
||||
{
|
||||
if(collision == NULL) return false;
|
||||
if(collision == nullptr) return false;
|
||||
|
||||
SpatialSubdivisionHandle * handle = collision->getSpatialSubdivisionHandle();
|
||||
|
||||
if(handle == NULL) return false;
|
||||
if(handle == nullptr) return false;
|
||||
|
||||
// ----------
|
||||
|
||||
@@ -729,7 +729,7 @@ bool SpatialDatabase::queryStatics ( AxialBox const & box, ObjectVec * outList )
|
||||
|
||||
bool SpatialDatabase::queryStatics ( MultiShape const & shape, ObjectVec * outList ) const
|
||||
{
|
||||
return queryStatics( NULL, shape, outList );
|
||||
return queryStatics( nullptr, shape, outList );
|
||||
}
|
||||
|
||||
// ----------
|
||||
@@ -779,21 +779,21 @@ bool SpatialDatabase::queryStatics ( Line3d const & line, ObjectVec * outList )
|
||||
|
||||
bool SpatialDatabase::queryStatics ( CellProperty const * cell, MultiShape const & shape, ObjectVec * outList ) const
|
||||
{
|
||||
return queryObjects(cell,shape,outList,NULL);
|
||||
return queryObjects(cell,shape,outList,nullptr);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
bool SpatialDatabase::queryDynamics ( Sphere const & sphere, ObjectVec * outList ) const
|
||||
{
|
||||
return queryObjects( NULL, MultiShape(sphere), NULL, outList );
|
||||
return queryObjects( nullptr, MultiShape(sphere), nullptr, outList );
|
||||
}
|
||||
|
||||
// ----------
|
||||
|
||||
bool SpatialDatabase::queryDynamics ( MultiShape const & shape, ObjectVec * outList ) const
|
||||
{
|
||||
return queryObjects( NULL, shape, NULL, outList );
|
||||
return queryObjects( nullptr, shape, nullptr, outList );
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -982,7 +982,7 @@ bool SpatialDatabase::queryCloseStatics ( Vector const & point_w, float maxDista
|
||||
float minClose;
|
||||
float maxClose;
|
||||
|
||||
CollisionProperty * dummy = NULL;
|
||||
CollisionProperty * dummy = nullptr;
|
||||
|
||||
if(m_staticTree->findClosest(point_w,maxDistance,dummy,minClose,maxClose))
|
||||
{
|
||||
@@ -1001,7 +1001,7 @@ bool SpatialDatabase::queryCloseFloors ( Vector const & point_w, float maxDistan
|
||||
float minClose;
|
||||
float maxClose;
|
||||
|
||||
Floor * dummy = NULL;
|
||||
Floor * dummy = nullptr;
|
||||
|
||||
if(m_floorTree->findClosest(point_w,maxDistance,dummy,minClose,maxClose))
|
||||
{
|
||||
@@ -1163,7 +1163,7 @@ bool SpatialDatabase::queryMaterial ( CellProperty const * cell,
|
||||
// TODO: why are we skipping out on the tests when the extent is a MeshExtent???
|
||||
MeshExtent const * mesh = dynamic_cast<MeshExtent const *>(extent);
|
||||
|
||||
if(mesh != NULL) continue;
|
||||
if(mesh != nullptr) continue;
|
||||
|
||||
Range hitRange = extent->rangedIntersect(seg_p);
|
||||
|
||||
@@ -1244,7 +1244,7 @@ bool SpatialDatabase::queryMaterial ( CellProperty const * cellA,
|
||||
CollisionProperty * collisionB = results[i];
|
||||
|
||||
NOT_NULL(collisionB);
|
||||
if (collisionB == NULL)
|
||||
if (collisionB == nullptr)
|
||||
continue;
|
||||
|
||||
// ----------
|
||||
|
||||
@@ -394,7 +394,7 @@ void BoxExtent::drawDebugShapes ( DebugShapeRenderer * renderer ) const
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
renderer->setColor( VectorArgb::solidBlue );
|
||||
renderer->drawBox(m_box);
|
||||
|
||||
@@ -49,11 +49,11 @@ int CollisionDetect::getTestCounter ( void )
|
||||
|
||||
BaseExtent const * getCollisionExtent_p ( Object const * obj )
|
||||
{
|
||||
if(obj == NULL) return NULL;
|
||||
if(obj == nullptr) return nullptr;
|
||||
|
||||
CollisionProperty const * collision = obj->getCollisionProperty();
|
||||
|
||||
if(!collision) return NULL;
|
||||
if(!collision) return nullptr;
|
||||
|
||||
return collision->getExtent_p();
|
||||
}
|
||||
@@ -62,8 +62,8 @@ BaseExtent const * getCollisionExtent_p ( Object const * obj )
|
||||
|
||||
DetectResult CollisionDetect::testObjects ( Object const * objA, Object const * objB )
|
||||
{
|
||||
if(objA == NULL) return false;
|
||||
if(objB == NULL) return false;
|
||||
if(objA == nullptr) return false;
|
||||
if(objB == nullptr) return false;
|
||||
|
||||
// ----------
|
||||
|
||||
@@ -85,8 +85,8 @@ DetectResult CollisionDetect::testObjects ( Object const * objA, Object const *
|
||||
|
||||
DetectResult CollisionDetect::testObjects ( Object const * objA, Vector const & velocity, Object const * objB )
|
||||
{
|
||||
if(objA == NULL) return false;
|
||||
if(objB == NULL) return false;
|
||||
if(objA == nullptr) return false;
|
||||
if(objB == nullptr) return false;
|
||||
|
||||
// ----------
|
||||
|
||||
@@ -108,8 +108,8 @@ DetectResult CollisionDetect::testObjects ( Object const * objA, Vector const &
|
||||
|
||||
DetectResult CollisionDetect::testObjectsAsCylinders ( Object const * objA, Object const * objB )
|
||||
{
|
||||
if(objA == NULL) return false;
|
||||
if(objB == NULL) return false;
|
||||
if(objA == nullptr) return false;
|
||||
if(objB == nullptr) return false;
|
||||
|
||||
// ----------
|
||||
|
||||
@@ -133,7 +133,7 @@ DetectResult CollisionDetect::testObjectsAsCylinders ( Object const * objA, Obje
|
||||
|
||||
DetectResult CollisionDetect::testObjectExtent ( Object const * objA, BaseExtent const * extentB )
|
||||
{
|
||||
if(objA == NULL) return false;
|
||||
if(objA == nullptr) return false;
|
||||
|
||||
CollisionProperty const * collA = objA->getCollisionProperty();
|
||||
|
||||
@@ -158,7 +158,7 @@ DetectResult CollisionDetect::testSphereExtent ( Sphere const & sphereA, BaseExt
|
||||
|
||||
// don't return a DetectResult that contains a pointer to a temporary
|
||||
|
||||
result.extentA = NULL;
|
||||
result.extentA = nullptr;
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -175,7 +175,7 @@ DetectResult CollisionDetect::testSphereExtent ( Sphere const & sphereA, Vector
|
||||
|
||||
// don't return a DetectResult that contains a pointer to a temporary
|
||||
|
||||
result.extentA = NULL;
|
||||
result.extentA = nullptr;
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -184,7 +184,7 @@ DetectResult CollisionDetect::testSphereExtent ( Sphere const & sphereA, Vector
|
||||
|
||||
DetectResult CollisionDetect::testSphereObject ( Sphere const & sphereA, Object const * objB )
|
||||
{
|
||||
if(objB == NULL) return false;
|
||||
if(objB == nullptr) return false;
|
||||
|
||||
CollisionProperty const * collB = objB->getCollisionProperty();
|
||||
|
||||
@@ -201,7 +201,7 @@ DetectResult CollisionDetect::testSphereObject ( Sphere const & sphereA, Object
|
||||
|
||||
DetectResult CollisionDetect::testSphereObject ( Sphere const & sphereA, Vector const & velocity, Object const * objB )
|
||||
{
|
||||
if(objB == NULL) return false;
|
||||
if(objB == nullptr) return false;
|
||||
|
||||
CollisionProperty const * collB = objB->getCollisionProperty();
|
||||
|
||||
@@ -332,8 +332,8 @@ DetectResult CollisionDetect::testCapsuleObjectAgainstAllTypes(Capsule const & c
|
||||
|
||||
DetectResult CollisionDetect::testExtents ( BaseExtent const * extentA, BaseExtent const * extentB )
|
||||
{
|
||||
if(extentA == NULL) return false;
|
||||
if(extentB == NULL) return false;
|
||||
if(extentA == nullptr) return false;
|
||||
if(extentB == nullptr) return false;
|
||||
|
||||
ExtentType typeA = extentA->getType();
|
||||
ExtentType typeB = extentB->getType();
|
||||
@@ -352,8 +352,8 @@ DetectResult CollisionDetect::testExtents ( BaseExtent const * extentA, BaseExte
|
||||
|
||||
DetectResult CollisionDetect::testExtents ( BaseExtent const * extentA, Vector const & velocity, BaseExtent const * extentB )
|
||||
{
|
||||
if(extentA == NULL) return false;
|
||||
if(extentB == NULL) return false;
|
||||
if(extentA == nullptr) return false;
|
||||
if(extentB == nullptr) return false;
|
||||
|
||||
ExtentType typeA = extentA->getType();
|
||||
ExtentType typeB = extentB->getType();
|
||||
@@ -372,8 +372,8 @@ DetectResult CollisionDetect::testExtents ( BaseExtent const * extentA, Vector c
|
||||
|
||||
DetectResult CollisionDetect::testExtentsAsCylinders ( BaseExtent const * extentA, BaseExtent const * extentB )
|
||||
{
|
||||
if(extentA == NULL) return false;
|
||||
if(extentB == NULL) return false;
|
||||
if(extentA == nullptr) return false;
|
||||
if(extentB == nullptr) return false;
|
||||
|
||||
SimpleExtent const * simpleExtentA = safe_cast<SimpleExtent const * >(extentA);
|
||||
SimpleExtent const * simpleExtentB = safe_cast<SimpleExtent const * >(extentB);
|
||||
|
||||
@@ -25,16 +25,16 @@ public:
|
||||
DetectResult()
|
||||
: collided(false),
|
||||
collisionTime(Range::empty),
|
||||
extentA(NULL),
|
||||
extentB(NULL)
|
||||
extentA(nullptr),
|
||||
extentB(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
DetectResult ( bool result )
|
||||
: collided(result),
|
||||
collisionTime( result ? Range::inf : Range::empty ),
|
||||
extentA(NULL),
|
||||
extentB(NULL)
|
||||
extentA(nullptr),
|
||||
extentB(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -31,11 +31,11 @@ CompositeExtent::~CompositeExtent()
|
||||
{
|
||||
delete m_extents->at(i);
|
||||
|
||||
m_extents->at(i) = NULL;
|
||||
m_extents->at(i) = nullptr;
|
||||
}
|
||||
|
||||
delete m_extents;
|
||||
m_extents = NULL;
|
||||
m_extents = nullptr;
|
||||
|
||||
}
|
||||
|
||||
@@ -116,7 +116,7 @@ void CompositeExtent::drawDebugShapes ( DebugShapeRenderer * renderer ) const
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
for(int i = 0; i < getExtentCount(); i++)
|
||||
{
|
||||
|
||||
@@ -146,7 +146,7 @@ void CylinderExtent::drawDebugShapes ( DebugShapeRenderer * renderer ) const
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
renderer->setColor( VectorArgb::solidGreen );
|
||||
renderer->drawCylinder(m_cylinder);
|
||||
|
||||
@@ -232,11 +232,11 @@ void DetailExtent::updateBounds ( void )
|
||||
|
||||
int countExtents ( BaseExtent const * extent )
|
||||
{
|
||||
if(extent == NULL) return 0;
|
||||
if(extent == nullptr) return 0;
|
||||
|
||||
CompositeExtent const * composite = dynamic_cast<CompositeExtent const *>(extent);
|
||||
|
||||
if(composite == NULL) return 1;
|
||||
if(composite == nullptr) return 1;
|
||||
|
||||
int accum = 0;
|
||||
|
||||
|
||||
@@ -369,7 +369,7 @@ void Extent::drawDebugShapes ( DebugShapeRenderer * renderer ) const
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
renderer->setColor( VectorArgb::solidYellow );
|
||||
renderer->drawSphere(m_sphere);
|
||||
|
||||
@@ -44,7 +44,7 @@ Extent * ExtentList::nullFactory ( Iff & iff )
|
||||
|
||||
IGNORE_RETURN( iff.goForward() );
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
@@ -110,7 +110,7 @@ void ExtentList::remove(void)
|
||||
|
||||
void ExtentList::assignBinding(Tag tag, CreateFunction createFunction)
|
||||
{
|
||||
DEBUG_FATAL(!createFunction, ("createFunction may not be NULL"));
|
||||
DEBUG_FATAL(!createFunction, ("createFunction may not be nullptr"));
|
||||
|
||||
(*ms_bindImpl.m_map) [tag] = createFunction;
|
||||
}
|
||||
@@ -133,7 +133,7 @@ void ExtentList::removeBinding(Tag tag)
|
||||
/**
|
||||
* Fetch an Extent.
|
||||
*
|
||||
* This routine may be passed NULL.
|
||||
* This routine may be passed nullptr.
|
||||
*
|
||||
* This routine will increase the reference count of the specified extent.
|
||||
*
|
||||
@@ -165,7 +165,7 @@ Extent * ExtentList::create(Iff & iff)
|
||||
|
||||
// handle no extents
|
||||
if (iff.atEndOfForm())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
const Tag tag = iff.getCurrentName();
|
||||
|
||||
@@ -201,7 +201,7 @@ const Extent *ExtentList::fetch(Iff & iff)
|
||||
/**
|
||||
* Release an Extent.
|
||||
*
|
||||
* This routine may be passed NULL.
|
||||
* This routine may be passed nullptr.
|
||||
*
|
||||
* This routine will decrement the reference count of the Extent. When
|
||||
* the reference count becomes 0, the Extent will be deleted.
|
||||
|
||||
@@ -62,15 +62,15 @@ SimpleCollisionMesh * MeshExtent::createMesh( IndexedTriangleList * tris )
|
||||
|
||||
MeshExtent::MeshExtent()
|
||||
: Extent(ET_Mesh),
|
||||
m_mesh(NULL),
|
||||
m_mesh(nullptr),
|
||||
m_box()
|
||||
{
|
||||
m_mesh = createMesh(NULL);
|
||||
m_mesh = createMesh(nullptr);
|
||||
}
|
||||
|
||||
MeshExtent::MeshExtent( IndexedTriangleList * tris )
|
||||
: Extent(ET_Mesh),
|
||||
m_mesh(NULL),
|
||||
m_mesh(nullptr),
|
||||
m_box()
|
||||
{
|
||||
m_mesh = createMesh(tris);
|
||||
@@ -86,7 +86,7 @@ MeshExtent::MeshExtent( SimpleCollisionMesh * mesh )
|
||||
MeshExtent::~MeshExtent()
|
||||
{
|
||||
delete m_mesh;
|
||||
m_mesh = NULL;
|
||||
m_mesh = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -168,7 +168,7 @@ void MeshExtent::drawDebugShapes ( DebugShapeRenderer * renderer ) const
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
renderer->setColor( VectorArgb::solidWhite );
|
||||
m_mesh->drawDebugShapes(renderer);
|
||||
|
||||
@@ -106,7 +106,7 @@ void OrientedCylinderExtent::drawDebugShapes ( DebugShapeRenderer * renderer ) c
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
renderer->setColor( VectorArgb::solidGreen );
|
||||
renderer->draw(m_cylinder);
|
||||
|
||||
@@ -146,7 +146,7 @@ void SimpleExtent::drawDebugShapes ( DebugShapeRenderer * renderer ) const
|
||||
|
||||
#ifdef _DEBUG
|
||||
|
||||
if(renderer == NULL) return;
|
||||
if(renderer == nullptr) return;
|
||||
|
||||
switch( getShape().getShapeType() )
|
||||
{
|
||||
|
||||
@@ -48,8 +48,8 @@ BitBuffer::BitBuffer(void *buffer, int size, bool inputStream)
|
||||
current(base),
|
||||
bufSize(size)
|
||||
{
|
||||
DEBUG_FATAL(!buffer, ("buffer null"));
|
||||
DEBUG_FATAL(!current, ("buffer null"));
|
||||
DEBUG_FATAL(!buffer, ("buffer nullptr"));
|
||||
DEBUG_FATAL(!current, ("buffer nullptr"));
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -59,8 +59,8 @@ BitBuffer::BitBuffer(void *buffer, int size, bool inputStream)
|
||||
|
||||
BitBuffer::~BitBuffer(void)
|
||||
{
|
||||
base = NULL;
|
||||
current = NULL;
|
||||
base = nullptr;
|
||||
current = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -181,17 +181,17 @@ BitFile::BitFile(const char *fileName, bool inputStream)
|
||||
{
|
||||
if (isInput)
|
||||
{
|
||||
hFile = CreateFile(fileName, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
hFile = CreateFile(fileName, GENERIC_READ, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
// try to truncate it first
|
||||
hFile = CreateFile(fileName, GENERIC_READ | GENERIC_WRITE, 0, NULL, TRUNCATE_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
hFile = CreateFile(fileName, GENERIC_READ | GENERIC_WRITE, 0, nullptr, TRUNCATE_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
//if that fails, create it
|
||||
hFile = CreateFile(fileName, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
hFile = CreateFile(fileName, GENERIC_READ | GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ BitFile::~BitFile(void)
|
||||
}
|
||||
}
|
||||
|
||||
hFile = NULL;
|
||||
hFile = nullptr;
|
||||
|
||||
delete [] name;
|
||||
}
|
||||
@@ -224,7 +224,7 @@ BitFile::~BitFile(void)
|
||||
|
||||
int BitFile::getOffset(void) const
|
||||
{
|
||||
return static_cast<int>(SetFilePointer(hFile, 0, NULL, FILE_CURRENT));
|
||||
return static_cast<int>(SetFilePointer(hFile, 0, nullptr, FILE_CURRENT));
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -254,7 +254,7 @@ void BitFile::outputBits(uint32 code, uint32 count)
|
||||
if (!mask)
|
||||
{
|
||||
uint32 bytesWritten;
|
||||
if (!WriteFile(hFile, &rack, sizeof(rack), &bytesWritten, NULL))
|
||||
if (!WriteFile(hFile, &rack, sizeof(rack), &bytesWritten, nullptr))
|
||||
{
|
||||
DEBUG_FATAL(true,("BitFile::outputBits error %d.", GetLastError()));
|
||||
}
|
||||
@@ -280,7 +280,7 @@ void BitFile::outputRack(void)
|
||||
|
||||
if (mask != INITIAL_MASK_VALUE)
|
||||
{
|
||||
if (!WriteFile(hFile, &rack, sizeof(rack), &bytesWritten, NULL))
|
||||
if (!WriteFile(hFile, &rack, sizeof(rack), &bytesWritten, nullptr))
|
||||
{
|
||||
DEBUG_FATAL(true,("BitFile::outputRack writing error %d.", GetLastError()));
|
||||
}
|
||||
@@ -312,7 +312,7 @@ uint32 BitFile::inputBits(uint32 count)
|
||||
{
|
||||
uint32 bytesRead;
|
||||
|
||||
const BOOL result = ReadFile(hFile, &rack, sizeof(rack), &bytesRead, NULL);
|
||||
const BOOL result = ReadFile(hFile, &rack, sizeof(rack), &bytesRead, nullptr);
|
||||
|
||||
UNREF(result);
|
||||
DEBUG_FATAL(result && !bytesRead,("BitFile::inputBits hit EOF"));
|
||||
@@ -383,8 +383,8 @@ ByteBuffer::ByteBuffer(void *buffer, int size, bool inputStream)
|
||||
|
||||
ByteBuffer::~ByteBuffer(void)
|
||||
{
|
||||
base = NULL;
|
||||
current = NULL;
|
||||
base = nullptr;
|
||||
current = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -422,7 +422,7 @@ void ByteBuffer::output(byte b)
|
||||
|
||||
bool ByteBuffer::input(byte *b)
|
||||
{
|
||||
DEBUG_FATAL(!b, ("null pointer"));
|
||||
DEBUG_FATAL(!b, ("nullptr pointer"));
|
||||
DEBUG_FATAL(!isInput,("ByteBuffer::input called on output stream"));
|
||||
|
||||
if ((current - base) >= bufSize)
|
||||
@@ -446,15 +446,15 @@ ByteFile::ByteFile(const char *fileName, bool inputStream)
|
||||
{
|
||||
if (isInput)
|
||||
{
|
||||
hFile = CreateFile(fileName, GENERIC_READ, 0, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
hFile = CreateFile(fileName, GENERIC_READ, 0, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
hFile = CreateFile(fileName, GENERIC_READ | GENERIC_WRITE, 0, NULL, TRUNCATE_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
hFile = CreateFile(fileName, GENERIC_READ | GENERIC_WRITE, 0, nullptr, TRUNCATE_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
|
||||
if (hFile == INVALID_HANDLE_VALUE)
|
||||
{
|
||||
hFile = CreateFile(fileName, GENERIC_READ | GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
hFile = CreateFile(fileName, GENERIC_READ | GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -473,7 +473,7 @@ ByteFile::~ByteFile(void)
|
||||
if (hFile != INVALID_HANDLE_VALUE && !CloseHandle(hFile))
|
||||
DEBUG_FATAL(true,("ByteFile::~ByteFile - Unable to close HANDLE for file %s - Error %d", name, GetLastError()));
|
||||
|
||||
hFile = NULL;
|
||||
hFile = nullptr;
|
||||
|
||||
delete [] name;
|
||||
}
|
||||
@@ -482,7 +482,7 @@ ByteFile::~ByteFile(void)
|
||||
|
||||
int ByteFile::getOffset(void) const
|
||||
{
|
||||
return static_cast<int>(SetFilePointer(hFile, 0, NULL, FILE_CURRENT));
|
||||
return static_cast<int>(SetFilePointer(hFile, 0, nullptr, FILE_CURRENT));
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -497,7 +497,7 @@ void ByteFile::output(byte b)
|
||||
byte out = b;
|
||||
uint32 bytesWritten;
|
||||
|
||||
if (!WriteFile(hFile, &out, sizeof(byte), &bytesWritten, NULL))
|
||||
if (!WriteFile(hFile, &out, sizeof(byte), &bytesWritten, nullptr))
|
||||
{
|
||||
DEBUG_FATAL(true,("ByteFile::output error %d.", GetLastError()));
|
||||
}
|
||||
@@ -518,7 +518,7 @@ bool ByteFile::input(byte *b)
|
||||
DEBUG_FATAL(!isInput,("ByteFile::input called on output stream."));
|
||||
|
||||
uint32 bytesRead;
|
||||
BOOL result = ReadFile(hFile, b, sizeof(byte), &bytesRead, NULL);
|
||||
BOOL result = ReadFile(hFile, b, sizeof(byte), &bytesRead, nullptr);
|
||||
|
||||
// check for EOS
|
||||
return (result && !bytesRead);
|
||||
|
||||
@@ -47,7 +47,7 @@ Lz77::Lz77(uint32 _indexBitCount, uint32 _lengthBitCount)
|
||||
lookAheadSize(rawLookAheadSize + breakEven),
|
||||
treeRoot(windowSize),
|
||||
window(new byte[windowSize]),
|
||||
tree(NULL)
|
||||
tree(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -232,10 +232,10 @@ uint32 Lz77::findNextNode(uint32 node)
|
||||
* Delete a string from the tree.
|
||||
*
|
||||
* This routine performs the classic binary tree deletion algorithm.
|
||||
* If the node to be deleted has a null link in either direction, we
|
||||
* just pull the non-null link up one to replace the existing link.
|
||||
* If the node to be deleted has a nullptr link in either direction, we
|
||||
* just pull the non-nullptr link up one to replace the existing link.
|
||||
* If both links exist, we instead delete the next link in order, which
|
||||
* is guaranteed to have a null link, then replace the node to be deleted
|
||||
* is guaranteed to have a nullptr link, then replace the node to be deleted
|
||||
* with the next link.
|
||||
*/
|
||||
|
||||
@@ -286,7 +286,7 @@ uint32 Lz77::addString(uint32 newNode, uint32 *matchPosition)
|
||||
uint32 *child;
|
||||
int delta = 0;
|
||||
|
||||
DEBUG_FATAL(!matchPosition, ("matchPosition is NULL"));
|
||||
DEBUG_FATAL(!matchPosition, ("matchPosition is nullptr"));
|
||||
|
||||
if (newNode == endOfStream)
|
||||
return 0;
|
||||
|
||||
@@ -121,8 +121,8 @@ void ZlibCompressorNamespace::remove()
|
||||
|
||||
DEBUG_FATAL(static_cast<int>(ms_memoryPool.size()) != ms_poolElementCount, ("ZLibCompressor memory pool entries not all released"));
|
||||
operator delete(ms_memoryBottom);
|
||||
ms_memoryBottom = NULL;
|
||||
ms_memoryTop = NULL;
|
||||
ms_memoryBottom = nullptr;
|
||||
ms_memoryTop = nullptr;
|
||||
ms_memoryPool.clear();
|
||||
|
||||
ms_mutex.leave();
|
||||
@@ -155,12 +155,12 @@ int ZlibCompressor::compress(const void *inputBuffer, int inputSize, void *outpu
|
||||
z.avail_out = outputSize;
|
||||
z.total_out = 0;
|
||||
|
||||
z.msg = NULL;
|
||||
z.state = NULL;
|
||||
z.msg = nullptr;
|
||||
z.state = nullptr;
|
||||
|
||||
z.zalloc = allocateWrapper;
|
||||
z.zfree = freeWrapper;
|
||||
z.opaque = NULL;
|
||||
z.opaque = nullptr;
|
||||
|
||||
z.data_type = Z_BINARY;
|
||||
z.adler = 0;
|
||||
@@ -196,12 +196,12 @@ int ZlibCompressor::expand(const void *inputBuffer, int inputSize, void *outputB
|
||||
z.avail_out = outputSize;
|
||||
z.total_out = 0;
|
||||
|
||||
z.msg = NULL;
|
||||
z.state = NULL;
|
||||
z.msg = nullptr;
|
||||
z.state = nullptr;
|
||||
|
||||
z.zalloc = allocateWrapper;
|
||||
z.zfree = freeWrapper;
|
||||
z.opaque = NULL;
|
||||
z.opaque = nullptr;
|
||||
|
||||
z.data_type = Z_BINARY;
|
||||
z.adler = 0;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/* Bindable.h
|
||||
*
|
||||
* Defines classes based on built-in simple types that know how to bind themselves to
|
||||
* database queries and support null values.
|
||||
* database queries and support nullptr values.
|
||||
*
|
||||
* Each class supports the following functions:
|
||||
* bool isNull -- test whether the value is null
|
||||
* void setToNull -- set the value to null
|
||||
* getValue -- return the value (make sure you test for null before calling this. The results
|
||||
* are undefined if the Bindable is null.)
|
||||
* bool isNull -- test whether the value is nullptr
|
||||
* void setToNull -- set the value to nullptr
|
||||
* getValue -- return the value (make sure you test for nullptr before calling this. The results
|
||||
* are undefined if the Bindable is nullptr.)
|
||||
* setValue -- set the value
|
||||
*
|
||||
* ODBC version
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace DB {
|
||||
explicit Bindable(int _indicator);
|
||||
|
||||
/**
|
||||
* The size of the data, or -1 for NULL.
|
||||
* The size of the data, or -1 for nullptr.
|
||||
*/
|
||||
int indicator;
|
||||
};
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
namespace DB {
|
||||
|
||||
/** Represents a bool in C++, bound to a CHAR(1) column. The column can have the values 'Y' or 'N'.
|
||||
* TODO: use a boolean type in the database, if we can find one that allows NULL's and is fairly
|
||||
* TODO: use a boolean type in the database, if we can find one that allows nullptr's and is fairly
|
||||
* portable. (May not exist -- according to the docs, Oracle does not have a boolean datatype.)
|
||||
*/
|
||||
class BindableBool : public Bindable
|
||||
|
||||
@@ -133,11 +133,11 @@ namespace DB
|
||||
std::string getValueASCII() const;
|
||||
|
||||
/** Allocate a new string and copy the buffer to it. The caller takes responsibility
|
||||
for delete[]ing it later. (If the string is NULL, this returns a null pointer.)
|
||||
for delete[]ing it later. (If the string is nullptr, this returns a nullptr pointer.)
|
||||
*/
|
||||
char *makeCopyOfValue() const;
|
||||
|
||||
/** Set the value of the bindable string from another (null-terminated) string
|
||||
/** Set the value of the bindable string from another (nullptr-terminated) string
|
||||
|
||||
If the source buffer is too big, it FATAL's. Another alternative would be to have
|
||||
it truncate the string. Right now, it's better to FATAL to avoid hard-to-find bugs
|
||||
@@ -168,7 +168,7 @@ namespace DB
|
||||
|
||||
private:
|
||||
|
||||
char m_value[S+1]; // column of size S, plus one byte for a trailing null
|
||||
char m_value[S+1]; // column of size S, plus one byte for a trailing nullptr
|
||||
};
|
||||
|
||||
// ======================================================================
|
||||
@@ -206,7 +206,7 @@ namespace DB
|
||||
{
|
||||
if (isNull())
|
||||
{
|
||||
return strncpy(buffer,"\0",1); // in the database, a zero-length string and a NULL aren't really
|
||||
return strncpy(buffer,"\0",1); // in the database, a zero-length string and a nullptr aren't really
|
||||
// the same thing, but this is the closest we can do here.
|
||||
}
|
||||
return strncpy(buffer,m_value,(bufsize>(S+1))?(S+1):bufsize);
|
||||
@@ -259,7 +259,7 @@ namespace DB
|
||||
}
|
||||
FATAL((i==S+1) && (m_value[S]!='\0'),("Attempt to save string \"%s\" to the database. It is too long for the column.",buffer));
|
||||
indicator=i; // set indicator to actual length of string
|
||||
// m_value[S]='\0'; // guarantee null terminator -- uncomment if you remove the above FATAL
|
||||
// m_value[S]='\0'; // guarantee nullptr terminator -- uncomment if you remove the above FATAL
|
||||
}
|
||||
|
||||
template<int S>
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace DB
|
||||
|
||||
private:
|
||||
|
||||
char m_value[S+1]; // column of size S, plus one byte for a trailing null
|
||||
char m_value[S+1]; // column of size S, plus one byte for a trailing nullptr
|
||||
};
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -33,9 +33,9 @@ namespace DB
|
||||
* Combines the values in this row with the values in newRow.
|
||||
*
|
||||
* For each column:
|
||||
* If the column is null in newRow, do nothing. (Leave the value
|
||||
* If the column is nullptr in newRow, do nothing. (Leave the value
|
||||
* in this row unchanged.)
|
||||
* If the column is not null in newRow, replace the value in this
|
||||
* If the column is not nullptr in newRow, replace the value in this
|
||||
* row with the value in newRow.
|
||||
*/
|
||||
virtual void combine(const DB::Row &newRow) =0;
|
||||
|
||||
@@ -29,7 +29,7 @@ using namespace DB;
|
||||
Mutex Server::ms_profileMutex;
|
||||
bool Server::ms_enableProfiling = false;
|
||||
bool Server::ms_enableVerboseMode = false;
|
||||
DB::Profiler *Server::ms_profiler = NULL;
|
||||
DB::Profiler *Server::ms_profiler = nullptr;
|
||||
int Server::ms_reconnectTime=0;
|
||||
int Server::ms_maxErrorCountBeforeDisconnect=5;
|
||||
int Server::ms_maxErrorCountBeforeBailout=10;
|
||||
@@ -51,7 +51,7 @@ Server::SesListElem::SesListElem (Session *_ses, SesListElem *_next) : ses (_ses
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
Server::Server(const char *_dsn, const char *_uid, const char *_pwd, bool useMemoryManager) :
|
||||
sessionList (NULL),
|
||||
sessionList (nullptr),
|
||||
sessionListLock(),
|
||||
m_useMemoryManager(useMemoryManager)
|
||||
{
|
||||
@@ -194,7 +194,7 @@ Session *Server::popSession()
|
||||
else
|
||||
{
|
||||
sessionListLock.leave();
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -294,7 +294,7 @@ void Server::endProfiling()
|
||||
{
|
||||
ms_profileMutex.enter();
|
||||
delete ms_profiler;
|
||||
ms_profiler = NULL;
|
||||
ms_profiler = nullptr;
|
||||
ms_enableProfiling = false;
|
||||
ms_profileMutex.leave();
|
||||
}
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
// ======================================================================
|
||||
|
||||
/**
|
||||
* A unicode-string-compatible class that encodes a null value as a single space
|
||||
* A unicode-string-compatible class that encodes a nullptr value as a single space
|
||||
*/
|
||||
class NullEncodedStandardString
|
||||
{
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
// ======================================================================
|
||||
|
||||
/**
|
||||
* A unicode-string-compatible class that encodes a null value as a single space
|
||||
* A unicode-string-compatible class that encodes a nullptr value as a single space
|
||||
*/
|
||||
class NullEncodedUnicodeString
|
||||
{
|
||||
|
||||
@@ -22,9 +22,9 @@ using namespace DB;
|
||||
|
||||
BindableVarray::BindableVarray() :
|
||||
m_initialized(false),
|
||||
m_tdo (NULL),
|
||||
m_data (NULL),
|
||||
m_session (NULL)
|
||||
m_tdo (nullptr),
|
||||
m_data (nullptr),
|
||||
m_session (nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ bool BindableVarray::create(DB::Session *session, const std::string &name, const
|
||||
schema.length(),
|
||||
reinterpret_cast<OraText*>(const_cast<char*>(name.c_str())),
|
||||
name.length(),
|
||||
NULL,
|
||||
nullptr,
|
||||
0,
|
||||
OCI_DURATION_SESSION,
|
||||
OCI_TYPEGET_HEADER,
|
||||
@@ -64,7 +64,7 @@ bool BindableVarray::create(DB::Session *session, const std::string &name, const
|
||||
localSession->errhp,
|
||||
localSession->svchp,
|
||||
OCI_TYPECODE_VARRAY,
|
||||
m_tdo, NULL,
|
||||
m_tdo, nullptr,
|
||||
OCI_DURATION_DEFAULT,
|
||||
true,
|
||||
reinterpret_cast<void**>(&m_data)))))
|
||||
@@ -86,9 +86,9 @@ void BindableVarray::free()
|
||||
OCIObjectFree (localSession->envhp,
|
||||
localSession->errhp, m_data, 0)));
|
||||
m_initialized = false;
|
||||
m_tdo=NULL;
|
||||
m_data=NULL;
|
||||
m_session=NULL;
|
||||
m_tdo=nullptr;
|
||||
m_data=nullptr;
|
||||
m_session=nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -354,7 +354,7 @@ std::string BindableVarrayNumber::outputValue() const
|
||||
if (exists)
|
||||
{
|
||||
if (*indicator == OCI_IND_NULL)
|
||||
result += "NULL";
|
||||
result += "nullptr";
|
||||
else
|
||||
{
|
||||
double value;
|
||||
@@ -400,7 +400,7 @@ bool BindableVarrayString::push_back(const Unicode::String &value)
|
||||
|
||||
bool BindableVarrayString::push_back(const std::string &value)
|
||||
{
|
||||
OCIString *buffer = NULL;
|
||||
OCIString *buffer = nullptr;
|
||||
OCIInd buffer_indicator (OCI_IND_NOTNULL);
|
||||
OCISession *localSession = safe_cast<OCISession*>(m_session);
|
||||
|
||||
@@ -437,7 +437,7 @@ bool BindableVarrayString::push_back(bool bvalue)
|
||||
else
|
||||
value = "N";
|
||||
|
||||
OCIString *buffer = NULL;
|
||||
OCIString *buffer = nullptr;
|
||||
OCIInd buffer_indicator (OCI_IND_NOTNULL);
|
||||
OCISession *localSession = safe_cast<OCISession*>(m_session);
|
||||
|
||||
@@ -469,7 +469,7 @@ bool BindableVarrayString::push_back(bool IsNULL, const Unicode::String &value)
|
||||
|
||||
bool BindableVarrayString::push_back(bool IsNULL, const std::string &value)
|
||||
{
|
||||
OCIString *buffer = NULL;
|
||||
OCIString *buffer = nullptr;
|
||||
OCIInd buffer_indicator;
|
||||
if ( IsNULL )
|
||||
{
|
||||
@@ -515,7 +515,7 @@ bool BindableVarrayString::push_back(bool IsNULL, bool bvalue)
|
||||
else
|
||||
value = "N";
|
||||
|
||||
OCIString *buffer = NULL;
|
||||
OCIString *buffer = nullptr;
|
||||
OCIInd buffer_indicator;
|
||||
if ( IsNULL )
|
||||
{
|
||||
@@ -568,14 +568,14 @@ std::string BindableVarrayString::outputValue() const
|
||||
if (exists)
|
||||
{
|
||||
if (*indicator == OCI_IND_NULL)
|
||||
result += "NULL";
|
||||
result += "nullptr";
|
||||
else
|
||||
{
|
||||
OraText * text = OCIStringPtr(localSession->envhp, *element);
|
||||
if (text)
|
||||
result += '"' + std::string(reinterpret_cast<char*>(text)) + '"';
|
||||
else
|
||||
result += "NULL";
|
||||
result += "nullptr";
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -49,13 +49,13 @@ bool DB::OCIQueryImpl::setup(Session *session)
|
||||
{
|
||||
// setSession(session);
|
||||
|
||||
DEBUG_FATAL(m_session!=0,("m_session was not NULL"));
|
||||
DEBUG_FATAL(m_server!=0,("m_server was not NULL"));
|
||||
DEBUG_FATAL(m_session!=0,("m_session was not nullptr"));
|
||||
DEBUG_FATAL(m_server!=0,("m_server was not nullptr"));
|
||||
DEBUG_FATAL(m_stmthp!=0,("m_stmthp was not 0"));
|
||||
DEBUG_FATAL(m_cursorhp!=0,("m_cursorhp was not 0"));
|
||||
|
||||
m_session=dynamic_cast<DB::OCISession*>(session);
|
||||
FATAL((m_session==0),("Must pass a non-NULL OCISession to setup()."));
|
||||
FATAL((m_session==0),("Must pass a non-nullptr OCISession to setup()."));
|
||||
|
||||
m_server=m_session->m_server;
|
||||
NOT_NULL(m_server);
|
||||
@@ -180,7 +180,7 @@ bool DB::OCIQueryImpl::exec()
|
||||
m_session->setOkToFetch();
|
||||
m_session->setLastQueryStatement(m_sql);
|
||||
sword status=OCIStmtExecute(m_session->svchp, m_stmthp, m_session->errhp, 1, 0,
|
||||
NULL, NULL, OCI_DEFAULT);
|
||||
nullptr, nullptr, OCI_DEFAULT);
|
||||
|
||||
if (status == OCI_NO_DATA)
|
||||
{
|
||||
@@ -393,8 +393,8 @@ DB::OCIQueryImpl::BindRec::BindRec(size_t numElements) :
|
||||
length(0),
|
||||
stringAdjust(false),
|
||||
m_numElements(numElements),
|
||||
m_indicatorArray(NULL),
|
||||
m_lengthArray(NULL)
|
||||
m_indicatorArray(nullptr),
|
||||
m_lengthArray(nullptr)
|
||||
{
|
||||
// This is ugly, but it avoids having to create two different kinds of bindrecs that inherit from an abstract base class
|
||||
if (m_numElements > 1)
|
||||
@@ -714,11 +714,11 @@ bool DB::OCIQueryImpl::bindParameter(BindableVarray &buffer)
|
||||
&(br->bindp),
|
||||
m_session->errhp,
|
||||
nextParameter++,
|
||||
NULL,
|
||||
nullptr,
|
||||
0,
|
||||
SQLT_NTY,
|
||||
NULL,
|
||||
NULL,
|
||||
nullptr,
|
||||
nullptr,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
|
||||
@@ -63,7 +63,7 @@ bool DB::OCIServer::checkerr(OCISession const & session, int status)
|
||||
text errbuf[512];
|
||||
sb4 errcode = 0;
|
||||
|
||||
OCIErrorGet((dvoid *)(session.errhp), (ub4) 1, (text *) NULL, &errcode,
|
||||
OCIErrorGet((dvoid *)(session.errhp), (ub4) 1, (text *) nullptr, &errcode,
|
||||
errbuf, (ub4) sizeof(errbuf), OCI_HTYPE_ERROR);
|
||||
|
||||
WARNING(true,("Database error: %.*s",512,errbuf));
|
||||
|
||||
@@ -56,11 +56,11 @@ static void freeHook(dvoid *, dvoid *memptr)
|
||||
|
||||
DB::OCISession::OCISession(DB::OCIServer *server) :
|
||||
m_server(server),
|
||||
envhp(NULL),
|
||||
errhp(NULL),
|
||||
srvhp(NULL),
|
||||
sesp(NULL),
|
||||
svchp(NULL),
|
||||
envhp(nullptr),
|
||||
errhp(nullptr),
|
||||
srvhp(nullptr),
|
||||
sesp(nullptr),
|
||||
svchp(nullptr),
|
||||
autoCommitMode(true),
|
||||
m_resetTime(server->getReconnectTime()==0 ? 0 : time(0) + server->getReconnectTime()),
|
||||
m_okToFetch(true)
|
||||
@@ -235,11 +235,11 @@ bool DB::OCISession::disconnect()
|
||||
success = false;
|
||||
}
|
||||
|
||||
svchp = NULL;
|
||||
sesp = NULL;
|
||||
srvhp = NULL;
|
||||
errhp = NULL;
|
||||
envhp = NULL;
|
||||
svchp = nullptr;
|
||||
sesp = nullptr;
|
||||
srvhp = nullptr;
|
||||
errhp = nullptr;
|
||||
envhp = nullptr;
|
||||
|
||||
connectLock.leave();
|
||||
return success;
|
||||
|
||||
@@ -160,7 +160,7 @@ void DebugMonitor::install(void)
|
||||
// handle input from the output terminal, particularly to
|
||||
// handle profiler modifications when the output window
|
||||
// is active.
|
||||
s_outputScreen = newterm(NULL, s_ttyOutputFile, stdin);
|
||||
s_outputScreen = newterm(nullptr, s_ttyOutputFile, stdin);
|
||||
if (!s_outputScreen)
|
||||
{
|
||||
DEBUG_WARNING(true, ("DebugMonitor: newterm() failed [%s].", strerror(errno)));
|
||||
|
||||
@@ -39,7 +39,7 @@ PerformanceTimer::~PerformanceTimer()
|
||||
|
||||
void PerformanceTimer::start()
|
||||
{
|
||||
int const result = gettimeofday(&startTime, NULL);
|
||||
int const result = gettimeofday(&startTime, nullptr);
|
||||
FATAL(result != 0,("PerformanceTimer::start failed"));
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ void PerformanceTimer::resume()
|
||||
usec += 1000000;
|
||||
}
|
||||
|
||||
int const result = gettimeofday(&startTime, NULL);
|
||||
int const result = gettimeofday(&startTime, nullptr);
|
||||
FATAL(result != 0,("PerformanceTimer::resume failed"));
|
||||
|
||||
startTime.tv_sec -= sec;
|
||||
@@ -71,7 +71,7 @@ void PerformanceTimer::resume()
|
||||
|
||||
void PerformanceTimer::stop()
|
||||
{
|
||||
int result = gettimeofday(&stopTime, NULL);
|
||||
int result = gettimeofday(&stopTime, nullptr);
|
||||
FATAL(result != 0,("PerformanceTimer::start failed"));
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ float PerformanceTimer::getSplitTime() const
|
||||
{
|
||||
timeval currentTime;
|
||||
|
||||
int const result = gettimeofday(¤tTime, NULL);
|
||||
int const result = gettimeofday(¤tTime, nullptr);
|
||||
FATAL(result != 0,("PerformanceTimer::getSplitTime failed"));
|
||||
|
||||
long sec = currentTime.tv_sec - startTime.tv_sec;
|
||||
@@ -117,7 +117,7 @@ void PerformanceTimer::logElapsedTime(const char* string) const
|
||||
|
||||
#ifdef _DEBUG
|
||||
static char buffer [1000];
|
||||
sprintf(buffer, "%s : %1.5f seconds\n", string ? string : "null", getElapsedTime());
|
||||
sprintf(buffer, "%s : %1.5f seconds\n", string ? string : "nullptr", getElapsedTime());
|
||||
DEBUG_REPORT_LOG_PRINT(true, ("%s", buffer));
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -35,9 +35,9 @@ namespace DataLintNamespace
|
||||
bool ms_installed = false;
|
||||
DataLint::AssetType m_currentAssetType = DataLint::AT_invalid;
|
||||
bool m_enabled = false;
|
||||
WarningList * m_warningList = NULL;
|
||||
StringList * m_assetStack = NULL;
|
||||
DataLint::StringPairList * m_assetList = NULL;
|
||||
WarningList * m_warningList = nullptr;
|
||||
StringList * m_assetStack = nullptr;
|
||||
DataLint::StringPairList * m_assetList = nullptr;
|
||||
std::string m_dataLintCategorizedAssetsFile("DataLint_CategorizedAssets.txt");
|
||||
std::string m_dataLintUnSupportedAssetsFile("DataLint_UnSupportedAssets.txt");
|
||||
Mode m_mode = M_client;
|
||||
@@ -123,17 +123,17 @@ void DataLint::report()
|
||||
|
||||
// Client only
|
||||
|
||||
FILE *assetErrorFileAppearance = NULL;
|
||||
FILE *assetErrorFileArrangementDescriptor = NULL;
|
||||
FILE *assetErrorFileLocalizedStringTable = NULL;
|
||||
FILE *assetErrorFilePortalProperty = NULL;
|
||||
FILE *assetErrorFileShaderTemplate = NULL;
|
||||
FILE *assetErrorFileSkyBox = NULL;
|
||||
FILE *assetErrorFileSlotDescriptor = NULL;
|
||||
FILE *assetErrorFileSoundTemplate = NULL;
|
||||
FILE *assetErrorFileTerrain = NULL;
|
||||
FILE *assetErrorFileTexture = NULL;
|
||||
FILE *assetErrorFileTextureRenderer = NULL;
|
||||
FILE *assetErrorFileAppearance = nullptr;
|
||||
FILE *assetErrorFileArrangementDescriptor = nullptr;
|
||||
FILE *assetErrorFileLocalizedStringTable = nullptr;
|
||||
FILE *assetErrorFilePortalProperty = nullptr;
|
||||
FILE *assetErrorFileShaderTemplate = nullptr;
|
||||
FILE *assetErrorFileSkyBox = nullptr;
|
||||
FILE *assetErrorFileSlotDescriptor = nullptr;
|
||||
FILE *assetErrorFileSoundTemplate = nullptr;
|
||||
FILE *assetErrorFileTerrain = nullptr;
|
||||
FILE *assetErrorFileTexture = nullptr;
|
||||
FILE *assetErrorFileTextureRenderer = nullptr;
|
||||
|
||||
if (m_mode == M_client)
|
||||
{
|
||||
@@ -450,7 +450,7 @@ std::string DataLintNamespace::formatErrorMessage(WarningPair &warningPair, int
|
||||
|
||||
char *assetError = strstr(text, " : ");
|
||||
|
||||
if (assetError != NULL)
|
||||
if (assetError != nullptr)
|
||||
{
|
||||
++assetError;
|
||||
++assetError;
|
||||
@@ -567,12 +567,12 @@ void DataLint::clearAssetStack()
|
||||
//-----------------------------------------------------------------------------
|
||||
void DataLint::addFilePath(char const *filePath)
|
||||
{
|
||||
if (filePath == NULL || (strlen(filePath) <= 0))
|
||||
if (filePath == nullptr || (strlen(filePath) <= 0))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_assetList != NULL)
|
||||
if (m_assetList != nullptr)
|
||||
{
|
||||
char text[4096];
|
||||
sprintf(text, "%s", filePath);
|
||||
@@ -592,7 +592,7 @@ void DataLint::addFilePath(char const *filePath)
|
||||
//-----------------------------------------------------------------------------
|
||||
void DataLint::removeFilePath(char const *filePath)
|
||||
{
|
||||
if (m_assetList != NULL)
|
||||
if (m_assetList != nullptr)
|
||||
{
|
||||
StringPairList::iterator stringPairListIter = m_assetList->begin();
|
||||
|
||||
@@ -611,8 +611,8 @@ void DataLint::removeFilePath(char const *filePath)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool DataLintNamespace::isAnAppearanceAsset(char const *text)
|
||||
{
|
||||
bool const appearanceAsset = (strstr(text, "appearance/") != NULL);
|
||||
bool const portalPropertyAsset = (strstr(text, ".pob") != NULL);
|
||||
bool const appearanceAsset = (strstr(text, "appearance/") != nullptr);
|
||||
bool const portalPropertyAsset = (strstr(text, ".pob") != nullptr);
|
||||
|
||||
return (appearanceAsset && !portalPropertyAsset);
|
||||
}
|
||||
@@ -620,7 +620,7 @@ bool DataLintNamespace::isAnAppearanceAsset(char const *text)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool DataLintNamespace::isAnArrangementDescriptorAsset(char const *text)
|
||||
{
|
||||
bool const arrangementDescriptorAsset = (strstr(text, "slot/arrangement/") != NULL);
|
||||
bool const arrangementDescriptorAsset = (strstr(text, "slot/arrangement/") != nullptr);
|
||||
|
||||
return arrangementDescriptorAsset;
|
||||
}
|
||||
@@ -628,7 +628,7 @@ bool DataLintNamespace::isAnArrangementDescriptorAsset(char const *text)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool DataLintNamespace::isALocalizedStringAsset(char const *text)
|
||||
{
|
||||
bool const localizedStringAsset = (strstr(text, ".stf") != NULL);
|
||||
bool const localizedStringAsset = (strstr(text, ".stf") != nullptr);
|
||||
|
||||
return localizedStringAsset;
|
||||
}
|
||||
@@ -638,8 +638,8 @@ bool DataLintNamespace::isAnObjectTemplateAsset(char const *text)
|
||||
{
|
||||
bool result = false;
|
||||
UNREF(text);
|
||||
bool const isInTheObjectDirectory = (strstr(text, "object/") != NULL);
|
||||
bool const isInTheAbstractDirectory = (strstr(text, "abstract/") != NULL);
|
||||
bool const isInTheObjectDirectory = (strstr(text, "object/") != nullptr);
|
||||
bool const isInTheAbstractDirectory = (strstr(text, "abstract/") != nullptr);
|
||||
|
||||
if (isInTheObjectDirectory || isInTheAbstractDirectory)
|
||||
{
|
||||
@@ -655,7 +655,7 @@ bool DataLintNamespace::isAnObjectTemplateAsset(char const *text)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool DataLintNamespace::isAPortalProprtyAsset(char const *text)
|
||||
{
|
||||
bool const portalPropertyAsset = (strstr(text, ".pob") != NULL);
|
||||
bool const portalPropertyAsset = (strstr(text, ".pob") != nullptr);
|
||||
|
||||
return portalPropertyAsset;
|
||||
}
|
||||
@@ -663,7 +663,7 @@ bool DataLintNamespace::isAPortalProprtyAsset(char const *text)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool DataLintNamespace::isAShaderTemplateAsset(char const *text)
|
||||
{
|
||||
bool const shaderTemplateAsset = (strstr(text, "shader/") != NULL);
|
||||
bool const shaderTemplateAsset = (strstr(text, "shader/") != nullptr);
|
||||
|
||||
return shaderTemplateAsset;
|
||||
}
|
||||
@@ -671,7 +671,7 @@ bool DataLintNamespace::isAShaderTemplateAsset(char const *text)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool DataLintNamespace::isASkyBoxAsset(char const *text)
|
||||
{
|
||||
bool const skyBoxAsset = (strstr(text, "skybox/") != NULL);
|
||||
bool const skyBoxAsset = (strstr(text, "skybox/") != nullptr);
|
||||
|
||||
return skyBoxAsset;
|
||||
}
|
||||
@@ -679,7 +679,7 @@ bool DataLintNamespace::isASkyBoxAsset(char const *text)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool DataLintNamespace::isASlotDescriptorAsset(char const *text)
|
||||
{
|
||||
bool const slotDescriptorAsset = (strstr(text, "slot/descriptor/") != NULL);
|
||||
bool const slotDescriptorAsset = (strstr(text, "slot/descriptor/") != nullptr);
|
||||
|
||||
return slotDescriptorAsset;
|
||||
}
|
||||
@@ -687,7 +687,7 @@ bool DataLintNamespace::isASlotDescriptorAsset(char const *text)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool DataLintNamespace::isASoundAsset(char const *text)
|
||||
{
|
||||
bool const soundAsset = (strstr(text, "sound/") != NULL);
|
||||
bool const soundAsset = (strstr(text, "sound/") != nullptr);
|
||||
|
||||
return soundAsset;
|
||||
}
|
||||
@@ -701,7 +701,7 @@ bool DataLintNamespace::isATerrainAsset(char const *text)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool DataLintNamespace::isATextureAsset(char const *text)
|
||||
{
|
||||
bool const textureAsset = (strstr(text, ".dds") != NULL);
|
||||
bool const textureAsset = (strstr(text, ".dds") != nullptr);
|
||||
|
||||
return textureAsset;
|
||||
}
|
||||
@@ -709,7 +709,7 @@ bool DataLintNamespace::isATextureAsset(char const *text)
|
||||
//-----------------------------------------------------------------------------
|
||||
bool DataLintNamespace::isATextureRendererTemplateAsset(char const *text)
|
||||
{
|
||||
bool const textureRendererAsset = (strstr(text, ".trt") != NULL);
|
||||
bool const textureRendererAsset = (strstr(text, ".trt") != nullptr);
|
||||
|
||||
return textureRendererAsset;
|
||||
}
|
||||
@@ -749,7 +749,7 @@ bool DataLintNamespace::isAnUnSupportedAsset(char const *text)
|
||||
//-----------------------------------------------------------------------------
|
||||
DataLint::StringPairList DataLintNamespace::getList(int const reserveCount, AssetFunction assetTypeFunction)
|
||||
{
|
||||
DEBUG_FATAL(!m_assetList, ("DataLint::getList() - m_assetList is NULL"));
|
||||
DEBUG_FATAL(!m_assetList, ("DataLint::getList() - m_assetList is nullptr"));
|
||||
|
||||
// Create the list of terrains
|
||||
|
||||
|
||||
@@ -25,8 +25,8 @@ std::vector<DebugFlags::Flag> DebugFlags::ms_flagsSortedByReportPriority;
|
||||
|
||||
void DebugFlags::config(bool &variable, const char *configSection, const char *configName)
|
||||
{
|
||||
DEBUG_FATAL(strchr(configSection, ' ') != NULL, ("no spaces are allowed in debug flag section names: %s", configSection));
|
||||
DEBUG_FATAL(strchr(configName, ' ') != NULL, ("no spaces are allowed in debug flag names: %s", configName));
|
||||
DEBUG_FATAL(strchr(configSection, ' ') != nullptr, ("no spaces are allowed in debug flag section names: %s", configSection));
|
||||
DEBUG_FATAL(strchr(configName, ' ') != nullptr, ("no spaces are allowed in debug flag names: %s", configName));
|
||||
|
||||
if (configSection && configName && ConfigFile::isInstalled())
|
||||
{
|
||||
@@ -102,9 +102,9 @@ void DebugFlags::registerFlag(bool &variable, const char *section, const char *n
|
||||
f.section = section;
|
||||
f.name = name;
|
||||
f.reportPriority = 0;
|
||||
f.reportRoutine1 = NULL;
|
||||
f.reportRoutine2 = NULL;
|
||||
f.context = NULL;
|
||||
f.reportRoutine1 = nullptr;
|
||||
f.reportRoutine2 = nullptr;
|
||||
f.context = nullptr;
|
||||
#ifdef _DEBUG
|
||||
f.m_callStack.sample();
|
||||
#endif
|
||||
@@ -127,8 +127,8 @@ void DebugFlags::registerFlag(bool &variable, const char *section, const char *n
|
||||
f.name = name;
|
||||
f.reportPriority = reportPriority;
|
||||
f.reportRoutine1 = reportRoutine;
|
||||
f.reportRoutine2 = NULL;
|
||||
f.context = NULL;
|
||||
f.reportRoutine2 = nullptr;
|
||||
f.context = nullptr;
|
||||
#ifdef _DEBUG
|
||||
f.m_callStack.sample();
|
||||
#endif
|
||||
@@ -150,7 +150,7 @@ void DebugFlags::registerFlag(bool &variable, const char *section, const char *n
|
||||
f.section = section;
|
||||
f.name = name;
|
||||
f.reportPriority = reportPriority;
|
||||
f.reportRoutine1 = NULL;
|
||||
f.reportRoutine1 = nullptr;
|
||||
f.reportRoutine2 = reportRoutine;
|
||||
f.context = context;
|
||||
#ifdef _DEBUG
|
||||
@@ -230,7 +230,7 @@ DebugFlags::Flag const * DebugFlags::getFlag(char const * const section, char co
|
||||
return &f;
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -108,7 +108,7 @@ bool DebugKey::isDown(int i)
|
||||
bool DebugKey::isActive()
|
||||
{
|
||||
#if PRODUCTION == 0
|
||||
return ms_currentFlag != NULL;
|
||||
return ms_currentFlag != nullptr;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
|
||||
@@ -64,7 +64,7 @@ void InstallTimer::manualExit()
|
||||
unsigned long const endingNumberOfBytesAllocated = MemoryManager::getCurrentNumberOfBytesAllocated();
|
||||
--ms_indent;
|
||||
REPORT_LOG_PRINT(ms_enabled, ("InstallTimer:%*c%6.4f %d %s\n", ms_indent * 2, ' ', m_performanceTimer.getElapsedTime(), static_cast<int>(endingNumberOfBytesAllocated - m_startingNumberOfBytesAllocated), m_description));
|
||||
m_description = NULL;
|
||||
m_description = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -83,13 +83,13 @@ void PixCounterNamespace::remove()
|
||||
{
|
||||
#ifdef _WIN32
|
||||
FreeLibrary(ms_pixDll);
|
||||
ms_pixDll = NULL;
|
||||
ms_pixDll = nullptr;
|
||||
#endif
|
||||
|
||||
ms_setCounterFloat = NULL;
|
||||
ms_setCounterInt = NULL;
|
||||
ms_setCounterInt64 = NULL;
|
||||
ms_setCounterString = NULL;
|
||||
ms_setCounterFloat = nullptr;
|
||||
ms_setCounterInt = nullptr;
|
||||
ms_setCounterInt64 = nullptr;
|
||||
ms_setCounterString = nullptr;
|
||||
|
||||
// Make sure the counter memory gets freed at this point
|
||||
Counters().swap(ms_counters);
|
||||
@@ -379,7 +379,7 @@ PixCounter::String::String()
|
||||
: Counter(),
|
||||
m_enabled(false),
|
||||
m_lastFrameValue(),
|
||||
m_lastFrameValuePointer(NULL),
|
||||
m_lastFrameValuePointer(nullptr),
|
||||
m_currentValue()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -238,7 +238,7 @@ void Profiler::install()
|
||||
|
||||
ms_profilerEntriesCurrent = &ms_profilerEntries1;
|
||||
ms_profilerEntriesLast = &ms_profilerEntries2;
|
||||
ms_rootVisibleExpandableEntry = new VisibleExpandableEntry(NULL);
|
||||
ms_rootVisibleExpandableEntry = new VisibleExpandableEntry(nullptr);
|
||||
ms_rootVisibleExpandableEntry->setExpanded(true);
|
||||
ms_selectedVisibleExpandableEntry = ms_rootVisibleExpandableEntry;
|
||||
}
|
||||
@@ -248,13 +248,13 @@ void Profiler::install()
|
||||
void Profiler::remove()
|
||||
{
|
||||
delete ms_rootVisibleExpandableEntry;
|
||||
ms_rootVisibleExpandableEntry = NULL;
|
||||
ms_beforeSelectedVisibleExpandableEntry = NULL;
|
||||
ms_selectedVisibleExpandableEntry = NULL;
|
||||
ms_afterSelectedVisibleExpandableEntry = NULL;
|
||||
ms_previousVisibleExpandableEntry = NULL;
|
||||
ms_profilerEntriesCurrent = NULL;
|
||||
ms_profilerEntriesLast = NULL;
|
||||
ms_rootVisibleExpandableEntry = nullptr;
|
||||
ms_beforeSelectedVisibleExpandableEntry = nullptr;
|
||||
ms_selectedVisibleExpandableEntry = nullptr;
|
||||
ms_afterSelectedVisibleExpandableEntry = nullptr;
|
||||
ms_previousVisibleExpandableEntry = nullptr;
|
||||
ms_profilerEntriesCurrent = nullptr;
|
||||
ms_profilerEntriesLast = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -374,11 +374,11 @@ bool ProfilerNamespace::formatEntry(int indent, ProfilerTimer::Type totalTime, i
|
||||
void ProfilerNamespace::processEntry(char const *rootName, int indent, ProfilerEntry const & entry, VisibleExpandableEntry * visibleExpandableEntry)
|
||||
{
|
||||
if (rootName == entry.name)
|
||||
rootName = NULL;
|
||||
rootName = nullptr;
|
||||
|
||||
if (!rootName)
|
||||
{
|
||||
if (!formatEntry(indent, entry.totalTime, entry.totalCalls, visibleExpandableEntry != NULL, visibleExpandableEntry && visibleExpandableEntry->isExpanded(), visibleExpandableEntry == ms_selectedVisibleExpandableEntry, entry.name))
|
||||
if (!formatEntry(indent, entry.totalTime, entry.totalCalls, visibleExpandableEntry != nullptr, visibleExpandableEntry && visibleExpandableEntry->isExpanded(), visibleExpandableEntry == ms_selectedVisibleExpandableEntry, entry.name))
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -410,7 +410,7 @@ void ProfilerNamespace::processEntry(char const *rootName, int indent, ProfilerE
|
||||
|
||||
if (child.children.empty())
|
||||
{
|
||||
processEntry(rootName, indent, child, NULL);
|
||||
processEntry(rootName, indent, child, nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -483,9 +483,9 @@ void ProfilerNamespace::generateReport()
|
||||
ms_rootVisibleExpandableEntry->markAllChildrenInvisible();
|
||||
ms_rootVisibleExpandableEntry->findOrAddExpandableChild(rootEntry.name);
|
||||
|
||||
ms_previousVisibleExpandableEntry = NULL;
|
||||
ms_beforeSelectedVisibleExpandableEntry = NULL;
|
||||
ms_afterSelectedVisibleExpandableEntry = NULL;
|
||||
ms_previousVisibleExpandableEntry = nullptr;
|
||||
ms_beforeSelectedVisibleExpandableEntry = nullptr;
|
||||
ms_afterSelectedVisibleExpandableEntry = nullptr;
|
||||
processEntry(ms_rootProfilerName, 0, rootEntry, ms_rootVisibleExpandableEntry);
|
||||
|
||||
if (ms_rootVisibleExpandableEntry->pruneInvisibleChildren())
|
||||
@@ -494,7 +494,7 @@ void ProfilerNamespace::generateReport()
|
||||
if (ms_setRoot)
|
||||
{
|
||||
if (ms_rootProfilerName)
|
||||
ms_rootProfilerName = NULL;
|
||||
ms_rootProfilerName = nullptr;
|
||||
else
|
||||
ms_rootProfilerName = ms_selectedVisibleExpandableEntry->getName();
|
||||
ms_setRoot = false;
|
||||
@@ -720,7 +720,7 @@ void ProfilerNamespace::enterWithTime(char const *name, ProfilerTimer::Type time
|
||||
|
||||
// search for another call to this block from the parent
|
||||
int entryIndex = -1;
|
||||
ProfilerEntry *entry = NULL;
|
||||
ProfilerEntry *entry = nullptr;
|
||||
if (!ms_profilerEntryStack.empty())
|
||||
{
|
||||
ProfilerEntry &parent = (*ms_profilerEntriesCurrent)[ms_profilerEntryStack.back()];
|
||||
|
||||
@@ -92,10 +92,10 @@ void RemoteDebug::remove(void)
|
||||
return;
|
||||
}
|
||||
|
||||
ms_removeFunction = NULL;
|
||||
ms_openFunction = NULL;
|
||||
ms_closeFunction = NULL;
|
||||
ms_sendFunction = NULL;
|
||||
ms_removeFunction = nullptr;
|
||||
ms_openFunction = nullptr;
|
||||
ms_closeFunction = nullptr;
|
||||
ms_sendFunction = nullptr;
|
||||
|
||||
//empty out session-level data
|
||||
for (StreamMap::iterator it = ms_streams->begin(); it != ms_streams->end(); ++it)
|
||||
@@ -147,7 +147,7 @@ uint32 RemoteDebug::registerStream(const std::string& streamName)
|
||||
DEBUG_FATAL(!ms_installed, ("remoteDebug not installed"));
|
||||
|
||||
uint32 streamNum = 0;
|
||||
Channel *parent = NULL;
|
||||
Channel *parent = nullptr;
|
||||
std::string base;
|
||||
std::string rest = streamName;
|
||||
//look for subchannels with a double backslash
|
||||
@@ -203,7 +203,7 @@ uint32 RemoteDebug::registerStaticView(const std::string& channelName)
|
||||
{
|
||||
DEBUG_FATAL(!ms_installed, ("remoteDebug not installed"));
|
||||
uint32 staticViewNum = 0;
|
||||
Channel *parent = NULL;
|
||||
Channel *parent = nullptr;
|
||||
std::string base;
|
||||
std::string rest = channelName;
|
||||
//look for subchannels with a double backslash
|
||||
@@ -356,7 +356,7 @@ uint32 RemoteDebug::registerVariable(const char* variableName, void *memLoc, VAR
|
||||
std::string variable = variableName;
|
||||
|
||||
uint32 variableNum = 0;
|
||||
Channel *parent = NULL;
|
||||
Channel *parent = nullptr;
|
||||
std::string base;
|
||||
std::string rest = variable;
|
||||
//look for subchannels with a double backslash
|
||||
@@ -375,7 +375,7 @@ uint32 RemoteDebug::registerVariable(const char* variableName, void *memLoc, VAR
|
||||
//only add the variable if we don't have it yet
|
||||
if (variableNumber == -1)
|
||||
{
|
||||
registerVariable(newBase.c_str(), NULL, BOOL, sendToClients);
|
||||
registerVariable(newBase.c_str(), nullptr, BOOL, sendToClients);
|
||||
}
|
||||
//look for any other subChannel
|
||||
uint32 oldRestIndex = restIndex;
|
||||
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
{
|
||||
INT, //32 bit signed int
|
||||
FLOAT, //32 bit signed float
|
||||
CSTRING, //null terminated char[]
|
||||
CSTRING, //nullptr terminated char[]
|
||||
BOOL //0 or 1 (could use an int, but useful for tools)
|
||||
};
|
||||
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
static void install(RemoveFunction, OpenFunction, CloseFunction, SendFunction, IsReadyFunction);
|
||||
|
||||
///open a session
|
||||
static void open(const char *server = NULL, uint16 port = 0);
|
||||
static void open(const char *server = nullptr, uint16 port = 0);
|
||||
|
||||
///packs the data into a packet, and sends it using the client-defined SendFunction
|
||||
static void send(MESSAGE_TYPE type, const char* name = "");
|
||||
|
||||
@@ -30,7 +30,7 @@ uint32 RemoteDebugServer::ms_inputTarget;
|
||||
// ======================================================================
|
||||
|
||||
RemoteDebug::Channel::Channel(const std::string& name, Channel *parent)
|
||||
: m_name(NULL),
|
||||
: m_name(nullptr),
|
||||
m_parent(parent)
|
||||
{
|
||||
m_name = new std::string(name);
|
||||
@@ -41,16 +41,16 @@ RemoteDebug::Channel::Channel(const std::string& name, Channel *parent)
|
||||
|
||||
RemoteDebug::Channel::~Channel()
|
||||
{
|
||||
m_parent = NULL;
|
||||
m_parent = nullptr;
|
||||
if(m_name)
|
||||
{
|
||||
delete m_name;
|
||||
m_name = NULL;
|
||||
m_name = nullptr;
|
||||
}
|
||||
if (m_children)
|
||||
{
|
||||
delete m_children;
|
||||
m_children = NULL;
|
||||
m_children = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,7 +72,7 @@ const std::string& RemoteDebug::Channel::name()
|
||||
|
||||
RemoteDebug::Variable::Variable(const std::string& name, void *memLoc, VARIABLE_TYPES type)
|
||||
: m_memLoc(memLoc),
|
||||
m_name(NULL),
|
||||
m_name(nullptr),
|
||||
m_type(type)
|
||||
{
|
||||
m_name = new std::string(name);
|
||||
@@ -111,7 +111,7 @@ RemoteDebug::Variable::~Variable()
|
||||
if(m_name)
|
||||
{
|
||||
delete m_name;
|
||||
m_name = NULL;
|
||||
m_name = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -307,7 +307,7 @@ void RemoteDebugClient::receive(const unsigned char * const message, const uint3
|
||||
if (channelNumber < ms_nextVariable)
|
||||
return;
|
||||
//do not send value back to server (hence the "false")
|
||||
registerVariable(ms_buffer, NULL, BOOL, false);
|
||||
registerVariable(ms_buffer, nullptr, BOOL, false);
|
||||
if (ms_newVariableFunction)
|
||||
ms_newVariableFunction(channelNumber, const_cast<const char*>(ms_buffer));
|
||||
break;
|
||||
@@ -477,7 +477,7 @@ void RemoteDebugServer::receive(const unsigned char * const message, const uint3
|
||||
memcpy(ms_buffer, charMessage + sizeOfMessageType + sizeOfChannelNumber + sizeOfSizeofPayload, sizeOfPayload);
|
||||
}
|
||||
|
||||
Variable* v = NULL;
|
||||
Variable* v = nullptr;
|
||||
switch(type)
|
||||
{
|
||||
case STREAM:
|
||||
@@ -524,27 +524,27 @@ void RemoteDebugServer::receive(const unsigned char * const message, const uint3
|
||||
break;
|
||||
|
||||
case STATIC_UP:
|
||||
if ((*ms_upFunctionMap)[ms_inputTarget] != NULL)
|
||||
if ((*ms_upFunctionMap)[ms_inputTarget] != nullptr)
|
||||
(*ms_upFunctionMap)[ms_inputTarget](); //lint !e10, !e522 ("expecting a function" and "expected void assignment)
|
||||
break;
|
||||
|
||||
case STATIC_DOWN:
|
||||
if ((*ms_downFunctionMap)[ms_inputTarget] != NULL)
|
||||
if ((*ms_downFunctionMap)[ms_inputTarget] != nullptr)
|
||||
(*ms_downFunctionMap)[ms_inputTarget](); //lint !e10, !e522 ("expecting a function" and "expected void assignment)
|
||||
break;
|
||||
|
||||
case STATIC_LEFT:
|
||||
if ((*ms_leftFunctionMap)[ms_inputTarget] != NULL)
|
||||
if ((*ms_leftFunctionMap)[ms_inputTarget] != nullptr)
|
||||
(*ms_leftFunctionMap)[ms_inputTarget](); //lint !e10, !e522 ("expecting a function" and "expected void assignment)
|
||||
break;
|
||||
|
||||
case STATIC_RIGHT:
|
||||
if ((*ms_rightFunctionMap)[ms_inputTarget] != NULL)
|
||||
if ((*ms_rightFunctionMap)[ms_inputTarget] != nullptr)
|
||||
(*ms_rightFunctionMap)[ms_inputTarget](); //lint !e10, !e522 ("expecting a function" and "expected void assignment)
|
||||
break;
|
||||
|
||||
case STATIC_ENTER:
|
||||
if ((*ms_enterFunctionMap)[ms_inputTarget] != NULL)
|
||||
if ((*ms_enterFunctionMap)[ms_inputTarget] != nullptr)
|
||||
(*ms_enterFunctionMap)[ms_inputTarget](); //lint !e10, !e522 ("expecting a function" and "expected void assignment)
|
||||
break;
|
||||
|
||||
|
||||
@@ -29,13 +29,13 @@ class RemoteDebug::Channel
|
||||
NodeList* m_children;
|
||||
///the fully qualified name of the channel
|
||||
std::string* m_name;
|
||||
///its parent (which is NULL for top-level nodes
|
||||
///its parent (which is nullptr for top-level nodes
|
||||
Channel *m_parent;
|
||||
};
|
||||
|
||||
/** This class stores data about a variable channel, both on the server (where the variable actually
|
||||
* resides), and the client (which just displays it). The client simply creates Variable's with
|
||||
* NULL'd out memLoc's, since it doesn't have direct access to the memory.
|
||||
* nullptr'd out memLoc's, since it doesn't have direct access to the memory.
|
||||
*/
|
||||
class RemoteDebug::Variable
|
||||
{
|
||||
|
||||
@@ -175,7 +175,7 @@ void Report::puts(const char *buffer)
|
||||
// if (flags & RF_fatal)
|
||||
// title = "Fatal Report";
|
||||
|
||||
// MessageBox(NULL, buffer, title, MB_OK | MB_ICONEXCLAMATION);
|
||||
// MessageBox(nullptr, buffer, title, MB_OK | MB_ICONEXCLAMATION);
|
||||
//}
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ void Report::vprintf(const char *format, va_list va)
|
||||
{
|
||||
char buffer[8 * 1024];
|
||||
|
||||
// make sure the buffer is always NULL terminated
|
||||
// make sure the buffer is always nullptr terminated
|
||||
buffer[sizeof(buffer)-1] = '\0';
|
||||
|
||||
// format the string
|
||||
|
||||
@@ -169,9 +169,9 @@ void AsynchronousLoader::install(const char *fileName)
|
||||
const int numberOfExtensions = iff.getChunkLengthTotal(sizeof(int32));
|
||||
ms_extensionFunctionsList.reserve(numberOfExtensions);
|
||||
ExtensionFunctions extensionFunctions;
|
||||
extensionFunctions.extension = NULL;
|
||||
extensionFunctions.fetchFunction = NULL;
|
||||
extensionFunctions.releaseFunction = NULL;
|
||||
extensionFunctions.extension = nullptr;
|
||||
extensionFunctions.fetchFunction = nullptr;
|
||||
extensionFunctions.releaseFunction = nullptr;
|
||||
for (int i = 0; i < numberOfExtensions; ++i)
|
||||
{
|
||||
extensionFunctions.extension = ms_fileData + iff.read_int32();
|
||||
@@ -235,10 +235,10 @@ void AsynchronousLoaderNamespace::remove()
|
||||
{
|
||||
DEBUG_FATAL(!ms_installed, ("not installed"));
|
||||
Request *request = reinterpret_cast<Request*>(ms_requestMemoryBlockManager->allocate());
|
||||
request->fileRecordList = NULL;
|
||||
request->callback = NULL;
|
||||
request->data = NULL;
|
||||
request->cachedFiles = NULL;
|
||||
request->fileRecordList = nullptr;
|
||||
request->callback = nullptr;
|
||||
request->data = nullptr;
|
||||
request->cachedFiles = nullptr;
|
||||
|
||||
submitRequest(request);
|
||||
|
||||
@@ -270,7 +270,7 @@ void AsynchronousLoaderNamespace::remove()
|
||||
ms_cachedFilesPool.clear();
|
||||
|
||||
delete ms_requestMemoryBlockManager;
|
||||
ms_requestMemoryBlockManager = NULL;
|
||||
ms_requestMemoryBlockManager = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -369,7 +369,7 @@ void AsynchronousLoader::add(const char *fileName, Callback callback, void *data
|
||||
request->fileRecordList = i->second;
|
||||
request->callback = callback;
|
||||
request->data = data;
|
||||
request->cachedFiles = NULL;
|
||||
request->cachedFiles = nullptr;
|
||||
submitRequest(request);
|
||||
}
|
||||
else
|
||||
@@ -390,8 +390,8 @@ void AsynchronousLoader::remove(Callback callback, void *data)
|
||||
for (Requests::iterator i = ms_pendingRequests.begin(); i != iEnd; ++i)
|
||||
if ((*i)->callback == callback && (*i)->data == data)
|
||||
{
|
||||
(*i)->callback = NULL;
|
||||
(*i)->data = NULL;
|
||||
(*i)->callback = nullptr;
|
||||
(*i)->data = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -400,8 +400,8 @@ void AsynchronousLoader::remove(Callback callback, void *data)
|
||||
for (Requests::iterator i = ms_completedRequests.begin(); i != iEnd; ++i)
|
||||
if ((*i)->callback == callback && (*i)->data == data)
|
||||
{
|
||||
(*i)->callback = NULL;
|
||||
(*i)->data = NULL;
|
||||
(*i)->callback = nullptr;
|
||||
(*i)->data = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -466,8 +466,8 @@ void AsynchronousLoaderNamespace::threadRoutine()
|
||||
|
||||
CachedFile cachedFile;
|
||||
cachedFile.fileRecord = fileRecord;
|
||||
cachedFile.file = NULL;
|
||||
cachedFile.resource = NULL;
|
||||
cachedFile.file = nullptr;
|
||||
cachedFile.resource = nullptr;
|
||||
|
||||
// check if the resource is already loaded
|
||||
if (!fileRecord->alreadyCached)
|
||||
@@ -622,7 +622,7 @@ void AsynchronousLoader::processCallbacks()
|
||||
else
|
||||
bytes += cachedFile.file->length();
|
||||
TreeFile::addCachedFile(cachedFile.fileRecord->fileName, cachedFile.file);
|
||||
cachedFile.file = NULL;
|
||||
cachedFile.file = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -653,13 +653,13 @@ void AsynchronousLoader::processCallbacks()
|
||||
else
|
||||
bytes += cachedFile.file->length();
|
||||
delete cachedFile.file;
|
||||
cachedFile.file = NULL;
|
||||
cachedFile.file = nullptr;
|
||||
}
|
||||
|
||||
if (cachedFile.resource)
|
||||
{
|
||||
ms_extensionFunctionsList[cachedFile.fileRecord->extensionFunctionsIndex].releaseFunction(cachedFile.resource);
|
||||
cachedFile.resource = NULL;
|
||||
cachedFile.resource = nullptr;
|
||||
}
|
||||
}
|
||||
request->cachedFiles->clear();
|
||||
@@ -667,7 +667,7 @@ void AsynchronousLoader::processCallbacks()
|
||||
ms_mutex.enter();
|
||||
|
||||
ms_cachedFilesPool.push_back(request->cachedFiles);
|
||||
request->cachedFiles = NULL;
|
||||
request->cachedFiles = nullptr;
|
||||
|
||||
ms_mutex.leave();
|
||||
}
|
||||
|
||||
@@ -73,8 +73,8 @@ void FileManifest::install()
|
||||
s_accessThreshold = ConfigFile::getKeyInt("SharedFile", "fileManifestAccessThreshold", -1, s_accessThreshold);
|
||||
|
||||
// if we are developing, and want to update the manifest, read in the tab file as well
|
||||
const char * manifestFile = ConfigFile::getKeyString("SharedFile", "updateFileManifest", 0, NULL);
|
||||
if (manifestFile != NULL)
|
||||
const char * manifestFile = ConfigFile::getKeyString("SharedFile", "updateFileManifest", 0, nullptr);
|
||||
if (manifestFile != nullptr)
|
||||
{
|
||||
s_updateManifest = true;
|
||||
|
||||
@@ -183,8 +183,8 @@ void FileManifest::remove()
|
||||
|
||||
#if PRODUCTION == 0
|
||||
// dump out the new manifest if requested
|
||||
const char * manifestFile = ConfigFile::getKeyString("SharedFile", "updateFileManifest", 0, NULL);
|
||||
if (manifestFile != NULL)
|
||||
const char * manifestFile = ConfigFile::getKeyString("SharedFile", "updateFileManifest", 0, nullptr);
|
||||
if (manifestFile != nullptr)
|
||||
{
|
||||
StdioFile outputFile(manifestFile,"w");
|
||||
DEBUG_FATAL(!outputFile.isOpen(), ("FileManifest::remove(): Could not open %s for writing.", manifestFile));
|
||||
@@ -201,7 +201,7 @@ void FileManifest::remove()
|
||||
{
|
||||
if (!i->second)
|
||||
{
|
||||
DEBUG_WARNING(true, ("FileManifest::remove(): Found a null pointer in the fileManifest map!\n"));
|
||||
DEBUG_WARNING(true, ("FileManifest::remove(): Found a nullptr pointer in the fileManifest map!\n"));
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
@@ -59,9 +59,9 @@ bool FileNameUtils::isReadable(std::string const &path)
|
||||
{
|
||||
FILE *fp = fopen(path.c_str(), "r");
|
||||
|
||||
result = (fp != NULL);
|
||||
result = (fp != nullptr);
|
||||
|
||||
if (fp != NULL)
|
||||
if (fp != nullptr)
|
||||
{
|
||||
fclose(fp);
|
||||
}
|
||||
@@ -79,9 +79,9 @@ bool FileNameUtils::isWritable(std::string const &path)
|
||||
{
|
||||
FILE *fp = fopen(path.c_str(), "w");
|
||||
|
||||
result = (fp != NULL);
|
||||
result = (fp != nullptr);
|
||||
|
||||
if (fp != NULL)
|
||||
if (fp != nullptr)
|
||||
{
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
@@ -109,11 +109,11 @@ int FileStreamer::getFileSize(const char *fileName)
|
||||
FileStreamer::File *FileStreamer::open(const char *fileName, bool randomAccess)
|
||||
{
|
||||
DEBUG_FATAL(!ms_installed, ("not installed"));
|
||||
DEBUG_FATAL(!fileName, ("file name null"));
|
||||
DEBUG_FATAL(!fileName, ("file name nullptr"));
|
||||
|
||||
OsFile *osFile = OsFile::open(fileName, randomAccess);
|
||||
if (!osFile)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
#if PRODUCTION
|
||||
// Stop checking the fileName if one of these returns true
|
||||
@@ -150,7 +150,7 @@ void FileStreamer::File::install(bool useThread)
|
||||
void FileStreamer::File::remove()
|
||||
{
|
||||
delete ms_memoryBlockManager;
|
||||
ms_memoryBlockManager = NULL;
|
||||
ms_memoryBlockManager = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -192,7 +192,7 @@ FileStreamer::File::~File()
|
||||
|
||||
bool FileStreamer::File::isOpen() const
|
||||
{
|
||||
return m_osFile != NULL;
|
||||
return m_osFile != nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -249,7 +249,7 @@ void FileStreamer::File::close()
|
||||
if (isOpen())
|
||||
{
|
||||
delete m_osFile;
|
||||
m_osFile = NULL;
|
||||
m_osFile = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ FileStreamerFile::~FileStreamerFile()
|
||||
|
||||
bool FileStreamerFile::isOpen() const
|
||||
{
|
||||
return m_file != NULL;
|
||||
return m_file != nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -174,7 +174,7 @@ void FileStreamerFile::close()
|
||||
{
|
||||
if (m_owner)
|
||||
delete m_file;
|
||||
m_file = NULL;
|
||||
m_file = nullptr;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -294,34 +294,34 @@ void FileStreamerThread::threadRoutine()
|
||||
|
||||
//get the request to service
|
||||
ms_queueCriticalSection.enter();
|
||||
request = NULL;
|
||||
request = nullptr;
|
||||
|
||||
//if there is an AudioVideo request, service it first (interrupting any current data request)
|
||||
if (ms_firstAudioVideoRequest)
|
||||
{
|
||||
request = ms_firstAudioVideoRequest;
|
||||
ms_firstAudioVideoRequest = ms_firstAudioVideoRequest->next;
|
||||
if (ms_firstAudioVideoRequest == NULL)
|
||||
ms_lastAudioVideoRequest = NULL;
|
||||
request->next = NULL;
|
||||
if (ms_firstAudioVideoRequest == nullptr)
|
||||
ms_lastAudioVideoRequest = nullptr;
|
||||
request->next = nullptr;
|
||||
}
|
||||
else
|
||||
if (ms_firstDataRequest)
|
||||
{
|
||||
request = ms_firstDataRequest;
|
||||
ms_firstDataRequest = ms_firstDataRequest->next;
|
||||
if (ms_firstDataRequest == NULL)
|
||||
ms_lastDataRequest = NULL;
|
||||
request->next = NULL;
|
||||
if (ms_firstDataRequest == nullptr)
|
||||
ms_lastDataRequest = nullptr;
|
||||
request->next = nullptr;
|
||||
}
|
||||
else
|
||||
if (ms_firstLowRequest)
|
||||
{
|
||||
request = ms_firstLowRequest;
|
||||
ms_firstLowRequest = ms_firstLowRequest->next;
|
||||
if (ms_firstLowRequest == NULL)
|
||||
ms_lastLowRequest = NULL;
|
||||
request->next = NULL;
|
||||
if (ms_firstLowRequest == nullptr)
|
||||
ms_lastLowRequest = nullptr;
|
||||
request->next = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -369,7 +369,7 @@ void FileStreamerThread::Request::install()
|
||||
void FileStreamerThread::Request::remove()
|
||||
{
|
||||
delete ms_memoryBlockManager;
|
||||
ms_memoryBlockManager = NULL;
|
||||
ms_memoryBlockManager = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -395,15 +395,15 @@ void FileStreamerThread::Request::operator delete(void *pointer)
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
FileStreamerThread::Request::Request()
|
||||
: next(NULL),
|
||||
: next(nullptr),
|
||||
type(Request::Unknown),
|
||||
osFile(NULL),
|
||||
osFile(nullptr),
|
||||
buffer(0),
|
||||
bytesToBeRead(0),
|
||||
bytesRead(0),
|
||||
gate(NULL),
|
||||
gate(nullptr),
|
||||
priority(AbstractFile::PriorityData),
|
||||
returnValue(NULL)
|
||||
returnValue(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -412,10 +412,10 @@ FileStreamerThread::Request::Request()
|
||||
FileStreamerThread::Request::~Request()
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
next = NULL;
|
||||
buffer = NULL;
|
||||
gate = NULL;
|
||||
returnValue = NULL;
|
||||
next = nullptr;
|
||||
buffer = nullptr;
|
||||
gate = nullptr;
|
||||
returnValue = nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -146,11 +146,11 @@ bool Iff::isValid(char const * fileName)
|
||||
int const fileLength = file->length();
|
||||
byte *data = file->readEntireFileAndClose();
|
||||
delete file;
|
||||
file = NULL;
|
||||
file = nullptr;
|
||||
|
||||
bool const result = IffNamespace::isValid(data, fileLength);
|
||||
delete [] data;
|
||||
data = NULL;
|
||||
data = nullptr;
|
||||
|
||||
return result;
|
||||
}
|
||||
@@ -167,12 +167,12 @@ bool Iff::isValid(char const * fileName)
|
||||
// Iff::open()
|
||||
|
||||
Iff::Iff(void)
|
||||
: fileName(NULL),
|
||||
: fileName(nullptr),
|
||||
maxStackDepth(DEFAULT_STACK_DEPTH),
|
||||
stackDepth(0),
|
||||
stack(new Stack[DEFAULT_STACK_DEPTH]),
|
||||
length(0),
|
||||
data(NULL),
|
||||
data(nullptr),
|
||||
inChunk(false),
|
||||
growable(false),
|
||||
nonlinear(false),
|
||||
@@ -207,7 +207,7 @@ Iff::Iff(void)
|
||||
*/
|
||||
|
||||
Iff::Iff(int newDataSize, const byte *newData, bool iffOwnsData) :
|
||||
fileName(NULL),
|
||||
fileName(nullptr),
|
||||
maxStackDepth(DEFAULT_STACK_DEPTH),
|
||||
stackDepth(0),
|
||||
stack(new Stack[DEFAULT_STACK_DEPTH]),
|
||||
@@ -242,12 +242,12 @@ Iff::Iff(int newDataSize, const byte *newData, bool iffOwnsData) :
|
||||
*/
|
||||
|
||||
Iff::Iff(const char *newFileName, bool optional)
|
||||
: fileName(NULL),
|
||||
: fileName(nullptr),
|
||||
maxStackDepth(DEFAULT_STACK_DEPTH),
|
||||
stackDepth(0),
|
||||
stack(new Stack[DEFAULT_STACK_DEPTH]),
|
||||
length(0),
|
||||
data(NULL),
|
||||
data(nullptr),
|
||||
inChunk(false),
|
||||
growable(false),
|
||||
nonlinear(false),
|
||||
@@ -270,7 +270,7 @@ Iff::Iff(const char *newFileName, bool optional)
|
||||
*/
|
||||
|
||||
Iff::Iff(int initialSize, bool isGrowable, bool clearDataBuffer)
|
||||
: fileName(NULL),
|
||||
: fileName(nullptr),
|
||||
maxStackDepth(DEFAULT_STACK_DEPTH),
|
||||
stackDepth(0),
|
||||
stack(new Stack[DEFAULT_STACK_DEPTH]),
|
||||
@@ -384,7 +384,7 @@ void Iff::open(AbstractFile & file, char const * const newFileName)
|
||||
DEBUG_FATAL(data, ("causing memory leak"));
|
||||
data = file.readEntireFileAndClose();
|
||||
|
||||
FATAL(ConfigSharedFile::getValidateIff() && !IffNamespace::isValid(data, length), ("File corruption detected! Iff::isValid failed for %s (size=%d, crc=%08X). Please try a \"Full Scan\" from the LaunchPad.", newFileName ? newFileName : "null", length, Crc::calculate(data, length)));
|
||||
FATAL(ConfigSharedFile::getValidateIff() && !IffNamespace::isValid(data, length), ("File corruption detected! Iff::isValid failed for %s (size=%d, crc=%08X). Please try a \"Full Scan\" from the LaunchPad.", newFileName ? newFileName : "nullptr", length, Crc::calculate(data, length)));
|
||||
|
||||
// setup the stack data to know about the data
|
||||
stack[0].start = 0;
|
||||
@@ -406,11 +406,11 @@ void Iff::open(AbstractFile & file, char const * const newFileName)
|
||||
void Iff::close(void)
|
||||
{
|
||||
delete [] fileName;
|
||||
fileName = NULL;
|
||||
fileName = nullptr;
|
||||
|
||||
if (ownsData)
|
||||
delete [] data;
|
||||
data = NULL; //lint !e672 // possible memory leak in assignment to Iff::data // no, we only delete when we own it
|
||||
data = nullptr; //lint !e672 // possible memory leak in assignment to Iff::data // no, we only delete when we own it
|
||||
stackDepth = 0;
|
||||
}
|
||||
|
||||
@@ -886,7 +886,7 @@ void Iff::insertChunkFloatQuaternion(const Quaternion &quaternion)
|
||||
* Insert a string into the current chunk at the current location.
|
||||
*
|
||||
* This routine will call insertChunkData(const void *, int length)
|
||||
* with the string using its string length (plus one for the null
|
||||
* with the string using its string length (plus one for the nullptr
|
||||
* terminator).
|
||||
*/
|
||||
|
||||
@@ -1555,10 +1555,10 @@ void Iff::read_string(char *string, int maxLength)
|
||||
*string = *source;
|
||||
}
|
||||
|
||||
// step over the null terminator on the input
|
||||
// step over the nullptr terminator on the input
|
||||
++s.used;
|
||||
|
||||
// null terminate the output string
|
||||
// nullptr terminate the output string
|
||||
DEBUG_FATAL(maxLength <= 0, ("destination string too short"));
|
||||
*string = '\0';
|
||||
}
|
||||
@@ -1594,7 +1594,7 @@ char *Iff::read_string(void)
|
||||
for ( ; sourceLength < maxLength && source[sourceLength]; ++sourceLength)
|
||||
;
|
||||
|
||||
// verify that we found the null terminator
|
||||
// verify that we found the nullptr terminator
|
||||
DEBUG_FATAL(sourceLength >= maxLength, ("hit end of chunk before string terminator"));
|
||||
|
||||
// create and copy the string
|
||||
@@ -1634,10 +1634,10 @@ void Iff::read_string(std::string &string)
|
||||
for ( ; sourceLength < maxLength && source[sourceLength]; ++sourceLength)
|
||||
;
|
||||
|
||||
// verify that we found the null terminator
|
||||
// verify that we found the nullptr terminator
|
||||
DEBUG_FATAL(sourceLength >= maxLength, ("hit end of chunk before string terminator"));
|
||||
|
||||
// account for the null terminator
|
||||
// account for the nullptr terminator
|
||||
++sourceLength;
|
||||
|
||||
s.used += sourceLength;
|
||||
|
||||
@@ -250,7 +250,7 @@ public:
|
||||
Unicode::String read_unicodeString();
|
||||
|
||||
#if 0
|
||||
real *read_float (int count, real *array=NULL);
|
||||
real *read_float (int count, real *array=nullptr);
|
||||
#endif
|
||||
};
|
||||
|
||||
@@ -294,7 +294,7 @@ inline int Iff::getRawDataSize(void) const
|
||||
* to store raw iff data via a mechanism other than Iff::write().
|
||||
*
|
||||
* @return A read-only pointer to the data buffer containing the raw Iff data
|
||||
* managed by this Iff object. It may be NULL if no data is currently
|
||||
* managed by this Iff object. It may be nullptr if no data is currently
|
||||
* managed by the Iff.
|
||||
* @see Iff::getRawDataSize(), Iff::write()
|
||||
*/
|
||||
|
||||
@@ -23,7 +23,7 @@ IndentedFileWriter *IndentedFileWriter::createWriter(char const *filename)
|
||||
{
|
||||
// Kill the new writer since we weren't able to open the file for writing.
|
||||
delete newWriter;
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ IndentedFileWriter::~IndentedFileWriter()
|
||||
if (m_file)
|
||||
{
|
||||
fclose(m_file);
|
||||
m_file = NULL;
|
||||
m_file = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,8 +63,8 @@ void IndentedFileWriter::unindent()
|
||||
|
||||
void IndentedFileWriter::writeLine(char const *line) const
|
||||
{
|
||||
FATAL(!m_file, ("writeLine(): m_file is NULL, programmer error."));
|
||||
FATAL(!line, ("writeLine(): line argument is NULL."));
|
||||
FATAL(!m_file, ("writeLine(): m_file is nullptr, programmer error."));
|
||||
FATAL(!line, ("writeLine(): line argument is nullptr."));
|
||||
|
||||
//-- Write one tab for each indentation level.
|
||||
for (int i = 0; i < m_indentCount; ++i)
|
||||
@@ -92,7 +92,7 @@ void IndentedFileWriter::writeLineFormat(char const *format, ...) const
|
||||
int const formatCount = vsnprintf(buffer, sizeof(buffer), format, varArgList);
|
||||
UNREF(formatCount);
|
||||
|
||||
//-- Ensure it's null terminated.
|
||||
//-- Ensure it's nullptr terminated.
|
||||
buffer[sizeof(buffer) - 1] = '\0';
|
||||
|
||||
//-- Do the real print.
|
||||
@@ -108,7 +108,7 @@ void IndentedFileWriter::writeLineFormat(char const *format, ...) const
|
||||
|
||||
IndentedFileWriter::IndentedFileWriter() :
|
||||
m_indentCount(0),
|
||||
m_file(NULL)
|
||||
m_file(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ bool IndentedFileWriter::createFile(char const *filename)
|
||||
}
|
||||
|
||||
m_file = fopen(filename, "w");
|
||||
return (m_file != NULL);
|
||||
return (m_file != nullptr);
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -70,7 +70,7 @@ MemoryFile::MemoryFile(byte *buffer, int length)
|
||||
|
||||
MemoryFile::MemoryFile(AbstractFile *file)
|
||||
: AbstractFile(PriorityData),
|
||||
m_buffer(NULL),
|
||||
m_buffer(nullptr),
|
||||
m_length(file->length()),
|
||||
m_offset(0)
|
||||
{
|
||||
@@ -88,7 +88,7 @@ MemoryFile::~MemoryFile()
|
||||
|
||||
bool MemoryFile::isOpen() const
|
||||
{
|
||||
return m_buffer != NULL;
|
||||
return m_buffer != nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -162,7 +162,7 @@ int MemoryFile::write(int, const void *)
|
||||
void MemoryFile::close()
|
||||
{
|
||||
delete [] m_buffer;
|
||||
m_buffer = NULL;
|
||||
m_buffer = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -170,7 +170,7 @@ void MemoryFile::close()
|
||||
byte *MemoryFile::readEntireFileAndClose()
|
||||
{
|
||||
byte *result = m_buffer;
|
||||
m_buffer = NULL;
|
||||
m_buffer = nullptr;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
@@ -123,7 +123,7 @@ void TreeFile::install(uint32 skuBits)
|
||||
sprintf(buffer, "searchPath%s%d", skuText, priority);
|
||||
|
||||
char const * result;
|
||||
for (int index = 0; (result = ConfigFile::getKeyString("SharedFile", buffer, index, NULL)) != NULL; ++index)
|
||||
for (int index = 0; (result = ConfigFile::getKeyString("SharedFile", buffer, index, nullptr)) != nullptr; ++index)
|
||||
TreeFile::addSearchPath(result, priority);
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ void TreeFile::install(uint32 skuBits)
|
||||
sprintf(buffer, "searchTree%s%d", skuText, priority);
|
||||
|
||||
char const * result;
|
||||
for (int index = 0; (result = ConfigFile::getKeyString("SharedFile", buffer, index, NULL)) != NULL; ++index)
|
||||
for (int index = 0; (result = ConfigFile::getKeyString("SharedFile", buffer, index, nullptr)) != nullptr; ++index)
|
||||
TreeFile::addSearchTree(result, priority);
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ void TreeFile::install(uint32 skuBits)
|
||||
sprintf(buffer, "searchTOC%s%d", skuText, priority);
|
||||
|
||||
char const * result;
|
||||
for (int index = 0; (result = ConfigFile::getKeyString("SharedFile", buffer, index, NULL)) != NULL; ++index)
|
||||
for (int index = 0; (result = ConfigFile::getKeyString("SharedFile", buffer, index, nullptr)) != nullptr; ++index)
|
||||
TreeFile::addSearchTOC(result, priority);
|
||||
}
|
||||
}
|
||||
@@ -430,7 +430,7 @@ void TreeFile::removeAllSearches(void)
|
||||
* Find the node (if any) the requested file is in.
|
||||
*
|
||||
* @return Pointer to the highest priority node containing the file. If the
|
||||
* file is not found, NULL is returned. If checking for filename collisions is
|
||||
* file is not found, nullptr is returned. If checking for filename collisions is
|
||||
* set on, then this function DEBUG_FATALS if multiple files match
|
||||
*/
|
||||
|
||||
@@ -440,14 +440,14 @@ TreeFile::SearchNode *TreeFile::find(const char *fileName)
|
||||
|
||||
if (!fileName)
|
||||
{
|
||||
DEBUG_WARNING(true, ("TreeFile::find() Cannot find a null filename"));
|
||||
return NULL;
|
||||
DEBUG_WARNING(true, ("TreeFile::find() Cannot find a nullptr filename"));
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (fileName[0] == '\0')
|
||||
{
|
||||
DEBUG_WARNING(true, ("TreeFile::find() Cannot find an empty filename"));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// search the list of nodes looking to see if the specified file exists
|
||||
@@ -457,7 +457,7 @@ TreeFile::SearchNode *TreeFile::find(const char *fileName)
|
||||
if ((*i)->exists(fileName, deleted))
|
||||
return *i;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -479,7 +479,7 @@ bool TreeFile::exists(const char *fileName)
|
||||
FileManifest::addNewManifestEntry(fixedFileName, 0);
|
||||
#endif
|
||||
|
||||
return (find(fixedFileName) != NULL);
|
||||
return (find(fixedFileName) != nullptr);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -621,7 +621,7 @@ void TreeFile::fixUpFileName(const char *fileName, char *outName)
|
||||
* Find the node (if any) the requested file is in.
|
||||
*
|
||||
* @return Pointer to the highest priority node containing the file. If the
|
||||
* file is not found, NULL is returned.
|
||||
* file is not found, nullptr is returned.
|
||||
*/
|
||||
|
||||
bool TreeFile::getPathName(const char *fileName, char *pathName, int pathNameLength)
|
||||
@@ -655,12 +655,12 @@ bool TreeFile::getPathName(const char *fileName, char *pathName, int pathNameLen
|
||||
*
|
||||
* @param fileName File name to open
|
||||
* @param allowFail True to return false on failure, otherwise Fatal
|
||||
* @return pointer to a newly allocated AbstractFile-derived class (caller must delete), NULL if failure.
|
||||
* @return pointer to a newly allocated AbstractFile-derived class (caller must delete), nullptr if failure.
|
||||
*/
|
||||
|
||||
AbstractFile* TreeFile::open(const char *fileName, AbstractFile::PriorityType priority, bool allowFail)
|
||||
{
|
||||
AbstractFile *file = NULL;
|
||||
AbstractFile *file = nullptr;
|
||||
|
||||
char fixedFileName[Os::MAX_PATH_LENGTH];
|
||||
fixUpFileName(fixedFileName, fileName, true);
|
||||
@@ -678,7 +678,7 @@ AbstractFile* TreeFile::open(const char *fileName, AbstractFile::PriorityType pr
|
||||
if (cachedIterator != cachedFilesMap.end())
|
||||
{
|
||||
file = cachedIterator->second;
|
||||
cachedIterator->second = NULL;
|
||||
cachedIterator->second = nullptr;
|
||||
}
|
||||
|
||||
ms_criticalSection.leave();
|
||||
@@ -747,7 +747,7 @@ AbstractFile* TreeFile::open(const char *fileName, AbstractFile::PriorityType pr
|
||||
FileManifest::addNewManifestEntry(fixedFileName, 0);
|
||||
#endif
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
const int length = file->length();
|
||||
@@ -787,7 +787,7 @@ const char *TreeFile::getSearchPath(int index)
|
||||
for (SearchNodes::iterator i = ms_searchNodes.begin(); i != iEnd; ++i)
|
||||
{
|
||||
const SearchPath *searchPath = dynamic_cast<const SearchPath*>(*i);
|
||||
if (searchPath != NULL)
|
||||
if (searchPath != nullptr)
|
||||
{
|
||||
if (count == index)
|
||||
return searchPath->getPathName();
|
||||
@@ -795,14 +795,14 @@ const char *TreeFile::getSearchPath(int index)
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------
|
||||
/**
|
||||
* This function will return the shortest trailing path of its input that
|
||||
* can be loaded by the TreeFile. If no files can be loaded, this routine
|
||||
* will return NULL.
|
||||
* will return nullptr.
|
||||
*/
|
||||
|
||||
const char *TreeFile::getShortestExistingPath(const char *path)
|
||||
@@ -810,9 +810,9 @@ const char *TreeFile::getShortestExistingPath(const char *path)
|
||||
NOT_NULL(path);
|
||||
|
||||
if (!*path)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
const char *result = NULL;
|
||||
const char *result = nullptr;
|
||||
do
|
||||
{
|
||||
// check if this one exists
|
||||
@@ -866,7 +866,7 @@ bool TreeFile::stripTreeFileSearchPathFromFile(const char *inputPath, char *outp
|
||||
{
|
||||
// make sure it's a relative search path
|
||||
const SearchPath *searchPath = dynamic_cast<const SearchPath*>(*i);
|
||||
if (searchPath != NULL)
|
||||
if (searchPath != nullptr)
|
||||
{
|
||||
// check to see if the the search path is a prefix for the requested path
|
||||
const char *path = searchPath->getPathName();
|
||||
|
||||
@@ -53,7 +53,7 @@ TreeFile::SearchNode::~SearchNode(void)
|
||||
|
||||
TreeFile::SearchPath::SearchPath(int priority, const char *path)
|
||||
: SearchNode(priority),
|
||||
m_pathName(NULL),
|
||||
m_pathName(nullptr),
|
||||
m_pathNameLength(0)
|
||||
{
|
||||
NOT_NULL(path);
|
||||
@@ -145,7 +145,7 @@ AbstractFile *TreeFile::SearchPath::open(const char *fileName, AbstractFile::Pri
|
||||
makeAbsolutePath(fileName, buffer);
|
||||
FileStreamer::File *file = FileStreamer::open(buffer);
|
||||
if (!file)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return new FileStreamerFile(priority, *file);
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ AbstractFile *TreeFile::SearchAbsolute::open(const char *fileName, AbstractFile:
|
||||
|
||||
FileStreamer::File *file = FileStreamer::open(fileName);
|
||||
if (!file)
|
||||
return NULL;
|
||||
return nullptr;
|
||||
return new FileStreamerFile(priority, *file);
|
||||
}
|
||||
|
||||
@@ -248,12 +248,12 @@ bool TreeFile::SearchTree::validate(const char *fileName)
|
||||
|
||||
TreeFile::SearchTree::SearchTree(int priority, const char *fileName)
|
||||
: SearchNode(priority),
|
||||
m_treeFileName(NULL),
|
||||
m_treeFile(NULL),
|
||||
m_treeFileName(nullptr),
|
||||
m_treeFile(nullptr),
|
||||
m_version(0),
|
||||
m_numberOfFiles(0),
|
||||
m_fileNames(NULL),
|
||||
m_tableOfContents(NULL)
|
||||
m_fileNames(nullptr),
|
||||
m_tableOfContents(nullptr)
|
||||
{
|
||||
NOT_NULL(fileName);
|
||||
|
||||
@@ -435,7 +435,7 @@ void TreeFile::SearchTree::debugPrint(void)
|
||||
bool TreeFile::SearchTree::exists(const char *fileName, bool &deleted) const
|
||||
{
|
||||
NOT_NULL(fileName);
|
||||
return localExists(fileName, NULL, deleted);
|
||||
return localExists(fileName, nullptr, deleted);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -497,7 +497,7 @@ AbstractFile *TreeFile::SearchTree::open(const char *fileName, AbstractFile::Pri
|
||||
return new ZlibFile(entry.length, compressedBuffer, entry.compressedLength, true);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
@@ -535,14 +535,14 @@ bool TreeFile::SearchTOC::validate(const char *fileName)
|
||||
|
||||
TreeFile::SearchTOC::SearchTOC(int priority, const char *fileName)
|
||||
: SearchNode(priority),
|
||||
m_TOCFileName(NULL),
|
||||
m_TOCFile(NULL),
|
||||
m_treeFiles(NULL),
|
||||
m_TOCFileName(nullptr),
|
||||
m_TOCFile(nullptr),
|
||||
m_treeFiles(nullptr),
|
||||
m_numberOfFiles(0),
|
||||
m_treeFileNames(NULL),
|
||||
m_treeFileNamePointers(NULL),
|
||||
m_tableOfContents(NULL),
|
||||
m_fileNames(NULL)
|
||||
m_treeFileNames(nullptr),
|
||||
m_treeFileNamePointers(nullptr),
|
||||
m_tableOfContents(nullptr),
|
||||
m_fileNames(nullptr)
|
||||
{
|
||||
NOT_NULL(fileName);
|
||||
|
||||
@@ -587,7 +587,7 @@ TreeFile::SearchTOC::SearchTOC(int priority, const char *fileName)
|
||||
|
||||
// add on all paths in config file
|
||||
const char * result;
|
||||
for (int index = 0; (result = ConfigFile::getKeyString("SharedFile", "TOCTreePath", index, NULL)) != NULL; ++index)
|
||||
for (int index = 0; (result = ConfigFile::getKeyString("SharedFile", "TOCTreePath", index, nullptr)) != nullptr; ++index)
|
||||
treePaths.push_back(result);
|
||||
|
||||
// read in the tree file names and open the files
|
||||
@@ -598,7 +598,7 @@ TreeFile::SearchTOC::SearchTOC(int priority, const char *fileName)
|
||||
for (int treeFileNameIndex = 0, treeFileNameReadPosition = 0; treeFileNameIndex < static_cast<int>(header.numberOfTreeFiles); treeFileNameIndex++)
|
||||
{
|
||||
m_treeFileNamePointers[treeFileNameIndex] = (m_treeFileNames + treeFileNameReadPosition);
|
||||
m_treeFiles[treeFileNameIndex] = NULL;
|
||||
m_treeFiles[treeFileNameIndex] = nullptr;
|
||||
|
||||
// try to open the tree file in each of the relative paths
|
||||
for (std::vector<const char *>::const_iterator pathIter = treePaths.begin(); pathIter != treePaths.end(); ++pathIter)
|
||||
@@ -656,7 +656,7 @@ TreeFile::SearchTOC::SearchTOC(int priority, const char *fileName)
|
||||
{
|
||||
currentFileNameLength = m_tableOfContents[i].fileNameOffset;
|
||||
m_tableOfContents[i].fileNameOffset = currentFileNameOffset;
|
||||
// + 1 for the null termination
|
||||
// + 1 for the nullptr termination
|
||||
currentFileNameOffset += (currentFileNameLength + 1);
|
||||
}
|
||||
}
|
||||
@@ -792,7 +792,7 @@ bool TreeFile::SearchTOC::exists(const char *fileName, bool &deleted) const
|
||||
{
|
||||
NOT_NULL(fileName);
|
||||
deleted = false;
|
||||
return localExists(fileName, NULL);
|
||||
return localExists(fileName, nullptr);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -862,7 +862,7 @@ AbstractFile *TreeFile::SearchTOC::open(const char *fileName, AbstractFile::Prio
|
||||
return new ZlibFile(entry.length, compressedBuffer, entry.compressedLength, true);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -66,7 +66,7 @@ ZlibFile::ZlibFile(int uncompressedLength, byte *compressedBuffer, int compresse
|
||||
m_compressedBuffer(compressedBuffer),
|
||||
m_compressedBufferLength(compressedBufferLength),
|
||||
m_ownsCompressedBuffer(ownsCompressedBuffer),
|
||||
m_decompressedMemoryFile(NULL)
|
||||
m_decompressedMemoryFile(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -137,10 +137,10 @@ void ZlibFile::close()
|
||||
{
|
||||
if (m_ownsCompressedBuffer)
|
||||
delete [] m_compressedBuffer;
|
||||
m_compressedBuffer = NULL;
|
||||
m_compressedBuffer = nullptr;
|
||||
|
||||
delete m_decompressedMemoryFile;
|
||||
m_decompressedMemoryFile = NULL;
|
||||
m_decompressedMemoryFile = nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -197,7 +197,7 @@ void ZlibFile::getZlibCompressedDataAndClose(byte *& compressedBuffer, int & com
|
||||
if (m_ownsCompressedBuffer)
|
||||
{
|
||||
compressedBuffer = m_compressedBuffer;
|
||||
m_compressedBuffer = NULL;
|
||||
m_compressedBuffer = nullptr;
|
||||
compressedBufferLength = m_compressedBufferLength;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -97,7 +97,7 @@ void Os::installCommon(void)
|
||||
mainThreadId = pthread_self();
|
||||
|
||||
// get the name of the executable
|
||||
//Can't find UNIX call for this: DWORD result = GetModuleFileName(NULL, programName, sizeof(programName));
|
||||
//Can't find UNIX call for this: DWORD result = GetModuleFileName(nullptr, programName, sizeof(programName));
|
||||
strcpy(programName, "TempName");
|
||||
DWORD result = 1;
|
||||
|
||||
@@ -119,7 +119,7 @@ void Os::installCommon(void)
|
||||
char buffer[512];
|
||||
while (!feof(f))
|
||||
{
|
||||
if (fgets(buffer, 512, f) != NULL) {
|
||||
if (fgets(buffer, 512, f) != nullptr) {
|
||||
if (strncmp(buffer, "processor\t: ", 12)==0)
|
||||
{
|
||||
processorCount = atoi(buffer+12)+1;
|
||||
@@ -165,13 +165,13 @@ void Os::abort(void)
|
||||
if (!isMainThread())
|
||||
{
|
||||
threadDied = true;
|
||||
pthread_exit(NULL);
|
||||
pthread_exit(nullptr);
|
||||
}
|
||||
|
||||
if (!shouldReturnFromAbort)
|
||||
{
|
||||
// let the C runtime deal with the abnormal termination
|
||||
int * dummy = NULL;
|
||||
int * dummy = nullptr;
|
||||
int forceCrash = *dummy;
|
||||
UNREF(forceCrash);
|
||||
for (;;)
|
||||
@@ -256,14 +256,14 @@ bool Os::writeFile(const char *fileName, const void *data, int length) // Le
|
||||
DWORD written;
|
||||
|
||||
// open the file for writing
|
||||
handle = CreateFile(fileName, GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
handle = CreateFile(fileName, GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
|
||||
// check if it was opened
|
||||
if (handle == INVALID_HANDLE_VALUE)
|
||||
return false;
|
||||
|
||||
// attempt to write the data
|
||||
result = WriteFile(handle, data, static_cast<DWORD>(length), &written, NULL);
|
||||
result = WriteFile(handle, data, static_cast<DWORD>(length), &written, nullptr);
|
||||
|
||||
// make sure the data was written okay
|
||||
if (!result || written != static_cast<DWORD>(length))
|
||||
|
||||
@@ -81,7 +81,7 @@ PerThreadData::Data *PerThreadData::getData(bool allowReturnNull)
|
||||
if (!slotCreated)
|
||||
{
|
||||
DEBUG_FATAL(true && !allowReturnNull, ("not installed"));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
Data * const data = reinterpret_cast<Data *>(pthread_getspecific(slot));
|
||||
@@ -97,7 +97,7 @@ PerThreadData::Data *PerThreadData::getData(bool allowReturnNull)
|
||||
*
|
||||
* If the client is calling this function on a thread that existed before the engine was
|
||||
* installed, the client should set isNewThread to false. Setting isNewThread to false
|
||||
* prevents the function from validating that the thread's TLS is NULL. For threads existing
|
||||
* prevents the function from validating that the thread's TLS is nullptr. For threads existing
|
||||
* before the engine is installed, the TLS data for the thread is undefined.
|
||||
*
|
||||
* @param isNewThread [IN] true if the thread was created after the engine was installed, false otherwise
|
||||
@@ -147,10 +147,10 @@ void PerThreadData::threadRemove(void)
|
||||
|
||||
//close the event used for file streaming reads
|
||||
delete data->readGate;
|
||||
data->readGate = NULL;
|
||||
data->readGate = nullptr;
|
||||
|
||||
// wipe the data in the thread slot
|
||||
const BOOL result2 = pthread_setspecific(slot, NULL);
|
||||
const BOOL result2 = pthread_setspecific(slot, nullptr);
|
||||
UNREF(result2);
|
||||
DEBUG_FATAL(result2, ("TlsSetValue failed")); //NB: unlike Windows, returns 0 on success.
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
* threads existing at the time of slot creation. Thus, if you build a
|
||||
* plugin that only initializes the engine the first time it is
|
||||
* used, and other threads already exist in the app, those threads
|
||||
* will contain bogus non-null data in the TLS slot. If the plugin really
|
||||
* will contain bogus non-nullptr data in the TLS slot. If the plugin really
|
||||
* wants to do lazy initialization of the engine, it will need
|
||||
* to handle calling PerThreadData::threadInstall() for all existing threads
|
||||
* (except the thread that initialized the engine, which already
|
||||
@@ -102,7 +102,7 @@ public:
|
||||
|
||||
inline bool PerThreadData::isThreadInstalled(void)
|
||||
{
|
||||
return (getData(true) != NULL);
|
||||
return (getData(true) != nullptr);
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -168,7 +168,7 @@ inline void PerThreadData::setExitChainFataling(bool newValue)
|
||||
* Get the first entry for the exit chain.
|
||||
*
|
||||
* This routine is not intended for general use; it should only be used by the ExitChain class.
|
||||
* This routine may return NULL.
|
||||
* This routine may return nullptr.
|
||||
*
|
||||
* @return Pointer to the first entry on the exit chain
|
||||
* @see ExitChain::isFataling()
|
||||
@@ -184,7 +184,7 @@ inline ExitChain::Entry *PerThreadData::getExitChainFirstEntry(void)
|
||||
* Set the exit chain fataling flag value.
|
||||
*
|
||||
* This routine is not intended for general use; it should only be used by the ExitChain class.
|
||||
* The parameter to this routine may be NULL.
|
||||
* The parameter to this routine may be nullptr.
|
||||
*
|
||||
* @param newValue New value for the exit chain first entry
|
||||
*/
|
||||
|
||||
@@ -33,7 +33,7 @@ char* _itoa(int value, char* stringOut, int radix)
|
||||
bool QueryPerformanceCounter(__int64* time)
|
||||
{
|
||||
struct timeval tv;
|
||||
gettimeofday(&tv, NULL);
|
||||
gettimeofday(&tv, nullptr);
|
||||
*time = static_cast<LARGE_INTEGER>(tv.tv_sec);
|
||||
*time = (*time * 1000000) + static_cast<LARGE_INTEGER>(tv.tv_usec);
|
||||
|
||||
@@ -107,7 +107,7 @@ FILE* CreateFile(const char* fileName, DWORD access, DWORD shareMode, void* unsu
|
||||
FILE* retval = 0;
|
||||
|
||||
DEBUG_FATAL(flagsAndAttributes != FILE_ATTRIBUTE_NORMAL, ("Unsupported File mode call to CreateFile()"));
|
||||
DEBUG_FATAL(unsupB != NULL, ("Unsupported File mode call to CreateFile()"));
|
||||
DEBUG_FATAL(unsupB != nullptr, ("Unsupported File mode call to CreateFile()"));
|
||||
//DEBUG_FATAL(shareMode != 0, ("Unsupported File mode call to CreateFile()"));
|
||||
DEBUG_FATAL(unsupA != 0, ("Unsupported File mode call to CreateFile()"));
|
||||
|
||||
@@ -118,7 +118,7 @@ FILE* CreateFile(const char* fileName, DWORD access, DWORD shareMode, void* unsu
|
||||
if (retval)
|
||||
{
|
||||
fclose(retval);
|
||||
retval = NULL;
|
||||
retval = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -46,7 +46,7 @@ void OutputDebugString(const char* stringOut);
|
||||
|
||||
typedef FILE* HANDLE;
|
||||
|
||||
#define INVALID_HANDLE_VALUE NULL //Have to use a #define because this may be a FILE*
|
||||
#define INVALID_HANDLE_VALUE nullptr //Have to use a #define because this may be a FILE*
|
||||
|
||||
|
||||
const int GENERIC_READ = 1 << 0;
|
||||
@@ -66,8 +66,8 @@ const int FILE_END = SEEK_END;
|
||||
|
||||
const int FILE_SHARE_READ = 1;
|
||||
|
||||
BOOL WriteFile(FILE* hFile, const void* lpBuffer, DWORD numBytesToWrite, DWORD* numBytesWritten, void* unsup=NULL);
|
||||
BOOL ReadFile(FILE* hFile, void* lpBuffer, DWORD numBytesToWrite, DWORD* numBytesRead, void* unsup=NULL);
|
||||
BOOL WriteFile(FILE* hFile, const void* lpBuffer, DWORD numBytesToWrite, DWORD* numBytesWritten, void* unsup=nullptr);
|
||||
BOOL ReadFile(FILE* hFile, void* lpBuffer, DWORD numBytesToWrite, DWORD* numBytesRead, void* unsup=nullptr);
|
||||
DWORD SetFilePointer(FILE* hFile, long lDistanceToMove, long* lpDistanceToMoveHigh, DWORD dwMoveMethod);
|
||||
FILE* CreateFile(const char* fileName, DWORD access, DWORD shareMode, void* unsupA, DWORD creationDisposition, DWORD flagsAndAttributes, FILE* unsup2);
|
||||
BOOL CloseHandle(FILE* hFile);
|
||||
|
||||
@@ -150,11 +150,11 @@ SetupSharedFoundation::Data::Data(Defaults defaults)
|
||||
case D_game:
|
||||
runInBackground = true;
|
||||
|
||||
lpCmdLine = NULL;
|
||||
lpCmdLine = nullptr;
|
||||
argc = 0;
|
||||
argv = NULL;
|
||||
argv = nullptr;
|
||||
|
||||
configFile = NULL;
|
||||
configFile = nullptr;
|
||||
|
||||
frameRateLimit = CONST_REAL(0);
|
||||
break;
|
||||
@@ -162,11 +162,11 @@ SetupSharedFoundation::Data::Data(Defaults defaults)
|
||||
case D_console:
|
||||
runInBackground = true;
|
||||
|
||||
lpCmdLine = NULL;
|
||||
lpCmdLine = nullptr;
|
||||
argc = 0;
|
||||
argv = NULL;
|
||||
argv = nullptr;
|
||||
|
||||
configFile = NULL;
|
||||
configFile = nullptr;
|
||||
|
||||
frameRateLimit = CONST_REAL(0);
|
||||
break;
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
//
|
||||
// Remarks:
|
||||
//
|
||||
// If the buffer would overflow, the null terminating character is not written and -1
|
||||
// If the buffer would overflow, the nullptr terminating character is not written and -1
|
||||
// will be returned.
|
||||
|
||||
#ifdef _MSC_VER
|
||||
|
||||
@@ -35,7 +35,7 @@ m_numInUseBits(0)
|
||||
{
|
||||
if (numBits > (m_numAllocatedBytes << 3))
|
||||
{
|
||||
m_arrayData = NULL;
|
||||
m_arrayData = nullptr;
|
||||
m_numAllocatedBytes = 0;
|
||||
reserve(numBits);
|
||||
m_numInUseBytes = 0;
|
||||
@@ -294,7 +294,7 @@ void BitArray::reserve(int const numBits)
|
||||
{
|
||||
signed char * tmp = new signed char[static_cast<size_t>(m_numInUseBytes)];
|
||||
memset(&(tmp[oldNumInUseBytes]), 0, static_cast<size_t>(m_numInUseBytes - oldNumInUseBytes));
|
||||
if ((oldNumInUseBytes > 0) && (m_arrayData != NULL))
|
||||
if ((oldNumInUseBytes > 0) && (m_arrayData != nullptr))
|
||||
memcpy(tmp, m_arrayData, static_cast<size_t>(oldNumInUseBytes)); //lint !e671 !e670 logically, you can't enter this code block unless oldNumInUseBytes is smaller.
|
||||
|
||||
m_numAllocatedBytes = m_numInUseBytes;
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
|
||||
// for DB persistence purpose, returns the BitArray as a
|
||||
// std::string where each 4 bits are printed as a hex nibble;
|
||||
// and the converse that takes the null-terminated string
|
||||
// and the converse that takes the nullptr-terminated string
|
||||
// and converts it back into the BitArray
|
||||
void getAsDbTextString(std::string &result, int maxNibbleCount = 32767) const;
|
||||
void setFromDbTextString(const char * text);
|
||||
|
||||
@@ -17,11 +17,11 @@ std::string CalendarTime::convertEpochToTimeStringGMT(time_t epoch)
|
||||
std::string result;
|
||||
|
||||
struct tm * timeinfo = ::gmtime(&epoch);
|
||||
if (timeinfo == NULL)
|
||||
if (timeinfo == nullptr)
|
||||
return result;
|
||||
|
||||
char * asciiTime = ::asctime(timeinfo);
|
||||
if (asciiTime == NULL)
|
||||
if (asciiTime == nullptr)
|
||||
return result;
|
||||
|
||||
static char resultBuffer[512];
|
||||
@@ -48,7 +48,7 @@ std::string CalendarTime::convertEpochToTimeStringGMT_YYYYMMDDHHMMSS(time_t epoc
|
||||
std::string result;
|
||||
|
||||
struct tm * timeinfo = ::gmtime(&epoch);
|
||||
if (timeinfo == NULL)
|
||||
if (timeinfo == nullptr)
|
||||
return result;
|
||||
|
||||
static char resultBuffer[512];
|
||||
@@ -64,11 +64,11 @@ std::string CalendarTime::convertEpochToTimeStringLocal(time_t epoch)
|
||||
std::string result;
|
||||
|
||||
struct tm * timeinfo = ::localtime(&epoch);
|
||||
if (timeinfo == NULL)
|
||||
if (timeinfo == nullptr)
|
||||
return result;
|
||||
|
||||
char * asciiTime = ::asctime(timeinfo);
|
||||
if (asciiTime == NULL)
|
||||
if (asciiTime == nullptr)
|
||||
return result;
|
||||
|
||||
static char resultBuffer[512];
|
||||
@@ -105,7 +105,7 @@ std::string CalendarTime::convertEpochToTimeStringLocal_YYYYMMDDHHMMSS(time_t ep
|
||||
std::string result;
|
||||
|
||||
struct tm * timeinfo = ::localtime(&epoch);
|
||||
if (timeinfo == NULL)
|
||||
if (timeinfo == nullptr)
|
||||
return result;
|
||||
|
||||
static char resultBuffer[512];
|
||||
@@ -218,7 +218,7 @@ time_t CalendarTime::getNextGMTTimeOcurrence(time_t const startTime, int const d
|
||||
// the year, month, day, day of week, hour, minute, second
|
||||
// in GMT time
|
||||
struct tm * timeinfo = ::gmtime(&startTime);
|
||||
if (timeinfo == NULL)
|
||||
if (timeinfo == nullptr)
|
||||
return -1;
|
||||
|
||||
// get number of days until the specified day of week to search for
|
||||
@@ -333,7 +333,7 @@ time_t CalendarTime::getNextGMTTimeOcurrence(time_t const startTime, int const m
|
||||
// the year, month, day, day of week, hour, minute, second
|
||||
// in GMT time
|
||||
struct tm * timeinfo = ::gmtime(&startTime);
|
||||
if (timeinfo == NULL)
|
||||
if (timeinfo == nullptr)
|
||||
return -1;
|
||||
|
||||
// calculate the Epoch GMT time for the specified start time
|
||||
@@ -358,7 +358,7 @@ time_t CalendarTime::getNextGMTTimeOcurrence(time_t const startTime, int const m
|
||||
startTimeAtSpecifiedHourMinuteSecond += (60 * 60 * 24);
|
||||
|
||||
timeinfo = ::gmtime(&startTimeAtSpecifiedHourMinuteSecond);
|
||||
if (timeinfo == NULL)
|
||||
if (timeinfo == nullptr)
|
||||
return -1;
|
||||
|
||||
if (++sentinel > maxIterations)
|
||||
|
||||
@@ -63,7 +63,7 @@ bool CommandLine::Option::isOptionNext(
|
||||
int optionSpecCount
|
||||
)
|
||||
{
|
||||
DEBUG_FATAL(!optionSpec, ("null optionSpec arg"));
|
||||
DEBUG_FATAL(!optionSpec, ("nullptr optionSpec arg"));
|
||||
if (!optionSpecCount)
|
||||
return false;
|
||||
else
|
||||
@@ -77,8 +77,8 @@ CommandLine::Option *CommandLine::Option::createOption(
|
||||
int *optionCount
|
||||
)
|
||||
{
|
||||
DEBUG_FATAL(!optionSpec, ("null optionSpec arg"));
|
||||
DEBUG_FATAL(!optionCount, ("null optionCount arg"));
|
||||
DEBUG_FATAL(!optionSpec, ("nullptr optionSpec arg"));
|
||||
DEBUG_FATAL(!optionCount, ("nullptr optionCount arg"));
|
||||
DEBUG_FATAL(!isOptionNext(*optionSpec, *optionCount), ("attempted to create option with non-option data"));
|
||||
|
||||
const char newShortName = (*optionSpec)->char1;
|
||||
@@ -129,7 +129,7 @@ CommandLine::MatchCode CommandLine::Option::match(void)
|
||||
// matching this short or long name. If the arg specs don't match, we've
|
||||
// got an argument matching error.
|
||||
|
||||
DEBUG_FATAL(!optionTable, ("internal error: null option table"));
|
||||
DEBUG_FATAL(!optionTable, ("internal error: nullptr option table"));
|
||||
|
||||
OptionTable::Record *record = 0;
|
||||
|
||||
@@ -145,7 +145,7 @@ CommandLine::MatchCode CommandLine::Option::match(void)
|
||||
DEBUG_FATAL(!record, ("failed to find option info record for option --%s", longName));
|
||||
}
|
||||
else
|
||||
DEBUG_FATAL(true, ("corrupted option? both short and long name are null"));
|
||||
DEBUG_FATAL(true, ("corrupted option? both short and long name are nullptr"));
|
||||
|
||||
|
||||
// attempt to match against this option against commandline-specified options
|
||||
@@ -200,7 +200,7 @@ bool CommandLine::Collection::isCollectionNext(
|
||||
int optionSpecCount
|
||||
)
|
||||
{
|
||||
DEBUG_FATAL(!optionSpec, ("null optionSpec arg"));
|
||||
DEBUG_FATAL(!optionSpec, ("nullptr optionSpec arg"));
|
||||
if (!optionSpecCount)
|
||||
return false;
|
||||
else
|
||||
@@ -214,8 +214,8 @@ CommandLine::Collection *CommandLine::Collection::createCollection(
|
||||
int *optionSpecCount
|
||||
)
|
||||
{
|
||||
DEBUG_FATAL(!optionSpec, ("null optionSpec arg"));
|
||||
DEBUG_FATAL(!optionSpecCount, ("null optionSpecCount arg"));
|
||||
DEBUG_FATAL(!optionSpec, ("nullptr optionSpec arg"));
|
||||
DEBUG_FATAL(!optionSpecCount, ("nullptr optionSpecCount arg"));
|
||||
|
||||
DEBUG_FATAL(!isCollectionNext(*optionSpec, *optionSpecCount), ("tried to create collection from non-collection optionSpec"));
|
||||
if ((*optionSpec)->optionType == OST_BeginList)
|
||||
@@ -289,7 +289,7 @@ bool CommandLine::List::Node::isNode(
|
||||
int optionCount
|
||||
)
|
||||
{
|
||||
DEBUG_FATAL(!optionSpec, ("null optionSpec arg"));
|
||||
DEBUG_FATAL(!optionSpec, ("nullptr optionSpec arg"));
|
||||
if (!optionCount)
|
||||
return false;
|
||||
else
|
||||
@@ -303,8 +303,8 @@ CommandLine::List::Node *CommandLine::List::Node::createNode(
|
||||
int *optionCount
|
||||
)
|
||||
{
|
||||
DEBUG_FATAL(!optionSpec, ("null optionSpec arg"));
|
||||
DEBUG_FATAL(!optionCount, ("null optionCount arg"));
|
||||
DEBUG_FATAL(!optionSpec, ("nullptr optionSpec arg"));
|
||||
DEBUG_FATAL(!optionCount, ("nullptr optionCount arg"));
|
||||
DEBUG_FATAL(!isNode(*optionSpec, *optionCount), ("attempted to create list node with non-list-node data"));
|
||||
|
||||
Option *newOption = 0;
|
||||
@@ -350,7 +350,7 @@ CommandLine::List::List(
|
||||
listType(newListType),
|
||||
minimumNodeCount(0)
|
||||
{
|
||||
DEBUG_FATAL(!newFirstNode, ("null newFirstNode arg"));
|
||||
DEBUG_FATAL(!newFirstNode, ("nullptr newFirstNode arg"));
|
||||
DEBUG_FATAL(newListType != OPLT_Normal, ("constructor only good for OPLT_Normal lists, caller passed %d", newListType));
|
||||
}
|
||||
|
||||
@@ -366,7 +366,7 @@ CommandLine::List::List(
|
||||
listType(newListType),
|
||||
minimumNodeCount(newMinimumNodeCount)
|
||||
{
|
||||
DEBUG_FATAL(!newFirstNode, ("null newFirstNode arg"));
|
||||
DEBUG_FATAL(!newFirstNode, ("nullptr newFirstNode arg"));
|
||||
DEBUG_FATAL(newListType != OPLT_MinimumMatch, ("constructor only good for OPLT_MinimumMatch lists, caller passed %d", newListType));
|
||||
}
|
||||
|
||||
@@ -391,7 +391,7 @@ bool CommandLine::List::isListNext(
|
||||
int optionCount
|
||||
)
|
||||
{
|
||||
DEBUG_FATAL(!optionSpec, ("null optionSpec arg"));
|
||||
DEBUG_FATAL(!optionSpec, ("nullptr optionSpec arg"));
|
||||
if (!optionCount)
|
||||
return false;
|
||||
else
|
||||
@@ -405,8 +405,8 @@ CommandLine::List *CommandLine::List::createList(
|
||||
int *optionCount
|
||||
)
|
||||
{
|
||||
DEBUG_FATAL(!optionSpec, ("null optionSpec arg"));
|
||||
DEBUG_FATAL(!optionCount, ("null optionCount arg"));
|
||||
DEBUG_FATAL(!optionSpec, ("nullptr optionSpec arg"));
|
||||
DEBUG_FATAL(!optionCount, ("nullptr optionCount arg"));
|
||||
DEBUG_FATAL(!isListNext(*optionSpec, *optionCount), ("tried to create list from non-list optionSpec"));
|
||||
|
||||
Node *newFirstNode = 0;
|
||||
@@ -582,7 +582,7 @@ bool CommandLine::Switch::Node::isNode(
|
||||
const OptionSpec *optionSpec,
|
||||
int optionCount)
|
||||
{
|
||||
DEBUG_FATAL(!optionSpec, ("null optionSpec arg"));
|
||||
DEBUG_FATAL(!optionSpec, ("nullptr optionSpec arg"));
|
||||
if (!optionCount)
|
||||
return false;
|
||||
else
|
||||
@@ -596,8 +596,8 @@ CommandLine::Switch::Node *CommandLine::Switch::Node::createNode(
|
||||
int *optionCount
|
||||
)
|
||||
{
|
||||
DEBUG_FATAL(!optionSpec, ("null optionSpec arg"));
|
||||
DEBUG_FATAL(!optionCount, ("null optionCount arg"));
|
||||
DEBUG_FATAL(!optionSpec, ("nullptr optionSpec arg"));
|
||||
DEBUG_FATAL(!optionCount, ("nullptr optionCount arg"));
|
||||
DEBUG_FATAL(!isNode(*optionSpec, *optionCount), ("attempted to create list node with non-list-node data"));
|
||||
|
||||
Option *newOption = 0;
|
||||
@@ -664,7 +664,7 @@ bool CommandLine::Switch::isSwitchNext(
|
||||
int optionCount
|
||||
)
|
||||
{
|
||||
DEBUG_FATAL(!optionSpec, ("null optionSpec arg"));
|
||||
DEBUG_FATAL(!optionSpec, ("nullptr optionSpec arg"));
|
||||
if (!optionCount)
|
||||
return false;
|
||||
else
|
||||
@@ -678,8 +678,8 @@ CommandLine::Switch *CommandLine::Switch::createSwitch(
|
||||
int *optionCount
|
||||
)
|
||||
{
|
||||
DEBUG_FATAL(!optionSpec, ("null optionSpec arg"));
|
||||
DEBUG_FATAL(!optionCount, ("null optionCount arg"));
|
||||
DEBUG_FATAL(!optionSpec, ("nullptr optionSpec arg"));
|
||||
DEBUG_FATAL(!optionCount, ("nullptr optionCount arg"));
|
||||
DEBUG_FATAL(!isSwitchNext(*optionSpec, *optionCount), ("tried to create switch from non-switch option spec"));
|
||||
|
||||
const bool newOneNodeIsRequired = ((*optionSpec)->int1 != 0);
|
||||
@@ -886,7 +886,7 @@ CommandLine::OptionTable::Record *CommandLine::OptionTable::findOptionRecord(
|
||||
char shortName
|
||||
) const
|
||||
{
|
||||
DEBUG_FATAL(!shortName, ("null shortName arg"));
|
||||
DEBUG_FATAL(!shortName, ("nullptr shortName arg"));
|
||||
|
||||
// walk the list
|
||||
for (Record *record = firstRecord; record; record = record->getNext())
|
||||
@@ -960,7 +960,7 @@ CommandLine::Lexer::Lexer(
|
||||
) :
|
||||
nextCharacter(newBuffer)
|
||||
{
|
||||
DEBUG_FATAL(!newBuffer, ("null newBuffer arg"));
|
||||
DEBUG_FATAL(!newBuffer, ("nullptr newBuffer arg"));
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -994,10 +994,10 @@ CommandLine::Lexer::~Lexer(void)
|
||||
|
||||
bool CommandLine::Lexer::gobbleString(bool isRequired, char *stringBuffer, int stringSize)
|
||||
{
|
||||
DEBUG_FATAL(!stringBuffer, ("null stringStart arg"));
|
||||
DEBUG_FATAL(!stringBuffer, ("nullptr stringStart arg"));
|
||||
DEBUG_FATAL(!stringSize, ("stringSize is zero"));
|
||||
|
||||
DEBUG_FATAL(!nextCharacter, ("null nextChar"));
|
||||
DEBUG_FATAL(!nextCharacter, ("nullptr nextChar"));
|
||||
|
||||
|
||||
int stringLength = 0;
|
||||
@@ -1069,7 +1069,7 @@ bool CommandLine::Lexer::gobbleString(bool isRequired, char *stringBuffer, int s
|
||||
if (isRequired && (stringLength == 0))
|
||||
return false;
|
||||
|
||||
// null-terminate the string
|
||||
// nullptr-terminate the string
|
||||
*stringBuffer = 0;
|
||||
return true;
|
||||
}
|
||||
@@ -1078,8 +1078,8 @@ bool CommandLine::Lexer::gobbleString(bool isRequired, char *stringBuffer, int s
|
||||
|
||||
bool CommandLine::Lexer::getNextToken(Token *token)
|
||||
{
|
||||
DEBUG_FATAL(!token, ("null token arg"));
|
||||
DEBUG_FATAL(!nextCharacter, ("null nextCharacter"));
|
||||
DEBUG_FATAL(!token, ("nullptr token arg"));
|
||||
DEBUG_FATAL(!nextCharacter, ("nullptr nextCharacter"));
|
||||
|
||||
// clear out the token
|
||||
memset(token, 0, sizeof(*token));
|
||||
@@ -1204,7 +1204,7 @@ void CommandLine::remove(void)
|
||||
|
||||
void CommandLine::buildOptionTree(const OptionSpec *specList, int specCount)
|
||||
{
|
||||
DEBUG_FATAL(!specList, ("null specList arg"));
|
||||
DEBUG_FATAL(!specList, ("nullptr specList arg"));
|
||||
|
||||
if (!specCount)
|
||||
{
|
||||
@@ -1247,7 +1247,7 @@ CommandLine::MatchCode CommandLine::parseCommandLineBuffer(void)
|
||||
case Lexer::TT_ShortOption:
|
||||
// we've found a short option, make sure specified short option exists
|
||||
{
|
||||
DEBUG_FATAL(!optionTable, ("internal error: null optionTable"));
|
||||
DEBUG_FATAL(!optionTable, ("internal error: nullptr optionTable"));
|
||||
OptionTable::Record *record = optionTable->findOptionRecord(token.getShortName());
|
||||
if (!record)
|
||||
{
|
||||
@@ -1279,7 +1279,7 @@ CommandLine::MatchCode CommandLine::parseCommandLineBuffer(void)
|
||||
case Lexer::TT_LongOption:
|
||||
// we've found a long option, make sure specified long option exists
|
||||
{
|
||||
DEBUG_FATAL(!optionTable, ("internal error: null optionTable"));
|
||||
DEBUG_FATAL(!optionTable, ("internal error: nullptr optionTable"));
|
||||
OptionTable::Record *record = optionTable->findOptionRecord(token.getLongName());
|
||||
if (!record)
|
||||
{
|
||||
@@ -1322,7 +1322,7 @@ CommandLine::MatchCode CommandLine::parseCommandLineBuffer(void)
|
||||
|
||||
case Lexer::TT_Argument:
|
||||
{
|
||||
DEBUG_FATAL(!optionTable, ("internal error: null optionTable"));
|
||||
DEBUG_FATAL(!optionTable, ("internal error: nullptr optionTable"));
|
||||
OptionTable::Record *record = optionTable->findOptionRecord(OP_SNAME_UNTAGGED);
|
||||
if (!record)
|
||||
{
|
||||
@@ -1382,7 +1382,7 @@ CommandLine::MatchCode CommandLine::parseCommandLineBuffer(void)
|
||||
void CommandLine::absorbString(const char *newString)
|
||||
{
|
||||
DEBUG_FATAL(!installed, ("CommandLine not installed"));
|
||||
DEBUG_FATAL(!newString, ("null newString arg"));
|
||||
DEBUG_FATAL(!newString, ("nullptr newString arg"));
|
||||
|
||||
const int stringLength = static_cast<int>(strlen(newString));
|
||||
int requiredBufferSpace;
|
||||
@@ -1398,7 +1398,7 @@ void CommandLine::absorbString(const char *newString)
|
||||
buffer[bufferSize++] = ' ';
|
||||
}
|
||||
|
||||
// copy contents of buffer, including null
|
||||
// copy contents of buffer, including nullptr
|
||||
memcpy(buffer + bufferSize, newString, stringLength + 1);
|
||||
bufferSize += stringLength;
|
||||
|
||||
@@ -1437,7 +1437,7 @@ void CommandLine::absorbString(const char *newString)
|
||||
void CommandLine::absorbStrings(const char **stringArray, int stringCount)
|
||||
{
|
||||
DEBUG_FATAL(!installed, ("CommandLine not installed"));
|
||||
DEBUG_FATAL(!stringArray, ("null string array"));
|
||||
DEBUG_FATAL(!stringArray, ("nullptr string array"));
|
||||
|
||||
for (int i = 0; i < stringCount; ++i)
|
||||
absorbString(stringArray[i]);
|
||||
@@ -1452,7 +1452,7 @@ void CommandLine::absorbStrings(const char **stringArray, int stringCount)
|
||||
* (i.e. "-- ") will be considered part of the post command line string.
|
||||
*
|
||||
* @return A read-only pointer to the portion of the command line not meant
|
||||
* for CommandLine parsing. May be NULL if the entire command line
|
||||
* for CommandLine parsing. May be nullptr if the entire command line
|
||||
* was meant for CommandLine or if no command line was specified.
|
||||
*/
|
||||
|
||||
@@ -1704,7 +1704,7 @@ int CommandLine::getOccurrenceCount(const char *longName)
|
||||
* @param shortName [IN] short name of the option
|
||||
* @param occurrenceIndex [IN] zero-based occurrence number
|
||||
* @return The read-only argument string associated with the specified option occurrence.
|
||||
* May be NULL if no argument was associated with the specified option.
|
||||
* May be nullptr if no argument was associated with the specified option.
|
||||
*/
|
||||
|
||||
const char *CommandLine::getOptionString(char shortName, int occurrenceIndex)
|
||||
@@ -1730,7 +1730,7 @@ const char *CommandLine::getOptionString(char shortName, int occurrenceIndex)
|
||||
* @param longName [IN] long name of the option
|
||||
* @param occurrenceIndex [IN] zero-based occurrence number
|
||||
* @return The read-only argument string associated with the specified option occurrence.
|
||||
* May be NULL if no argument was associated with the specified option.
|
||||
* May be nullptr if no argument was associated with the specified option.
|
||||
*/
|
||||
|
||||
const char *CommandLine::getOptionString(const char *longName, int occurrenceIndex)
|
||||
|
||||
@@ -755,7 +755,7 @@ inline const char *CommandLine::Lexer::getNextCharacter(void)
|
||||
|
||||
inline void CommandLine::Lexer::gobbleWhitespace(void)
|
||||
{
|
||||
DEBUG_FATAL(!nextCharacter, ("null nextCharacter"));
|
||||
DEBUG_FATAL(!nextCharacter, ("nullptr nextCharacter"));
|
||||
while (isspace(*nextCharacter))
|
||||
++nextCharacter;
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ static char tagBuffer[6];
|
||||
#define CONFIG_FILE_TEMPLATE_CREATE_INT(section, key, def) DEBUG_REPORT_LOG(true, ("cfg: [%s] %s=%d\n", section, key, def))
|
||||
#define CONFIG_FILE_TEMPLATE_CREATE_BOOL(section, key, def) DEBUG_REPORT_LOG(true, ("cfg: [%s] %s=%s\n", section, key, def ? "true" : "false"))
|
||||
#define CONFIG_FILE_TEMPLATE_CREATE_FLOAT(section, key, def) DEBUG_REPORT_LOG(true, ("cfg: [%s] %s=%3.1f\n", section, key, def))
|
||||
#define CONFIG_FILE_TEMPLATE_CREATE_STRING(section, key, def) DEBUG_REPORT_LOG(true, ("cfg: [%s] %s=%s\n", section, key, def ? def : "NULL"))
|
||||
#define CONFIG_FILE_TEMPLATE_CREATE_STRING(section, key, def) DEBUG_REPORT_LOG(true, ("cfg: [%s] %s=%s\n", section, key, def ? def : "nullptr"))
|
||||
#define CONFIG_FILE_TEMPLATE_CREATE_TAG(section, key, def) ConvertTagToString(def, tagBuffer), DEBUG_REPORT_LOG(true, ("cfg: [%s] %s=%d\n", section, key, tagBuffer))
|
||||
|
||||
#else
|
||||
@@ -43,8 +43,8 @@ static char tagBuffer[6];
|
||||
|
||||
#endif
|
||||
|
||||
#define NO_SPACE_SECTION(a) DEBUG_FATAL(strchr(a, ' ') != NULL, ("No spaces are allowed in config file section names: %s", a))
|
||||
#define NO_SPACE_KEY(a) DEBUG_FATAL(strchr(a, ' ') != NULL, ("No spaces are allowed in config file key names: %s", a))
|
||||
#define NO_SPACE_SECTION(a) DEBUG_FATAL(strchr(a, ' ') != nullptr, ("No spaces are allowed in config file section names: %s", a))
|
||||
#define NO_SPACE_KEY(a) DEBUG_FATAL(strchr(a, ' ') != nullptr, ("No spaces are allowed in config file key names: %s", a))
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -81,7 +81,7 @@ void ConfigFile::install(void)
|
||||
#endif
|
||||
|
||||
ms_sections = new ConfigFile::SectionMap;
|
||||
ms_currentSection = NULL;
|
||||
ms_currentSection = nullptr;
|
||||
ExitChain::add(ConfigFile::remove, "ConfigFile::remove");
|
||||
ms_installed = true;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ void ConfigFile::remove(void)
|
||||
for (std::map<const char *, Section *, StringCompare>::iterator it = ms_sections->begin(); it != ms_sections->end(); ++it)
|
||||
delete it->second;
|
||||
delete ms_sections;
|
||||
ms_sections = NULL;
|
||||
ms_sections = nullptr;
|
||||
ms_installed = false;
|
||||
}
|
||||
|
||||
@@ -142,7 +142,7 @@ bool ConfigFile::loadFromCommandLine(const char *buffer)
|
||||
while (isspace(*buffer))
|
||||
{
|
||||
++buffer;
|
||||
// advancing buffer, check for null (trailing white space on command line)
|
||||
// advancing buffer, check for nullptr (trailing white space on command line)
|
||||
if(! *buffer)
|
||||
break;
|
||||
}
|
||||
@@ -196,7 +196,7 @@ bool ConfigFile::loadFromCommandLine(const char *buffer)
|
||||
//allocate a new section and set it as the current one
|
||||
Section *newSection = createSection(sectionName);
|
||||
//note that newSection is memory owned by the created Section object
|
||||
//while sectionName is memory allocated to create a null terminated string
|
||||
//while sectionName is memory allocated to create a nullptr terminated string
|
||||
ms_currentSection = newSection;
|
||||
}
|
||||
delete[] sectionName;
|
||||
@@ -292,7 +292,7 @@ bool ConfigFile::loadFromBuffer(char const * const buffer, int const length)
|
||||
processLine(currentLine);
|
||||
delete[] currentLine;
|
||||
bufferPosition += lineLength+1;
|
||||
//trim ending whitespace. Remember that this string is not guaranteed to be NULL terminated.
|
||||
//trim ending whitespace. Remember that this string is not guaranteed to be nullptr terminated.
|
||||
while (*bufferPosition && (bufferPosition < buffer + length) && isspace(static_cast<unsigned char>(*bufferPosition)))
|
||||
++bufferPosition;
|
||||
}
|
||||
@@ -311,26 +311,26 @@ bool ConfigFile::loadFile(const char *file)
|
||||
{
|
||||
DEBUG_FATAL(!ms_installed, ("ConfigFile not installed"));
|
||||
NOT_NULL(file);
|
||||
ms_currentSection = NULL;
|
||||
HANDLE handle = CreateFile(file, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
ms_currentSection = nullptr;
|
||||
HANDLE handle = CreateFile(file, GENERIC_READ, FILE_SHARE_READ, nullptr, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
|
||||
if (handle != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
// get the length of the config file
|
||||
const DWORD length = GetFileSize(handle, NULL);
|
||||
const DWORD length = GetFileSize(handle, nullptr);
|
||||
|
||||
if (length != 0xffffffff)
|
||||
{
|
||||
// create a buffer to load the config file into
|
||||
char * const buffer = new char[length+2];
|
||||
|
||||
// make sure the buffer is null terminated
|
||||
// make sure the buffer is nullptr terminated
|
||||
buffer[length] = '\n';
|
||||
buffer[length+1] = '\0';
|
||||
|
||||
// read the config file in
|
||||
DWORD readResult;
|
||||
const BOOL result = ReadFile(handle, buffer, length, &readResult, NULL);
|
||||
const BOOL result = ReadFile(handle, buffer, length, &readResult, nullptr);
|
||||
|
||||
// make sure we read all the correct stuff
|
||||
if (result && readResult == length)
|
||||
@@ -360,7 +360,7 @@ void ConfigFile::processLine(const char *line)
|
||||
{
|
||||
DEBUG_FATAL(!ms_installed, ("ConfigFile not installed"));
|
||||
// validate argument
|
||||
DEBUG_FATAL(!line, ("ConfigFile::processLine NULL"));
|
||||
DEBUG_FATAL(!line, ("ConfigFile::processLine nullptr"));
|
||||
|
||||
// check for a full line comment
|
||||
if (*line == '#' || *line == ';')
|
||||
@@ -418,7 +418,7 @@ void ConfigFile::processLine(const char *line)
|
||||
//allocate a new section and set it as the current one
|
||||
Section *newSection = createSection(sectionName);
|
||||
//note that newSection is memory owned by the created Section object
|
||||
//while sectionName is memory allocated to create a null terminated string
|
||||
//while sectionName is memory allocated to create a nullptr terminated string
|
||||
ms_currentSection = newSection;
|
||||
}
|
||||
delete[] sectionName;
|
||||
@@ -468,7 +468,7 @@ void ConfigFile::processKeys(const char *line)
|
||||
while (*endValue)
|
||||
{
|
||||
//build the value
|
||||
char *value = NULL;
|
||||
char *value = nullptr;
|
||||
while(isspace(*beginValue))
|
||||
++beginValue;
|
||||
if (*beginValue != '"')
|
||||
@@ -542,7 +542,7 @@ void ConfigFile::processKeys(const char *line)
|
||||
/** Get a Section pointer from a string
|
||||
*
|
||||
* @param section the name of the section
|
||||
* @return the pointer if valid, otherwise NULL
|
||||
* @return the pointer if valid, otherwise nullptr
|
||||
*/
|
||||
ConfigFile::Section *ConfigFile::getSection(const char *section)
|
||||
{
|
||||
@@ -550,7 +550,7 @@ ConfigFile::Section *ConfigFile::getSection(const char *section)
|
||||
if (it != ms_sections->end())
|
||||
return it->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -581,7 +581,7 @@ void ConfigFile::removeSection(const char *name)
|
||||
if (iter != ms_sections->end())
|
||||
{
|
||||
delete iter->second;
|
||||
iter->second = NULL;
|
||||
iter->second = nullptr;
|
||||
ms_sections->erase(iter);
|
||||
}
|
||||
}
|
||||
@@ -991,7 +991,7 @@ Tag ConfigFile::getKeyTag(const char *section, const char *key, Tag defaultValue
|
||||
|
||||
ConfigFile::Element::Element(void)
|
||||
:
|
||||
m_entry(NULL)
|
||||
m_entry(nullptr)
|
||||
{}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
@@ -1105,8 +1105,8 @@ Tag ConfigFile::Element::getAsTag(void) const
|
||||
|
||||
ConfigFile::Key::Key(const char *name, const char *value, bool lazyAdd)
|
||||
:
|
||||
m_elements(NULL),
|
||||
m_name(NULL),
|
||||
m_elements(nullptr),
|
||||
m_name(nullptr),
|
||||
m_lazyAdd(lazyAdd)
|
||||
{
|
||||
m_name = new char[strlen(name)+1];
|
||||
@@ -1248,8 +1248,8 @@ void ConfigFile::Key::dump(const char *keyName) const
|
||||
|
||||
ConfigFile::Section::Section(const char *name)
|
||||
:
|
||||
m_keys(NULL),
|
||||
m_name(NULL)
|
||||
m_keys(nullptr),
|
||||
m_name(nullptr)
|
||||
{
|
||||
m_name = new char[strlen(name)+1];
|
||||
strcpy(m_name, name);
|
||||
@@ -1284,7 +1284,7 @@ ConfigFile::Key *ConfigFile::Section::findKey(const char *key) const
|
||||
if (it != m_keys->end())
|
||||
return it->second;
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
@@ -99,7 +99,7 @@ public:
|
||||
int getKeyInt (const char *key, int index, int defaultValue = 0) const;
|
||||
bool getKeyBool (const char *key, int index, bool defaultValue = false) const;
|
||||
float getKeyFloat (const char *key, int index, float defaultValue = 0.f) const;
|
||||
const char *getKeyString(const char *key, int index, const char *defaultValue = NULL) const;
|
||||
const char *getKeyString(const char *key, int index, const char *defaultValue = nullptr) const;
|
||||
Tag getKeyTag (const char *key, int index, Tag defaultValue = 0) const;
|
||||
int getKeyCount(const char *key) const;
|
||||
void addKey(const char *keyName, const char *value, bool lazyAdd = false);
|
||||
|
||||
@@ -87,7 +87,7 @@ char const * CrashReportInformation::getEntry(int index)
|
||||
if (index < static_cast<int>(ms_dynamicText.size()))
|
||||
return ms_dynamicText[index];
|
||||
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// ======================================================================
|
||||
|
||||
@@ -99,7 +99,7 @@ uint32 Crc::calculateWithToLower(const char *string)
|
||||
|
||||
uint32 Crc::calculate(const void *data, int length, uint32 initCrc)
|
||||
{
|
||||
DEBUG_FATAL(!data, ("null data arg"));
|
||||
DEBUG_FATAL(!data, ("nullptr data arg"));
|
||||
|
||||
uint32 crc;
|
||||
const byte *d = reinterpret_cast<const byte *>(data);
|
||||
|
||||
@@ -31,9 +31,9 @@ using namespace CrcStringTableNamespace;
|
||||
CrcStringTable::CrcStringTable()
|
||||
:
|
||||
m_numberOfEntries(0),
|
||||
m_crcTable(NULL),
|
||||
m_stringsOffsetTable(NULL),
|
||||
m_strings(NULL)
|
||||
m_crcTable(nullptr),
|
||||
m_stringsOffsetTable(nullptr),
|
||||
m_strings(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -42,9 +42,9 @@ CrcStringTable::CrcStringTable()
|
||||
CrcStringTable::CrcStringTable(char const * fileName)
|
||||
:
|
||||
m_numberOfEntries(0),
|
||||
m_crcTable(NULL),
|
||||
m_stringsOffsetTable(NULL),
|
||||
m_strings(NULL)
|
||||
m_crcTable(nullptr),
|
||||
m_stringsOffsetTable(nullptr),
|
||||
m_strings(nullptr)
|
||||
{
|
||||
load(fileName);
|
||||
}
|
||||
@@ -69,7 +69,7 @@ void CrcStringTable::load(char const * fileName)
|
||||
if(fileName)
|
||||
DEBUG_WARNING(true, ("Could not load CrcStringTable %s", fileName));
|
||||
else
|
||||
DEBUG_WARNING(true, ("Could not load CrcStringTable, NULL file given"));
|
||||
DEBUG_WARNING(true, ("Could not load CrcStringTable, nullptr file given"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ private:
|
||||
template <typename T>
|
||||
inline void DataResourceList<T>::install()
|
||||
{
|
||||
if (ms_bindings == NULL)
|
||||
if (ms_bindings == nullptr)
|
||||
{
|
||||
ms_bindings = new CreateDataResourceMap();
|
||||
ms_loaded = new LoadedDataResourceMap();
|
||||
@@ -100,7 +100,7 @@ inline void DataResourceList<T>::install()
|
||||
template <typename T>
|
||||
inline void DataResourceList<T>::remove(void)
|
||||
{
|
||||
if (ms_loaded != NULL)
|
||||
if (ms_loaded != nullptr)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
if (!ms_loaded->empty())
|
||||
@@ -122,13 +122,13 @@ inline void DataResourceList<T>::remove(void)
|
||||
#endif // _DEBUG
|
||||
|
||||
delete ms_loaded;
|
||||
ms_loaded = NULL;
|
||||
ms_loaded = nullptr;
|
||||
}
|
||||
|
||||
if (ms_bindings != NULL)
|
||||
if (ms_bindings != nullptr)
|
||||
{
|
||||
delete ms_bindings;
|
||||
ms_bindings = NULL;
|
||||
ms_bindings = nullptr;
|
||||
}
|
||||
} // DataResourceList<T>::remove
|
||||
|
||||
@@ -144,7 +144,7 @@ template <typename T>
|
||||
inline void DataResourceList<T>::registerTemplate(Tag id,
|
||||
CreateDataResourceFunc createFunc)
|
||||
{
|
||||
if (ms_bindings == NULL)
|
||||
if (ms_bindings == nullptr)
|
||||
install();
|
||||
|
||||
#ifdef _DEBUG
|
||||
@@ -237,7 +237,7 @@ inline T * DataResourceList<T>::fetch(Tag id)
|
||||
|
||||
typename CreateDataResourceMap::iterator iter = ms_bindings->find(id);
|
||||
if (iter == ms_bindings->end())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
return (*(*iter).second)("");
|
||||
} // DataResourceList<T>::fetch(Tag)
|
||||
@@ -268,11 +268,11 @@ inline const T * DataResourceList<T>::fetch(Iff &source)
|
||||
char buffer[5];
|
||||
ConvertTagToString(id, buffer);
|
||||
DEBUG_WARNING(true, ("DataResourceList::fetch Iff: trying to fetch resource for unknown tag %s!", buffer));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
T *newDataResource = (*(*createIter).second)(source.getFileName());
|
||||
if (newDataResource != NULL)
|
||||
if (newDataResource != nullptr)
|
||||
{
|
||||
// initialize the data resource
|
||||
newDataResource->loadFromIff(source);
|
||||
@@ -310,11 +310,11 @@ inline const T * DataResourceList<T>::fetch(const CrcString &filename)
|
||||
// load the template
|
||||
Iff iff;
|
||||
if (!iff.open(filename.getString(), true))
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
// put the template in the loaded list
|
||||
const T * const newDataResource = fetch(iff);
|
||||
if (newDataResource != NULL)
|
||||
if (newDataResource != nullptr)
|
||||
{
|
||||
newDataResource->addReference();
|
||||
ms_loaded->insert(std::make_pair(&newDataResource->getCrcName (), newDataResource));
|
||||
@@ -337,13 +337,13 @@ inline void DataResourceList<T>::release(const T & dataResource)
|
||||
{
|
||||
NOT_NULL(ms_loaded);
|
||||
|
||||
if (ms_loaded != NULL && dataResource.getReferenceCount() == 0)
|
||||
if (ms_loaded != nullptr && dataResource.getReferenceCount() == 0)
|
||||
{
|
||||
typename LoadedDataResourceMap::iterator iter = ms_loaded->find(&dataResource.getCrcName());
|
||||
if (iter != ms_loaded->end())
|
||||
{
|
||||
const T * const temp = (*iter).second;
|
||||
(*iter).second = NULL;
|
||||
(*iter).second = nullptr;
|
||||
ms_loaded->erase(iter);
|
||||
delete temp;
|
||||
}
|
||||
@@ -369,11 +369,11 @@ inline T * DataResourceList<T>::reload(Iff &source)
|
||||
if (iter == ms_loaded->end())
|
||||
{
|
||||
DEBUG_WARNING(true, ("DataResourceList::reload: trying to reload unloaded resource %s!", source.getFileName()));
|
||||
return NULL;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
T * const dataResource = const_cast<T *>((*iter).second);
|
||||
if (dataResource != NULL)
|
||||
if (dataResource != nullptr)
|
||||
{
|
||||
// initialize the data resource
|
||||
dataResource->loadFromIff(source);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user