Fix 'signed/unsigned comparison' warning in wchar mode

Only happens on GCC 3.4 for some reason.
This commit is contained in:
Arseny Kapoulkine 2015-10-17 12:58:04 -07:00
parent fd605bc9a7
commit cf8cfb30ce

View file

@ -4395,7 +4395,7 @@ PUGI__NS_BEGIN
PUGI__STATIC_ASSERT(sizeof(U) == 8 || sizeof(U) == 4 || sizeof(U) == 2);
const size_t max_digits10 = sizeof(U) == 8 ? 20 : sizeof(U) == 4 ? 10 : 5;
const char max_lead = sizeof(U) == 8 ? '1' : sizeof(U) == 4 ? '4' : '6';
const char_t max_lead = sizeof(U) == 8 ? '1' : sizeof(U) == 4 ? '4' : '6';
const size_t high_bit = sizeof(U) * 8 - 1;
overflow = digits >= max_digits10 && !(digits == max_digits10 && (*start < max_lead || (*start == max_lead && result >> high_bit)));