Fixed warning

c++ -c -g -O2 -std=c++11 -Wno-switch ../oscar64/oscar64.cpp -o oscar64.o
../oscar64/Scanner.cpp:768:29: warning: using the result of an assignment as a condition without parentheses [-Wparentheses]
                                        while (mTokenString[i] = def->mString[i])
                                               ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
../oscar64/Scanner.cpp:768:29: note: place parentheses around the assignment to silence this warning
                                        while (mTokenString[i] = def->mString[i])
                                                               ^
                                               (                                )
../oscar64/Scanner.cpp:768:29: note: use '==' to turn this assignment into an equality comparison
                                        while (mTokenString[i] = def->mString[i])
                                                               ^
                                                               ==
1 warning generated.
This commit is contained in:
Stefan 2024-02-13 18:28:33 +01:00 committed by GitHub
parent bcc20d3986
commit 1d49e0a987
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -765,7 +765,7 @@ void Scanner::NextPreToken(void)
{ {
mToken = TK_STRING; mToken = TK_STRING;
int i = 0; int i = 0;
while (mTokenString[i] = def->mString[i]) while ((mTokenString[i] = def->mString[i]))
i++; i++;
return; return;
} }