Skip to content

Commit 9242508

Browse files
committed
refactor: convert NULL to nullptr or 0 in array/struct initializers
1 parent b460efb commit 9242508

Some content is hidden

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

51 files changed

+4289
-80
lines changed

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/Tools/Babylon/TransDB.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ static LANGINFO langinfo[] =
4545
{ LANGID_KOREAN, "Korean", "ko", "k" },
4646
{ LANGID_CHINESE, "Chinese", "ch", "c" },
4747
{ LANGID_JABBER, "Jabberwockie", "jb", "e" },
48-
{ LANGID_UNKNOWN, "Unknown", nullptr, NULL }
48+
{ LANGID_UNKNOWN, "Unknown", nullptr, nullptr }
4949
};
5050

5151
LANGINFO *GetLangInfo ( int index )

Core/Tools/CRCDiff/CRCDiff.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ int main(int argc, char *argv[])
191191
atexit(exitWait);
192192
const char *inFname[2];
193193
const char *outFname = "out.html";
194-
FILE *ifp[2] = {NULL, NULL};
194+
FILE *ifp[2] = { nullptr, nullptr};
195195
std::string header, footer;
196196

197197
if (argc != 7)

Core/Tools/Launcher/findpatch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ int Find_Patch(OUT char *filename,int maxlen, ConfigFile &config)
3636
WIN32_FIND_DATA findData;
3737
char string[128];
3838
HANDLE hFile;
39-
const char *extensions[]={"web","exe","exn","rtp",NULL};
39+
const char *extensions[]={"web","exe","exn","rtp", nullptr};
4040
int i;
4141
int skuIndex=0;
4242
Wstring key;

Generals/Code/GameEngine/Include/GameClient/ControlBar.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ static const LookupListRec CommandButtonMappedBorderTypeNames[] =
271271
{ "ACTION", COMMAND_BUTTON_BORDER_ACTION },
272272
{ "SYSTEM", COMMAND_BUTTON_BORDER_SYSTEM },
273273

274-
{ NULL, 0 }
274+
{ nullptr, 0 }
275275
};
276276
static_assert(ARRAY_SIZE(CommandButtonMappedBorderTypeNames) == COMMAND_BUTTON_BORDER_COUNT + 1, "Incorrect array size");
277277
//-------------------------------------------------------------------------------------------------

Generals/Code/GameEngine/Include/GameClient/Credits.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ static const LookupListRec CreditStyleNames[] =
8181
{ "NORMAL", CREDIT_STYLE_NORMAL },
8282
{ "COLUMN", CREDIT_STYLE_COLUMN },
8383
// CREDIT_STYLE_BLANK
84-
{ NULL, 0 }
84+
{ nullptr, 0 }
8585
};
8686
static_assert(ARRAY_SIZE(CreditStyleNames) == MAX_CREDIT_STYLES, "Incorrect array size");
8787

Generals/Code/GameEngine/Include/GameClient/GameWindowTransitions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ static const LookupListRec TransitionStyleNames[] =
103103
{ "CONTROLBARARROW", CONTROL_BAR_ARROW_TRANSITION },
104104
{ "SCORESCALEUP", SCORE_SCALE_UP_TRANSITION },
105105
{ "REVERSESOUND", REVERSE_SOUND_TRANSITION },
106-
{ NULL, 0 }
106+
{ nullptr, 0 }
107107
};
108108
static_assert(ARRAY_SIZE(TransitionStyleNames) == MAX_TRANSITION_WINDOW_STYLES + 1, "Incorrect array size");
109109

Generals/Code/GameEngine/Include/GameClient/MetaEvent.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static const LookupListRec CategoryListName[] =
5555
{"TEAM", CATEGORY_TEAM},
5656
{"MISC", CATEGORY_MISC},
5757
{"DEBUG", CATEGORY_DEBUG},
58-
{NULL, 0}
58+
{ nullptr, 0}
5959
};
6060

6161

@@ -258,7 +258,7 @@ static const LookupListRec KeyNames[] =
258258
{ "KEY_INS", MK_INS },
259259
{ "KEY_DEL", MK_DEL },
260260
{ "KEY_NONE", MK_NONE },
261-
{ NULL, 0 }
261+
{ nullptr, 0 }
262262
};
263263

264264
// -------------------------------------------------------------------------------
@@ -276,7 +276,7 @@ static const LookupListRec TransitionNames[] =
276276
{ "DOWN", DOWN },
277277
{ "UP", UP },
278278
{ "DOUBLEDOWN", DOUBLEDOWN },
279-
{ NULL, 0 }
279+
{ nullptr, 0 }
280280
};
281281
static_assert(ARRAY_SIZE(TransitionNames) == MAPPABLE_KEY_TRANSITION_COUNT + 1, "Incorrect array size");
282282

@@ -304,7 +304,7 @@ static const LookupListRec ModifierNames[] =
304304
{ "SHIFT_CTRL", SHIFT_CTRL },
305305
{ "SHIFT_ALT", SHIFT_ALT },
306306
{ "SHIFT_ALT_CTRL" , SHIFT_ALT_CTRL },
307-
{ NULL, 0 }
307+
{ nullptr, 0 }
308308
};
309309

310310

Generals/Code/GameEngine/Include/GameLogic/Module/CreateCrateDie.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class CreateCrateDieModuleData : public DieModuleData
5959

6060
static const FieldParse dataFieldParse[] =
6161
{
62-
{ "CrateData", CreateCrateDieModuleData::parseCrateData, nullptr, NULL },
62+
{ "CrateData", CreateCrateDieModuleData::parseCrateData, nullptr, 0 },
6363
{ 0, 0, 0, 0 }
6464
};
6565
p.add(dataFieldParse);

Generals/Code/GameEngine/Include/GameLogic/WeaponSet.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ static const LookupListRec TheWeaponSlotTypeNamesLookupList[] =
6666
{ "SECONDARY", SECONDARY_WEAPON },
6767
{ "TERTIARY", TERTIARY_WEAPON },
6868

69-
{ NULL, 0 }
69+
{ nullptr, 0 }
7070
};
7171
static_assert(ARRAY_SIZE(TheWeaponSlotTypeNamesLookupList) == WEAPONSLOT_COUNT + 1, "Incorrect array size");
7272

0 commit comments

Comments
 (0)