Adaptions for API change in json-c v0.13

Lift restriction on json-c <= 0.12.1

ipc-server: Acquire ownership of referenced json_object properly

When adding a referenced json_object with an unknown lifetime to
another json_object, it must be done with a wrapped call to
json_object_get() to acquire the ownership of that json_object.
This commit is contained in:
Björn Esser 2017-12-14 01:30:54 +01:00 committed by Drew DeVault
parent d0bd0ed598
commit c08c805ecd
17 changed files with 41 additions and 26 deletions

View file

@ -2,8 +2,8 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <json-c/json.h>
#include "sway_json_helper.h"
#include "swaybar/config.h"
#include "swaybar/status_line.h"
#include "log.h"
@ -70,8 +70,7 @@ static void parse_json(struct bar *bar, const char *text) {
bar->status->block_line = create_list();
int i;
for (i = 0; i < json_object_array_length(results); ++i) {
for (json_ar_len_t i = 0; i < json_object_array_length(results); ++i) {
json_object *full_text, *short_text, *color, *min_width, *align, *urgent;
json_object *name, *instance, *separator, *separator_block_width;
json_object *background, *border, *border_top, *border_bottom;