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:
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user