mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-07-27 17:41:49 +03:00
Avoid compiler warning about signedness mismatch
This warning kept appearing for me:
Script.cpp:350:35: warning: comparison of integer expressions of
different signedness: ‘int’ and
‘std::__cxx11::basic_string<char>::size_type’
{aka ‘long unsigned int’} [-Wsign-compare]
350 | for (int i = 0; i < words[1].size(); i++)
| ~~^~~~~~~~~~~~~~~~~
So I just made it a size_t instead.
This commit is contained in:
@@ -347,7 +347,7 @@ void scriptclass::run(void)
|
|||||||
int current = 0;
|
int current = 0;
|
||||||
|
|
||||||
// Crawl through the string
|
// Crawl through the string
|
||||||
for (int i = 0; i < words[1].size(); i++)
|
for (size_t i = 0; i < words[1].size(); i++)
|
||||||
{
|
{
|
||||||
// If the current character is a number, add it to the current version part
|
// If the current character is a number, add it to the current version part
|
||||||
if (words[1][i] >= '0' && words[1][i] <= '9')
|
if (words[1][i] >= '0' && words[1][i] <= '9')
|
||||||
|
|||||||
Reference in New Issue
Block a user