1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 12:03:07 +01:00

Better annotate some magic numbers in for loops

This commit is contained in:
Hielke Morsink
2022-10-17 18:08:55 +02:00
committed by GitHub
parent fdbceae17c
commit 3bb8ea3668
20 changed files with 62 additions and 61 deletions

View File

@@ -735,7 +735,6 @@ static int32_t cc_get(InteractiveConsole& console, const arguments_t& argv)
}
static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
{
uint32_t i;
if (argv.size() > 1)
{
int32_t int_val[4];
@@ -744,7 +743,7 @@ static int32_t cc_set(InteractiveConsole& console, const arguments_t& argv)
bool double_valid[4];
bool invalidArgs = false;
for (i = 0; i < 4; i++)
for (uint32_t i = 0; i < std::size(int_val); i++)
{
if (i + 1 < argv.size())
{
@@ -1201,8 +1200,8 @@ static int32_t cc_load_object(InteractiveConsole& console, const arguments_t& ar
{
char name[9] = { 0 };
std::fill_n(name, 8, ' ');
int32_t i = 0;
for (const char* ch = argv[0].c_str(); *ch != '\0' && i < 8; ch++)
std::size_t i = 0;
for (const char* ch = argv[0].c_str(); *ch != '\0' && i < std::size(name) - 1; ch++)
{
name[i++] = *ch;
}