зеркало из https://github.com/github/ruby.git
[ruby/json] Fix compilation warning
``` generator.c:69:27: warning: comparison of integers of different signs: 'short' and 'unsigned long' [-Wsign-compare] for (i = 1; i < ch_len; i++) { ``` https://github.com/ruby/json/commit/ff8edcd47c
This commit is contained in:
Родитель
934d67b415
Коммит
ea9d34082f
|
@ -55,7 +55,7 @@ static void convert_UTF8_to_JSON(FBuffer *out_buffer, VALUE in_string, bool out_
|
|||
ch = in_utf8_str[pos];
|
||||
ch_len = 1;
|
||||
} else {
|
||||
short i;
|
||||
unsigned long i;
|
||||
if ((in_utf8_str[pos] & 0x80) == 0x00) { ch_len = 1; ch = in_utf8_str[pos]; } /* leading 1 bit is 0b0 */
|
||||
else if ((in_utf8_str[pos] & 0xE0) == 0xC0) { ch_len = 2; ch = in_utf8_str[pos] & 0x1F; } /* leading 3 bits are 0b110 */
|
||||
else if ((in_utf8_str[pos] & 0xF0) == 0xE0) { ch_len = 3; ch = in_utf8_str[pos] & 0x0F; } /* leading 4 bits are 0b1110 */
|
||||
|
|
Загрузка…
Ссылка в новой задаче