Remove a warning with some compiler by encoding 0 as UINT_MAX+1

This commit is contained in:
Patrick Pelissier committed 2020-06-26 23:48:59 +02:00
1 parent 494cbbecf0
commit dfbf34daf6
1 file changed
+1 -1
+1 -1
View File
@@ -1325,7 +1325,7 @@ stringi_utf8_decode(char c, stringi_utf8_state_e *state,
string_unicode_t *unicode)
{
const unsigned int type = m_core_clz32((unsigned char)~c) - (sizeof(uint32_t) - 1) * CHAR_BIT;
const string_unicode_t mask1 = -(string_unicode_t)(*state != STRINGI_UTF8_STARTING);
const string_unicode_t mask1 = (UINT_MAX - (string_unicode_t)(*state != STRINGI_UTF8_STARTING) + 1);
const string_unicode_t mask2 = (0xFFU >> type);
*unicode = ((*unicode << 6) & mask1) | ((unsigned int) c & mask2);
*state = (stringi_utf8_state_e) STRINGI_UTF8_STATE_TAB[(unsigned int) *state + type];