refactor(Core): replace NULL with nullptr (#4593)

This commit is contained in:
Kitzunu 2021-03-02 01:34:20 +01:00 committed by GitHub
parent dbefa17a53
commit 28f1dc5c0c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
231 changed files with 923 additions and 923 deletions

View file

@ -26,9 +26,9 @@
MySQLConnection::MySQLConnection(MySQLConnectionInfo& connInfo) :
m_reconnecting(false),
m_prepareError(false),
m_queue(NULL),
m_worker(NULL),
m_Mysql(NULL),
m_queue(nullptr),
m_worker(nullptr),
m_Mysql(nullptr),
m_connectionInfo(connInfo),
m_connectionFlags(CONNECTION_SYNCH)
{
@ -38,7 +38,7 @@ MySQLConnection::MySQLConnection(ACE_Activation_Queue* queue, MySQLConnectionInf
m_reconnecting(false),
m_prepareError(false),
m_queue(queue),
m_Mysql(NULL),
m_Mysql(nullptr),
m_connectionInfo(connInfo),
m_connectionFlags(CONNECTION_ASYNC)
{
@ -64,7 +64,7 @@ void MySQLConnection::Close()
bool MySQLConnection::Open()
{
MYSQL* mysqlInit;
mysqlInit = mysql_init(NULL);
mysqlInit = mysql_init(nullptr);
if (!mysqlInit)
{
sLog->outError("Could not initialize Mysql connection to database `%s`", m_connectionInfo.database.c_str());
@ -313,15 +313,15 @@ bool MySQLConnection::_Query(PreparedStatement* stmt, MYSQL_RES** pResult, uint6
ResultSet* MySQLConnection::Query(const char* sql)
{
if (!sql)
return NULL;
return nullptr;
MYSQL_RES* result = NULL;
MYSQL_FIELD* fields = NULL;
MYSQL_RES* result = nullptr;
MYSQL_FIELD* fields = nullptr;
uint64 rowCount = 0;
uint32 fieldCount = 0;
if (!_Query(sql, &result, &fields, &rowCount, &fieldCount))
return NULL;
return nullptr;
return new ResultSet(result, fields, rowCount, fieldCount);
}
@ -460,7 +460,7 @@ void MySQLConnection::PrepareStatement(uint32 index, const char* sql, Connection
// to save memory that will not be used.
if (!(m_connectionFlags & flags))
{
m_stmts[index] = NULL;
m_stmts[index] = nullptr;
return;
}
@ -490,12 +490,12 @@ void MySQLConnection::PrepareStatement(uint32 index, const char* sql, Connection
PreparedResultSet* MySQLConnection::Query(PreparedStatement* stmt)
{
MYSQL_RES* result = NULL;
MYSQL_RES* result = nullptr;
uint64 rowCount = 0;
uint32 fieldCount = 0;
if (!_Query(stmt, &result, &rowCount, &fieldCount))
return NULL;
return nullptr;
if (mysql_more_results(m_Mysql))
{