Fix sign-compare warnings on ARM platforms caused by wchar_t being unsigned

llvm-svn: 290480
This commit is contained in:
Eric Fiselier 2016-12-24 03:09:00 +00:00
parent 82ad195ad5
commit b0bbd8aaaa
1 changed files with 7 additions and 7 deletions

View File

@ -82,15 +82,15 @@ int main()
}
for (wchar_t c = '0'; c < '8'; ++c)
{
assert(t.value(c, 8) == c - '0');
assert(t.value(c, 10) == c - '0');
assert(t.value(c, 16) == c - '0');
assert(t.value(c, 8) == static_cast<int>(c - '0'));
assert(t.value(c, 10) == static_cast<int>(c - '0'));
assert(t.value(c, 16) == static_cast<int>(c - '0'));
}
for (wchar_t c = '8'; c < ':'; ++c)
{
assert(t.value(c, 8) == -1);
assert(t.value(c, 10) == c - '0');
assert(t.value(c, 16) == c - '0');
assert(t.value(c, 10) == static_cast<int>(c - '0'));
assert(t.value(c, 16) == static_cast<int>(c - '0'));
}
for (wchar_t c = ':'; c < 'A'; ++c)
{
@ -102,7 +102,7 @@ int main()
{
assert(t.value(c, 8) == -1);
assert(t.value(c, 10) == -1);
assert(t.value(c, 16) == c - 'A' +10);
assert(t.value(c, 16) == static_cast<int>(c - 'A' +10));
}
for (wchar_t c = 'G'; c < 'a'; ++c)
{
@ -114,7 +114,7 @@ int main()
{
assert(t.value(c, 8) == -1);
assert(t.value(c, 10) == -1);
assert(t.value(c, 16) == c - 'a' +10);
assert(t.value(c, 16) == static_cast<int>(c - 'a' +10));
}
for (wchar_t c = 'g'; c < 0xFFFF; ++c)
{