Skip to content

Commit

Permalink
Fix some clang 10 -Wsign-compare warnings (#2960)
Browse files Browse the repository at this point in the history
In file included from /data/mwrep/res/osp/Poco/JSON/20-0-0-0/include/Poco/JSON/Object.h:22:
In file included from /data/mwrep/res/osp/Poco/JSON/20-0-0-0/include/Poco/JSON/Array.h:23:
In file included from /data/mwrep/res/osp/Poco/Foundation/20-0-0-0/include/Poco/Dynamic/Var.h:26:
In file included from /data/mwrep/res/osp/Poco/Foundation/20-0-0-0/include/Poco/Dynamic/VarHolder.h:22:
In file included from /data/mwrep/res/osp/Poco/Foundation/20-0-0-0/include/Poco/NumberFormatter.h:22:
/data/mwrep/res/osp/Poco/Foundation/20-0-0-0/include/Poco/NumericString.h:220:31: error: comparison of integers of different signs: 'unsigned long' and 'char' [-Werror,-Wsign-compare]
                                if ((limitCheck - result) < add) return false;
                                     ~~~~~~~~~~~~~~~~~~~  ^ ~~~
/data/mwrep/res/osp/Poco/Foundation/20-0-0-0/include/Poco/NumericString.h:229:31: error: comparison of integers of different signs: 'unsigned long' and 'char' [-Werror,-Wsign-compare]
                                if ((limitCheck - result) < add) return false;
                                     ~~~~~~~~~~~~~~~~~~~  ^ ~~~
/data/mwrep/res/osp/Poco/Foundation/20-0-0-0/include/Poco/NumericString.h:240:31: error: comparison of integers of different signs: 'unsigned long' and 'char' [-Werror,-Wsign-compare]
                                if ((limitCheck - result) < add) return false;
                                     ~~~~~~~~~~~~~~~~~~~  ^ ~~~
/data/mwrep/res/osp/Poco/Foundation/20-0-0-0/include/Poco/NumericString.h:249:31: error: comparison of integers of different signs: 'unsigned long' and 'char' [-Werror,-Wsign-compare]
                                if ((limitCheck - result) < add) return false;
                                     ~~~~~~~~~~~~~~~~~~~  ^ ~~~
4 errors generated.
  • Loading branch information
Romain-Geissler-1A committed Jun 21, 2022
1 parent 15e242b commit 3e56349
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Foundation/include/Poco/NumericString.h
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ bool strToInt(const char* pStr, I& outResult, short base, char thSep = ',')
case '0': case '1': case '2': case '3':
case '4': case '5': case '6': case '7':
{
char add = (*pStr - '0');
unsigned char add = (*pStr - '0');
if ((limitCheck - result) < add) return false;
result = result * base + add;
}
Expand All @@ -225,7 +225,7 @@ bool strToInt(const char* pStr, I& outResult, short base, char thSep = ',')
case '8': case '9':
if ((base == 10) || (base == 0x10))
{
char add = (*pStr - '0');
unsigned char add = (*pStr - '0');
if ((limitCheck - result) < add) return false;
result = result * base + add;
}
Expand All @@ -236,7 +236,7 @@ bool strToInt(const char* pStr, I& outResult, short base, char thSep = ',')
case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
{
if (base != 0x10) return false;
char add = (*pStr - 'a');
unsigned char add = (*pStr - 'a');
if ((limitCheck - result) < add) return false;
result = result * base + (10 + add);
}
Expand All @@ -245,7 +245,7 @@ bool strToInt(const char* pStr, I& outResult, short base, char thSep = ',')
case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
{
if (base != 0x10) return false;
char add = (*pStr - 'A');
unsigned char add = (*pStr - 'A');
if ((limitCheck - result) < add) return false;
result = result * base + (10 + add);
}
Expand Down

0 comments on commit 3e56349

Please sign in to comment.