mirror of
https://github.com/swaywm/sway.git
synced 2026-04-30 06:46:24 -04:00
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:
parent
e39d663135
commit
ccc83f7f76
6 changed files with 14 additions and 17 deletions
|
|
@ -120,18 +120,17 @@ static void ipc_parse_config(struct config *config, const char *payload) {
|
|||
#endif
|
||||
|
||||
// free previous outputs list
|
||||
int i;
|
||||
for (i = 0; i < config->outputs->length; ++i) {
|
||||
for (int i = 0; i < config->outputs->length; ++i) {
|
||||
free(config->outputs->items[i]);
|
||||
}
|
||||
list_free(config->outputs);
|
||||
config->outputs = create_list();
|
||||
|
||||
if (outputs) {
|
||||
int length = json_object_array_length(outputs);
|
||||
size_t length = (size_t)json_object_array_length(outputs);
|
||||
json_object *output;
|
||||
const char *output_str;
|
||||
for (i = 0; i < length; ++i) {
|
||||
for (size_t i = 0; i < length; ++i) {
|
||||
output = json_object_array_get_idx(outputs, i);
|
||||
output_str = json_object_get_string(output);
|
||||
if (strcmp("*", output_str) == 0) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue