Skip to content

Commit bd5674e

Browse files
committed
refactor: convert NULL to nullptr in array/struct initializers and ternary operators
1 parent 3c433c3 commit bd5674e

File tree

119 files changed

+225
-225
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

119 files changed

+225
-225
lines changed

Core/GameEngine/Include/Common/Radar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ static const char *const RadarPriorityNames[] =
143143
"UNIT", // unit level drawing priority
144144
"LOCAL_UNIT_ONLY", // unit priority, but only on the radar if controlled by the local player
145145

146-
NULL
146+
nullptr
147147
};
148148
static_assert(ARRAY_SIZE(RadarPriorityNames) == RADAR_PRIORITY_NUM_PRIORITIES + 1, "Incorrect array size");
149149
#endif // DEFINE_RADAR_PRIOTITY_NAMES

Core/GameEngine/Include/GameClient/TerrainVisual.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static const char *const TerrainLODNames[] =
186186
"AUTOMATIC",
187187
"DISABLE",
188188

189-
NULL
189+
nullptr
190190
};
191191
static_assert(ARRAY_SIZE(TerrainLODNames) == TERRAIN_LOD_NUM_TYPES + 1, "Incorrect array size");
192192
#endif // end DEFINE_TERRAIN_LOD_NAMES

Core/GameEngine/Source/Common/Audio/GameAudio.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ static const FieldParse audioSettingsFieldParseTable[] =
133133
{ "ZoomMaxDistance", INI::parseReal, nullptr, offsetof( AudioSettings, m_zoomMaxDistance ) },
134134
{ "ZoomSoundVolumePercentageAmount", INI::parsePercentToReal, nullptr, offsetof( AudioSettings, m_zoomSoundVolumePercentageAmount ) },
135135

136-
{ nullptr, nullptr, nullptr, NULL }
136+
{ nullptr, nullptr, nullptr, 0 }
137137
};
138138

139139
// Singleton TheAudio /////////////////////////////////////////////////////////////////////////////

Core/GameEngine/Source/Common/System/GameMemory.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2791,7 +2791,7 @@ static const char* s_specialPrefixes[MAX_SPECIAL_USED] =
27912791
"W3A_",
27922792
"STL_",
27932793
"STR_",
2794-
NULL
2794+
nullptr
27952795
};
27962796

27972797
#endif

Core/GameEngine/Source/GameClient/Terrain/TerrainRoads.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ const FieldParse TerrainRoadType::m_terrainBridgeFieldParseTable[] =
8282

8383
{ "DamagedToSound", INI::parseAsciiString, nullptr, offsetof( TerrainRoadType, m_damageToSoundString[ BODY_DAMAGED ] ) },
8484
{ "RepairedToSound", INI::parseAsciiString, nullptr, offsetof( TerrainRoadType, m_repairedToSoundString[ BODY_DAMAGED ] ) },
85-
{ "TransitionToOCL", parseTransitionToOCL, nullptr, NULL },
86-
{ "TransitionToFX", parseTransitionToFX, nullptr, NULL },
85+
{ "TransitionToOCL", parseTransitionToOCL, nullptr, 0 },
86+
{ "TransitionToFX", parseTransitionToFX, nullptr, 0 },
8787

8888

8989
{ nullptr, nullptr, nullptr, 0 },

Core/GameEngine/Source/GameNetwork/NetMessageStream.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,24 +43,24 @@
4343
4444
// The per-player pointers for the list of commands
4545
static CommandMsg *CommandHead[MAX_SLOTS] = { /// @todo: remove static initialization
46-
NULL,
47-
NULL,
48-
NULL,
49-
NULL,
50-
NULL,
51-
NULL,
52-
NULL,
53-
NULL
46+
nullptr,
47+
nullptr,
48+
nullptr,
49+
nullptr,
50+
nullptr,
51+
nullptr,
52+
nullptr,
53+
nullptr
5454
};
5555
static CommandMsg *CommandTail[MAX_SLOTS] = {
56-
NULL,
57-
NULL,
58-
NULL,
59-
NULL,
60-
NULL,
61-
NULL,
62-
NULL,
63-
NULL
56+
nullptr,
57+
nullptr,
58+
nullptr,
59+
nullptr,
60+
nullptr,
61+
nullptr,
62+
nullptr,
63+
nullptr
6464
};
6565
6666
/**

Core/GameEngineDevice/Source/MilesAudioDevice/MilesAudioManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ void MilesAudioManager::audioDebugDisplay(DebugDisplayInterface *dd, void *, FIL
222222
AsciiString filenameNoSlashes;
223223

224224
const Int maxChannels = 64;
225-
PlayingAudio *playingArray[maxChannels] = { NULL };
225+
PlayingAudio *playingArray[maxChannels] = { nullptr };
226226

227227
// 2-D Sounds
228228
if( dd )

Core/GameEngineDevice/Source/W3DDevice/GameClient/HeightMap.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2117,7 +2117,7 @@ void HeightMapRenderObjClass::Render(RenderInfoClass & rinfo)
21172117
DX8Wrapper::Set_Texture(1,nullptr);
21182118
m_stageTwoTexture->restore();
21192119
m_customEdging->drawEdging(m_map, xCoordMin, xCoordMax, yCoordMin, yCoordMax,
2120-
m_stageZeroTexture, doCloud?m_stageTwoTexture:NULL, TheGlobalData->m_useLightMap?m_stageThreeTexture:NULL);
2120+
m_stageZeroTexture, doCloud?m_stageTwoTexture: nullptr, TheGlobalData->m_useLightMap?m_stageThreeTexture: nullptr);
21212121
#endif
21222122
#ifdef DO_ROADS
21232123
DX8Wrapper::Set_Texture(0,nullptr);

Core/Libraries/Source/WWVegas/WW3D2/rendobj.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ static const char* const TheAnimModeNames[] =
644644
"LOOP_PINGPONG",
645645
"LOOP_BACKWARDS",
646646
"ONCE_BACKWARDS",
647-
NULL
647+
nullptr
648648
};
649649
static_assert(ARRAY_SIZE(TheAnimModeNames) == RenderObjClass::ANIM_MODE_COUNT + 1, "Incorrect array size");
650650
#endif

Core/Libraries/Source/WWVegas/WWLib/FastAllocator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ WWINLINE void* FastAllocatorGeneral::Realloc(void* pAlloc, unsigned int n){
587587
pointer address(reference x) const { return &x; }
588588
const_pointer address(const_reference x) const { return &x; }
589589

590-
T* allocate(size_type n, const void* = nullptr) { return n != 0 ? static_cast<T*>(FastAllocatorGeneral::Get_Allocator()->Alloc(n*sizeof(T))) : NULL; }
590+
T* allocate(size_type n, const void* = nullptr) { return n != 0 ? static_cast<T*>(FastAllocatorGeneral::Get_Allocator()->Alloc(n*sizeof(T))) : nullptr; }
591591
void deallocate(pointer p, size_type n) { FastAllocatorGeneral::Get_Allocator()->Free(p); }
592592
size_type max_size() const { return size_t(-1) / sizeof(T); }
593593
void construct(pointer p, const T& val) { new(p) T(val); }

0 commit comments

Comments
 (0)