Use type casts to size_t for return types of json_object_array_length

This will future proof the code, as it seems
that the next release of json-c will return size_t array lengths
This commit is contained in:
Marius Orcsik 2017-10-27 15:19:15 +02:00
parent e39d663135
commit ccc83f7f76
No known key found for this signature in database
GPG key ID: 889CE8E4FB2D877A
6 changed files with 14 additions and 17 deletions

View file

@ -584,8 +584,8 @@ int main(int argc, char **argv) {
for (i = 0; i < registry->outputs->length; ++i) {
if (displays_paths[i * 2] != NULL) {
for (int j = 0;; ++j) {
if (j >= json_object_array_length(json_outputs)) {
for (size_t j = 0;; ++j) {
if (j >= (size_t)json_object_array_length(json_outputs)) {
sway_log(L_ERROR, "%s is not an extant output", displays_paths[i * 2]);
exit(EXIT_FAILURE);
}