Skip to content

Commit

Permalink
Changed NULL to nullptr.
Browse files Browse the repository at this point in the history
  • Loading branch information
afritz1 committed Apr 10, 2018
1 parent 0079442 commit b66d3e2
Show file tree
Hide file tree
Showing 72 changed files with 454 additions and 454 deletions.
4 changes: 2 additions & 2 deletions BloodXL/BloodXL_Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "../ui/Console.h"

//Game instance used for console commands.
BloodXL_Game *BloodXL_Game::s_pGame_Console=NULL;
BloodXL_Game *BloodXL_Game::s_pGame_Console=nullptr;

BloodXL_Game::BloodXL_Game(const XLEngine_Plugin_API *API)
{
Expand Down Expand Up @@ -103,7 +103,7 @@ BloodXL_Game::~BloodXL_Game(void)
if ( m_Player )
{
xlDelete m_Player;
m_Player = NULL;
m_Player = nullptr;
}
}

Expand Down
8 changes: 4 additions & 4 deletions BloodXL/BloodXL_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "BloodXL_Game.h"

//this is static for now.
BloodXL_Game *m_pGame=NULL;
BloodXL_Game *m_pGame=nullptr;

//Interface between Game classes and C library interface.
void BloodXL_Update(int32_t stage, float dt, XLEngine_Plugin_API *API, void *pUserData)
Expand Down Expand Up @@ -45,7 +45,7 @@ void BloodXL_DestroyGame()
{
xlDelete m_pGame;
}
m_pGame = NULL;
m_pGame = nullptr;
}

//Dynamic library C interface.
Expand All @@ -58,8 +58,8 @@ extern "C" PLUGIN_API int32_t ExitFunc()

extern "C" PLUGIN_API XL_ExitFunc XL_initPlugin(const XLEngine_Plugin_API *API)
{
API->SetGameUpdateCallback( BloodXL_Update, NULL );
API->SetGameRenderCallback( BloodXL_Render, NULL );
API->SetGameUpdateCallback( BloodXL_Update, nullptr );
API->SetGameRenderCallback( BloodXL_Render, nullptr );
API->AddKeyDownCallback( BloodXL_KeyDownCallback, Input::KDCb_FLAGS_NONE );

BloodXL_CreateGame( API );
Expand Down
6 changes: 3 additions & 3 deletions CommonTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ typedef int32_t XL_BOOL;
#define XL_INVALID_TEXTURE 0xffffffff
typedef uint32_t TextureHandle;

//Make sure that the point is non-null before delete. Set to NULL.
#define SafeDeleteArr(p) if (p) { xlDelete [] (p); (p) = NULL; }
//Make sure that the point is non-null before delete. Set to null.
#define SafeDeleteArr(p) if (p) { xlDelete [] (p); (p) = nullptr; }
//p must be non-null before deletion. Test and set to null.
#define SafeDeleteArr_Test(p) { assert(p); if (p) { xlDelete [] (p); (p) = NULL; } }
#define SafeDeleteArr_Test(p) { assert(p); if (p) { xlDelete [] (p); (p) = nullptr; } }

#endif //COMMON_TYPES
14 changes: 7 additions & 7 deletions DaggerXL/DaggerXL_Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
#include "../ui/Console.h"

//Game instance used for console commands.
DaggerXL_Game *DaggerXL_Game::s_pGame_Console=NULL;
DaggerXL_Game *DaggerXL_Game::s_pGame_Console=nullptr;
#define NPC_COUNT 32

static DaggerXL_Game *s_pGamePtr = NULL;
static DaggerXL_Game *s_pGamePtr = nullptr;

DaggerXL_Game::DaggerXL_Game(const XLEngine_Plugin_API *API)
{
Expand Down Expand Up @@ -53,7 +53,7 @@ DaggerXL_Game::DaggerXL_Game(const XLEngine_Plugin_API *API)
m_NPC_Logic = xlNew Logic_NPC(API);
m_Player = xlNew DaggerXL_Player(API);

m_pAPI->World_SetUpdateCallback( DaggerXL_Game::WorldUpdate, NULL );
m_pAPI->World_SetUpdateCallback( DaggerXL_Game::WorldUpdate, nullptr );

s_pGamePtr = this;
}
Expand All @@ -63,22 +63,22 @@ DaggerXL_Game::~DaggerXL_Game(void)
if ( m_Player )
{
xlDelete m_Player;
m_Player = NULL;
m_Player = nullptr;
}
if ( m_DoorLogic )
{
xlDelete m_DoorLogic;
m_DoorLogic = NULL;
m_DoorLogic = nullptr;
}
if ( m_ObjActionLogic )
{
xlDelete m_ObjActionLogic;
m_ObjActionLogic = NULL;
m_ObjActionLogic = nullptr;
}
if ( m_NPC_Logic )
{
xlDelete m_NPC_Logic;
m_NPC_Logic = NULL;
m_NPC_Logic = nullptr;
}
for (uint32_t n=0; n<NPC_COUNT; n++)
{
Expand Down
8 changes: 4 additions & 4 deletions DaggerXL/DaggerXL_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "DaggerXL_Game.h"

//this is static for now.
DaggerXL_Game *m_pGame=NULL;
DaggerXL_Game *m_pGame=nullptr;

void DaggerXL_Update(int32_t stage, float dt, XLEngine_Plugin_API *API, void *pUserData)
{
Expand Down Expand Up @@ -44,7 +44,7 @@ void DaggerXL_DestroyGame()
{
xlDelete m_pGame;
}
m_pGame = NULL;
m_pGame = nullptr;
}

extern "C" PLUGIN_API int32_t ExitFunc()
Expand All @@ -56,8 +56,8 @@ extern "C" PLUGIN_API int32_t ExitFunc()

extern "C" PLUGIN_API XL_ExitFunc XL_initPlugin(const XLEngine_Plugin_API *API)
{
API->SetGameUpdateCallback( DaggerXL_Update, NULL );
API->SetGameRenderCallback( DaggerXL_Render, NULL );
API->SetGameUpdateCallback( DaggerXL_Update, nullptr );
API->SetGameRenderCallback( DaggerXL_Render, nullptr );
API->AddKeyDownCallback( DaggerXL_KeyDownCallback, Input::KDCb_FLAGS_NOREPEAT );

DaggerXL_CreateGame( API );
Expand Down
2 changes: 1 addition & 1 deletion DarkXL/CutscenePlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ void CutscenePlayer::LoadCutsceneData()

//free pData
xlDelete [] pData;
pData = NULL;
pData = nullptr;
}
}

Expand Down
2 changes: 1 addition & 1 deletion DarkXL/DarkXL_Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#include "../ui/Console.h"

//Game instance used for console commands.
DarkXL_Game *DarkXL_Game::s_pGame_Console=NULL;
DarkXL_Game *DarkXL_Game::s_pGame_Console=nullptr;

DarkXL_Game::DarkXL_Game(const XLEngine_Plugin_API *API)
{
Expand Down
8 changes: 4 additions & 4 deletions DarkXL/DarkXL_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "DarkXL_Game.h"

//this is static for now.
DarkXL_Game *m_pGame=NULL;
DarkXL_Game *m_pGame=nullptr;

//Interface between Game classes and C library interface.
void DarkXL_Update(int32_t stage, float dt, XLEngine_Plugin_API *API, void *pUserData)
Expand Down Expand Up @@ -45,7 +45,7 @@ void DarkXL_DestroyGame()
{
xlDelete m_pGame;
}
m_pGame = NULL;
m_pGame = nullptr;
}

//Dynamic library C interface.
Expand All @@ -58,8 +58,8 @@ extern "C" PLUGIN_API int32_t ExitFunc()

extern "C" PLUGIN_API XL_ExitFunc XL_initPlugin(const XLEngine_Plugin_API *API)
{
API->SetGameUpdateCallback( DarkXL_Update, NULL );
API->SetGameRenderCallback( DarkXL_Render, NULL );
API->SetGameUpdateCallback( DarkXL_Update, nullptr );
API->SetGameRenderCallback( DarkXL_Render, nullptr );
API->AddKeyDownCallback( DarkXL_KeyDownCallback, Input::KDCb_FLAGS_NONE );

DarkXL_CreateGame( API );
Expand Down
46 changes: 23 additions & 23 deletions Engine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ const float m_fFixedLoopsPerSec = 60.0f;
const float m_fFixedLoopTime = (1.0f/m_fFixedLoopsPerSec);

//Plugin API.
Engine *m_pEngineForAPI=NULL;
XAPI_Game_Update m_pGameUpdate=NULL;
XAPI_Game_Render m_pGameRender=NULL;
XAPI_World_Update m_pWorldUpdate=NULL;
void *m_pGameUpdate_UD=NULL;
void *m_pGameRender_UD=NULL;
void *m_pWorldUpdate_UD=NULL;
Engine *m_pEngineForAPI=nullptr;
XAPI_Game_Update m_pGameUpdate=nullptr;
XAPI_Game_Render m_pGameRender=nullptr;
XAPI_World_Update m_pWorldUpdate=nullptr;
void *m_pGameUpdate_UD=nullptr;
void *m_pGameRender_UD=nullptr;
void *m_pWorldUpdate_UD=nullptr;
char m_szGameName[64]="";
int m_anVersion[2]={0,0};

Expand All @@ -68,7 +68,7 @@ struct DisplayMessage
DisplayMessage m_aMessages[MAX_MESSAGE_COUNT];
int32_t m_nMessageCnt=0;

IDriver3D *g_pDriver3D = NULL;
IDriver3D *g_pDriver3D = nullptr;

#define _MAX_TIMEOUT 5.0f
#define _FRAME_COUNT_BEFORE_EXIT 60
Expand All @@ -80,14 +80,14 @@ bool Engine::m_bContinueLoop=true;

Engine::Engine()
{
m_pDriver3D = NULL;
m_pCamera = NULL;
m_pPluginAPI = NULL;
m_pDriver3D = nullptr;
m_pCamera = nullptr;
m_pPluginAPI = nullptr;
m_fTotalTime = 0.0f;
m_pSystemFont16 = NULL;
m_pSystemFont24 = NULL;
m_pSystemFont32 = NULL;
m_pWorld = NULL;
m_pSystemFont16 = nullptr;
m_pSystemFont24 = nullptr;
m_pSystemFont32 = nullptr;
m_pWorld = nullptr;
m_FPS = 60.0f;
}

Expand Down Expand Up @@ -120,15 +120,15 @@ bool Engine::Init(void **winParam, int32_t paramCnt, int32_t w, int32_t h)
((Driver3D_Soft *)m_pDriver3D)->SetBitDepth(8);
}

if ( m_pDriver3D == NULL )
if ( m_pDriver3D == nullptr )
return false;

g_pDriver3D = m_pDriver3D;
}

//Create the default camera.
m_pCamera = xlNew Camera();
if ( m_pCamera == NULL )
if ( m_pCamera == nullptr )
return false;

//pick the correct platform based on OS.
Expand Down Expand Up @@ -340,12 +340,12 @@ void Engine::Destroy()
if ( m_pCamera )
{
xlDelete m_pCamera;
m_pCamera = NULL;
m_pCamera = nullptr;
}
if ( m_pPluginAPI )
{
xlFree( m_pPluginAPI );
m_pPluginAPI = NULL;
m_pPluginAPI = nullptr;
}
MovieManager::Destroy();
Input::Destroy();
Expand All @@ -367,7 +367,7 @@ void Engine::Destroy()
if ( m_pDriver3D )
{
xlDelete m_pDriver3D;
m_pDriver3D = NULL;
m_pDriver3D = nullptr;
}

//ScratchPad
Expand All @@ -376,7 +376,7 @@ void Engine::Destroy()
if ( m_pWorld )
{
xlDelete m_pWorld;
m_pWorld = NULL;
m_pWorld = nullptr;
}
}

Expand All @@ -387,7 +387,7 @@ void Engine::InitGame(const char *pszGameLib)

XLFont *Engine::GetSystemFont(int32_t size)
{
XLFont *pFont = NULL;
XLFont *pFont = nullptr;

if ( size == 16 )
pFont = m_pSystemFont16;
Expand Down Expand Up @@ -432,7 +432,7 @@ void Engine::AddDisplayMessage(const char *pszMsg, Vector4 *color, float fShowTi
float Engine::GetCurrentBrightness()
{
Object *player = m_pWorld->GetPlayer();
if ( player == NULL )
if ( player == nullptr )
return 1.0f;

return player->GetBrightness();
Expand Down
4 changes: 2 additions & 2 deletions OutlawsXL/OutlawsXL_Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "../ui/Console.h"

//Game instance used for console commands.
OutlawsXL_Game *OutlawsXL_Game::s_pGame_Console=NULL;
OutlawsXL_Game *OutlawsXL_Game::s_pGame_Console=nullptr;

OutlawsXL_Game::OutlawsXL_Game(const XLEngine_Plugin_API *API)
{
Expand Down Expand Up @@ -38,7 +38,7 @@ OutlawsXL_Game::~OutlawsXL_Game(void)
if ( m_Player )
{
xlDelete m_Player;
m_Player = NULL;
m_Player = nullptr;
}
}

Expand Down
8 changes: 4 additions & 4 deletions OutlawsXL/OutlawsXL_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "OutlawsXL_Game.h"

//this is static for now.
OutlawsXL_Game *m_pGame=NULL;
OutlawsXL_Game *m_pGame=nullptr;

//Interface between Game classes and C library interface.
void OutlawsXL_Update(int32_t stage, float dt, XLEngine_Plugin_API *API, void *pUserData)
Expand Down Expand Up @@ -45,7 +45,7 @@ void OutlawsXL_DestroyGame()
{
xlDelete m_pGame;
}
m_pGame = NULL;
m_pGame = nullptr;
}

//Dynamic library C interface.
Expand All @@ -58,8 +58,8 @@ extern "C" PLUGIN_API int32_t ExitFunc()

extern "C" PLUGIN_API XL_ExitFunc XL_initPlugin(const XLEngine_Plugin_API *API)
{
API->SetGameUpdateCallback( OutlawsXL_Update, NULL );
API->SetGameRenderCallback( OutlawsXL_Render, NULL );
API->SetGameUpdateCallback( OutlawsXL_Update, nullptr );
API->SetGameRenderCallback( OutlawsXL_Render, nullptr );
API->AddKeyDownCallback( OutlawsXL_KeyDownCallback, Input::KDCb_FLAGS_NONE );

OutlawsXL_CreateGame( API );
Expand Down
6 changes: 3 additions & 3 deletions fileformats/ART_Reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ char _szFileName[32];
ART_Reader::ART_Reader() : Archive()
{
m_CurFile = -1;
m_pFile = NULL;
m_pTilesList = NULL;
m_pFile = nullptr;
m_pTilesList = nullptr;
m_uFileCount = 0;
}

Expand Down Expand Up @@ -129,7 +129,7 @@ void ART_Reader::CloseFile()
if ( m_pFile )
{
fclose(m_pFile);
m_pFile = NULL;
m_pFile = nullptr;
}
m_CurFile = -1;
}
Expand Down
Loading

0 comments on commit b66d3e2

Please sign in to comment.