Skip to content

Commit ff8edcd

Browse files
committed
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++) { ```
1 parent 62301c0 commit ff8edcd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/json/ext/generator/generator.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ static void convert_UTF8_to_JSON(FBuffer *out_buffer, VALUE in_string, bool out_
5555
ch = in_utf8_str[pos];
5656
ch_len = 1;
5757
} else {
58-
short i;
58+
unsigned long i;
5959
if ((in_utf8_str[pos] & 0x80) == 0x00) { ch_len = 1; ch = in_utf8_str[pos]; } /* leading 1 bit is 0b0 */
6060
else if ((in_utf8_str[pos] & 0xE0) == 0xC0) { ch_len = 2; ch = in_utf8_str[pos] & 0x1F; } /* leading 3 bits are 0b110 */
6161
else if ((in_utf8_str[pos] & 0xF0) == 0xE0) { ch_len = 3; ch = in_utf8_str[pos] & 0x0F; } /* leading 4 bits are 0b1110 */

0 commit comments

Comments
 (0)