basic/json: silence gcc warning about limited range of data type
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 15 Nov 2018 13:50:07 +0000 (14:50 +0100)
committerLennart Poettering <lennart@poettering.net>
Thu, 15 Nov 2018 14:39:06 +0000 (15:39 +0100)
commitdf7f9e0b2cc8e4cfd018ef2d0327a69345bb48f4
treeed5bb318d47e769503d05bfb4f88f76df5ad4e9b
parentcd5a29ce983d0ccfa24b349288146d43b387c885
basic/json: silence gcc warning about limited range of data type

With gcc-7.1.1-3.fc26.aarch64:
../src/basic/json.c: In function ‘json_format’:
../src/basic/json.c:1409:40: warning: comparison is always true due to limited range of data type [-Wtype-limits]
                                 if (*q >= 0 && *q < ' ')
                                        ^~
../src/basic/json.c: In function ‘inc_lines_columns’:
../src/basic/json.c:1762:31: warning: comparison is always true due to limited range of data type [-Wtype-limits]
                 } else if (*s >= 0 && *s < 127) /* Process ASCII chars quickly */
                               ^~

Cast to (signed char) silences the warning, but a cast to (int) for some reason
doesn't.
src/basic/json.c