newer standards prefer nullptr over NULL - this is most of them but there are others too

This commit is contained in:
DarthArgus
2016-02-15 00:07:31 -06:00
parent 6bb5137dc4
commit 03dc62efba
937 changed files with 14983 additions and 14983 deletions
@@ -30,7 +30,7 @@ AuctionLocationsBuffer::~AuctionLocationsBuffer(void)
for (IndexType::iterator i=m_rows.begin(); i!=m_rows.end(); ++i)
{
delete i->second;
i->second=NULL;
i->second=nullptr;
}
}
@@ -56,7 +56,7 @@ void AuctionLocationsBuffer::removeAuctionLocations(const NetworkId &locationId)
if (i!=m_rows.end())
{
delete i->second;
i->second=NULL;
i->second=nullptr;
m_rows.erase(i);
}
}
@@ -30,7 +30,7 @@ BattlefieldParticipantBuffer::~BattlefieldParticipantBuffer(void)
for (IndexType::iterator i=m_rows.begin(); i!=m_rows.end(); ++i)
{
delete i->second;
i->second=NULL;
i->second=nullptr;
}
}
@@ -156,7 +156,7 @@ void BattlefieldParticipantBuffer::removeObject(const NetworkId &object)
IndexType::iterator next=i;
++next;
delete i->second;
i->second=NULL;
i->second=nullptr;
m_rows.erase(i);
i=next;
}
@@ -31,7 +31,7 @@ BountyHunterTargetBuffer::~BountyHunterTargetBuffer()
for (DataType::iterator i=m_data.begin(); i!=m_data.end(); ++i)
{
delete i->second;
i->second=NULL;
i->second=nullptr;
}
}
@@ -238,7 +238,7 @@ void CreatureObjectBuffer::getAttributesForObject(const NetworkId &objectId, std
}
if (value == -999)
{
WARNING(true,("Object %s had null attribute %i, defaulting to 100",objectId.getValueString().c_str(), position));
WARNING(true,("Object %s had nullptr attribute %i, defaulting to 100",objectId.getValueString().c_str(), position));
value = 100;
}
@@ -31,7 +31,7 @@ ExperienceBuffer::~ExperienceBuffer(void)
for (IndexType::iterator i=m_rows.begin(); i!=m_rows.end(); ++i)
{
delete i->second;
i->second=NULL;
i->second=nullptr;
}
}
@@ -157,7 +157,7 @@ void ExperienceBuffer::removeObject(const NetworkId &object)
IndexType::iterator next=i;
++next;
delete i->second;
i->second=NULL;
i->second=nullptr;
m_rows.erase(i);
i=next;
}
@@ -103,7 +103,7 @@ IndexedNetworkTableBuffer<BUFFERROW,ROW,QUERY,SELECTQUERY>::~IndexedNetworkTable
{
delete i->second;
++m_sRowsDeleted;
i->second=NULL;
i->second=nullptr;
}
}
@@ -161,7 +161,7 @@ void IndexedNetworkTableBuffer<BUFFERROW,ROW,QUERY,SELECTQUERY>::removeObject(co
{
delete i->second;
++m_sRowsDeleted;
i->second=NULL;
i->second=nullptr;
m_rows.erase(i);
}
}
@@ -31,7 +31,7 @@ ManufactureSchematicAttributeBuffer::~ManufactureSchematicAttributeBuffer(void)
for (IndexType::iterator i=m_rows.begin(); i!=m_rows.end(); ++i)
{
delete i->second;
i->second=NULL;
i->second=nullptr;
}
}
@@ -174,7 +174,7 @@ void ManufactureSchematicAttributeBuffer::removeObject(const NetworkId &object)
IndexType::iterator next=i;
++next;
delete i->second;
i->second=NULL;
i->second=nullptr;
m_rows.erase(i);
i=next;
}
@@ -31,7 +31,7 @@ MarketAuctionBidsBuffer::~MarketAuctionBidsBuffer(void)
for (IndexType::iterator i=m_rows.begin(); i!=m_rows.end(); ++i)
{
delete i->second;
i->second=NULL;
i->second=nullptr;
}
}
@@ -57,7 +57,7 @@ void MarketAuctionBidsBuffer::removeMarketAuctionBids(const NetworkId &itemId)
if (i!=m_rows.end())
{
delete i->second;
i->second=NULL;
i->second=nullptr;
m_rows.erase(i);
}
}
@@ -31,7 +31,7 @@ MarketAuctionsBufferCreate::~MarketAuctionsBufferCreate(void)
for (IndexType::iterator i=m_rows.begin(); i!=m_rows.end(); ++i)
{
delete i->second;
i->second=NULL;
i->second=nullptr;
}
}
@@ -217,7 +217,7 @@ MarketAuctionsBufferDelete::~MarketAuctionsBufferDelete(void)
for (IndexType::iterator i=m_rows.begin(); i!=m_rows.end(); ++i)
{
delete i->second;
i->second=NULL;
i->second=nullptr;
}
}
@@ -330,7 +330,7 @@ MarketAuctionsBufferUpdate::~MarketAuctionsBufferUpdate(void)
for (IndexType::iterator i=m_rows.begin(); i!=m_rows.end(); ++i)
{
delete i->second;
i->second=NULL;
i->second=nullptr;
}
}
@@ -265,11 +265,11 @@ bool ObjectTableBuffer::save(DB::Session *session)
#if 0 // Enable this to debug load_with problems
DEBUG_REPORT_LOG(true,("Save object %s ",i->second->object_id.getValue().getValueString().c_str()));
if (i->second->contained_by.isNull())
DEBUG_REPORT_LOG(true, ("contained_by NULL "));
DEBUG_REPORT_LOG(true, ("contained_by nullptr "));
else
DEBUG_REPORT_LOG(true, ("contained_by %s ",i->second->contained_by.getValue().getValueString().c_str()));
if (i->second->load_with.isNull())
DEBUG_REPORT_LOG(true,("load_with NULL\n"));
DEBUG_REPORT_LOG(true,("load_with nullptr\n"));
else
DEBUG_REPORT_LOG(true,("load_with %s\n",i->second->load_with.getValue().getValueString().c_str()));
#endif
@@ -671,7 +671,7 @@ void ObjectTableBuffer::getObjvarsForObject(const NetworkId &objectId, std::vect
int ObjectTableBuffer::encodeObjVarFreeFlags(const NetworkId & objectId) const
{
const DBSchema::ObjectBufferRow *row=findConstRowByIndex(objectId);
WARNING_STRICT_FATAL(row==NULL,("Loading object %s, no ObjectRow in the buffer\n",objectId.getValueString().c_str()));
WARNING_STRICT_FATAL(row==nullptr,("Loading object %s, no ObjectRow in the buffer\n",objectId.getValueString().c_str()));
if (!row)
return 0;
@@ -31,7 +31,7 @@ ResourceTypeBuffer::~ResourceTypeBuffer()
for (DataType::iterator i=m_data.begin(); i!=m_data.end(); ++i)
{
delete i->second;
i->second=NULL;
i->second=nullptr;
}
}
@@ -41,7 +41,7 @@ void ResourceTypeBuffer::handleAddResourceTypeMessage(AddResourceTypeMessage con
{
for (std::vector<AddResourceTypeMessageNamespace::ResourceTypeData>::const_iterator typeData = message.getData().begin(); typeData != message.getData().end(); ++typeData)
{
DBSchema::ResourceTypeRow * row = NULL;
DBSchema::ResourceTypeRow * row = nullptr;
DataType::iterator rowIter = m_data.find(typeData->m_networkId);
if (rowIter == m_data.end())
{
@@ -45,7 +45,7 @@ bool TaskObjectTemplateListUpdater::process(DB::Session *session)
strcpy(s_sql,"commit");
else if ( i_retval == 2 ) // got ID & Name
{
s_name[256]=0; // null term to make sure it fits
s_name[256]=0; // nullptr term to make sure it fits
sprintf(s_sql,"insert into object_templates values (%d,'%s')",i_id,s_name);
}
else
@@ -25,7 +25,7 @@
#include "TaskGetLocationList.h"
#include "TaskGetBidList.h"
CMLoader *CMLoader::ms_instance = NULL;
CMLoader *CMLoader::ms_instance = nullptr;
// ======================================================================
@@ -42,7 +42,7 @@ void CMLoader::remove()
{
NOT_NULL(ms_instance);
delete ms_instance;
ms_instance = NULL;
ms_instance = nullptr;
}
// ----------------------------------------------------------------------
@@ -17,8 +17,8 @@
// ======================================================================
ObjvarNameManager * ObjvarNameManager::ms_instance = NULL;
ObjvarNameManager * ObjvarNameManager::ms_goldInstance = NULL;
ObjvarNameManager * ObjvarNameManager::ms_instance = nullptr;
ObjvarNameManager * ObjvarNameManager::ms_goldInstance = nullptr;
// ======================================================================
@@ -37,11 +37,11 @@ void ObjvarNameManager::remove()
{
NOT_NULL(ms_instance);
delete ms_instance;
ms_instance = NULL;
ms_instance = nullptr;
NOT_NULL(ms_goldInstance);
delete ms_goldInstance;
ms_goldInstance = NULL;
ms_goldInstance = nullptr;
}
// ----------------------------------------------------------------------
@@ -64,9 +64,9 @@ ObjvarNameManager::~ObjvarNameManager()
delete m_nameToIdMap;
delete m_idToNameMap;
delete m_newNames;
m_nameToIdMap=NULL;
m_idToNameMap=NULL;
m_newNames=NULL;
m_nameToIdMap=nullptr;
m_idToNameMap=nullptr;
m_newNames=nullptr;
}
// ----------------------------------------------------------------------
@@ -169,7 +169,7 @@ DB::TaskRequest *ObjvarNameManager::saveNewNames()
return task;
}
else
return NULL;
return nullptr;
}
// ======================================================================
@@ -29,9 +29,9 @@ void SwgLoader::install()
SwgLoader::SwgLoader() :
Loader(),
m_pendingTaskVerifyCharacter(NULL),
m_loadingTaskVerifyCharacter(NULL),
m_verifyCharacterTaskQ(NULL)
m_pendingTaskVerifyCharacter(nullptr),
m_loadingTaskVerifyCharacter(nullptr),
m_verifyCharacterTaskQ(nullptr)
{
m_verifyCharacterTaskQ = new DB::TaskQueue(1,DatabaseProcess::getInstance().getDBServer(),4);
}
@@ -95,7 +95,7 @@ void SwgLoader::update(real updateTime)
if (m_pendingTaskVerifyCharacter && !m_loadingTaskVerifyCharacter)
{
m_loadingTaskVerifyCharacter = m_pendingTaskVerifyCharacter;
m_pendingTaskVerifyCharacter = NULL;
m_pendingTaskVerifyCharacter = nullptr;
m_verifyCharacterTaskQ->asyncRequest(m_loadingTaskVerifyCharacter);
}
@@ -109,7 +109,7 @@ void SwgLoader::verifyCharacterFinished (TaskVerifyCharacter *task)
{
UNREF(task);
DEBUG_FATAL(task!=m_loadingTaskVerifyCharacter,("Programmer bug: wrong TaskVerifyCharacter finished.\n"));
m_loadingTaskVerifyCharacter = NULL;
m_loadingTaskVerifyCharacter = nullptr;
}
// ----------------------------------------------------------------------
@@ -110,7 +110,7 @@ void SwgPersister::moveToPlayer(const NetworkId &oid, const NetworkId &player, c
void SwgPersister::getMoneyFromOfflineObject(uint32 replyServer, NetworkId const & sourceObject, int amount, NetworkId const & replyTo, std::string const & successCallback, std::string const & failCallback, stdvector<int8>::fwd const & packedDictionary)
{
SwgSnapshot * snapshot=NULL;
SwgSnapshot * snapshot=nullptr;
if (hasDataForObject(sourceObject))
snapshot=safe_cast<SwgSnapshot*>(&getSnapshotForObject(sourceObject, 0));
@@ -96,8 +96,8 @@ SwgSnapshot::SwgSnapshot(DB::ModeQuery::Mode mode, bool useGoldDatabase) :
m_vehicleObjectBuffer(mode),
m_waypointBuffer(mode),
m_weaponObjectBuffer(mode),
m_immediateDeleteStep(NULL),
m_offlineMoneyCustomPersistStep(NULL)
m_immediateDeleteStep(nullptr),
m_offlineMoneyCustomPersistStep(nullptr)
{
m_bufferList.push_back(&m_battlefieldMarkerObjectBuffer);
m_bufferList.push_back(&m_battlefieldParticipantBuffer);
@@ -290,10 +290,10 @@ void SwgSnapshot::decodeScriptObject(NetworkId const & objectId, Archive::ReadIt
Archive::get(data,packedScriptList);
if (packedScriptList.length()==0)
packedScriptList=' '; // avoid confusing an empty list with NULL
packedScriptList=' '; // avoid confusing an empty list with nullptr
DBSchema::ObjectBufferRow *row=m_objectTableBuffer.findRowByIndex(objectId);
if (row==NULL)
if (row==nullptr)
row=m_objectTableBuffer.addEmptyRow(objectId);
row->script_list=packedScriptList;
@@ -90,7 +90,7 @@ bool AuctionLocationsQuery::setupData(DB::Session *session)
bool AuctionLocationsQuery::addData(const DB::Row *_data)
{
const AuctionLocationsRow *myData=dynamic_cast<const AuctionLocationsRow*>(_data);
FATAL(myData == NULL, ("Adding NULL data into AuctionLocations"));
FATAL(myData == nullptr, ("Adding nullptr data into AuctionLocations"));
switch(mode)
{
case mode_UPDATE:
@@ -413,7 +413,7 @@ bool MarketAuctionsQuery::addData(const DB::Row *_data)
case mode_UPDATE:
{
const MarketAuctionsRowUpdate *myData=dynamic_cast<const MarketAuctionsRowUpdate*>(_data);
FATAL(myData == NULL, ("Adding NULL data into MarketAuctions for mode_UPDATE"));
FATAL(myData == nullptr, ("Adding nullptr data into MarketAuctions for mode_UPDATE"));
if (!m_item_ids.push_back(myData->item_id.getValueASCII())) return false;
if (!m_owner_ids.push_back(myData->owner_id.getValueASCII())) return false;
@@ -424,7 +424,7 @@ bool MarketAuctionsQuery::addData(const DB::Row *_data)
case mode_INSERT:
{
const MarketAuctionsRow *myData=dynamic_cast<const MarketAuctionsRow*>(_data);
FATAL(myData == NULL, ("Adding NULL data into MarketAuctions for mode_INSERT"));
FATAL(myData == nullptr, ("Adding nullptr data into MarketAuctions for mode_INSERT"));
if (!m_item_ids.push_back(myData->item_id.getValueASCII())) return false;
if (!m_owner_ids.push_back(myData->owner_id.getValueASCII())) return false;
@@ -450,7 +450,7 @@ bool MarketAuctionsQuery::addData(const DB::Row *_data)
case mode_DELETE:
{
const MarketAuctionsRowDelete *myData=dynamic_cast<const MarketAuctionsRowDelete*>(_data);
FATAL(myData == NULL, ("Adding NULL data into MarketAuctions for mode_DELETE"));
FATAL(myData == nullptr, ("Adding nullptr data into MarketAuctions for mode_DELETE"));
if (!m_item_ids.push_back(myData->item_id.getValueASCII())) return false;
break;
@@ -716,7 +716,7 @@ bool MarketAuctionBidsQuery::addData(const DB::Row *_data)
{
const MarketAuctionBidsRow *myData=dynamic_cast<const MarketAuctionBidsRow*>(_data);
FATAL(myData == NULL, ("Adding NULL data into MarketAuctionBids"));
FATAL(myData == nullptr, ("Adding nullptr data into MarketAuctionBids"));
switch(mode)
{
@@ -24,7 +24,7 @@ TaskSaveObjvarNames::TaskSaveObjvarNames(const NameList &names) :
TaskSaveObjvarNames::~TaskSaveObjvarNames()
{
delete m_objvarNames;
m_objvarNames=NULL;
m_objvarNames=nullptr;
}
// ----------------------------------------------------------------------