1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-31 10:45:16 +01:00

declaring local variables where needed instead of at the top (#3599)

This commit is contained in:
Hielke Morsink
2016-05-15 11:25:24 +02:00
committed by Ted John
parent 800dc83951
commit 8c1395bd46
11 changed files with 402 additions and 647 deletions

View File

@@ -130,8 +130,7 @@ namespace CommandLine
if (allCommands)
{
const CommandLineCommand * command;
for (command = RootCommands; command->Name != nullptr; command++)
for (const CommandLineCommand *command = RootCommands; command->Name != nullptr; command++)
{
if (command->SubCommands != nullptr)
{
@@ -159,8 +158,6 @@ namespace CommandLine
static void PrintHelpFor(const CommandLineCommand * commands)
{
const CommandLineCommand * command;
// Print usage
const char * usageString = "usage: openrct2 ";
const size_t usageStringLength = String::LengthOf(usageString);
@@ -169,6 +166,7 @@ namespace CommandLine
// Get the largest command name length and parameter length
size_t maxNameLength = 0;
size_t maxParamsLength = 0;
const CommandLineCommand * command;
for (command = commands; command->Name != nullptr; command++)
{
maxNameLength = Math::Max(maxNameLength, String::LengthOf(command->Name));