mirror of
https://github.com/swaywm/sway.git
synced 2025-02-27 03:31:20 +00:00
Update to json-c 0.13
Update json-c dependency to 0.13, which changed the return type of json_object_array_length to support only a size_t instead of an int as fallback.
This commit is contained in:
parent
7c3b0ffc32
commit
3b673765bb
6 changed files with 8 additions and 8 deletions
|
@ -59,7 +59,7 @@ if (LD_LIBRARY_PATH)
|
|||
add_definitions(-D_LD_LIBRARY_PATH="${LD_LIBRARY_PATH}")
|
||||
endif()
|
||||
|
||||
find_package(JsonC 0.12.1 REQUIRED)
|
||||
find_package(JsonC REQUIRED)
|
||||
find_package(PCRE REQUIRED)
|
||||
find_package(WLC REQUIRED)
|
||||
find_package(Wayland REQUIRED)
|
||||
|
|
|
@ -724,7 +724,7 @@ void ipc_client_handle_command(struct ipc_client *client) {
|
|||
}
|
||||
|
||||
// parse requested event types
|
||||
for (int i = 0; i < json_object_array_length(request); i++) {
|
||||
for (size_t i = 0; i < json_object_array_length(request); i++) {
|
||||
const char *event_type = json_object_get_string(json_object_array_get_idx(request, i));
|
||||
if (strcmp(event_type, "workspace") == 0) {
|
||||
client->subscribed_events |= event_mask(IPC_EVENT_WORKSPACE);
|
||||
|
|
|
@ -70,7 +70,7 @@ static void parse_json(struct bar *bar, const char *text) {
|
|||
|
||||
bar->status->block_line = create_list();
|
||||
|
||||
int i;
|
||||
size_t i;
|
||||
for (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;
|
||||
|
|
|
@ -50,7 +50,7 @@ static json_object *get_focused_container_r(json_object *c) {
|
|||
} else {
|
||||
json_object *nodes, *node, *child;
|
||||
json_object_object_get_ex(c, "nodes", &nodes);
|
||||
int i;
|
||||
size_t i;
|
||||
for (i = 0; i < json_object_array_length(nodes); i++) {
|
||||
node = json_object_array_get_idx(nodes, i);
|
||||
|
||||
|
@ -83,7 +83,7 @@ char *get_focused_output() {
|
|||
if (!outputs) {
|
||||
sway_abort("Unabled to get focused output. No nodes in tree.");
|
||||
}
|
||||
for (int i = 0; i < json_object_array_length(outputs); i++) {
|
||||
for (size_t i = 0; i < json_object_array_length(outputs); i++) {
|
||||
output = json_object_array_get_idx(outputs, i);
|
||||
|
||||
if (get_focused_container_r(output)) {
|
||||
|
@ -131,7 +131,7 @@ json_object *get_output_container(const char *output) {
|
|||
json_object *outputs, *json_output, *name;
|
||||
json_object_object_get_ex(tree, "nodes", &outputs);
|
||||
|
||||
for (int i = 0; i < json_object_array_length(outputs); i++) {
|
||||
for (size_t i = 0; i < json_object_array_length(outputs); i++) {
|
||||
json_output = json_object_array_get_idx(outputs, i);
|
||||
json_object_object_get_ex(json_output, "name", &name);
|
||||
|
||||
|
|
|
@ -584,7 +584,7 @@ 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) {
|
||||
for (size_t j = 0;; ++j) {
|
||||
if (j >= json_object_array_length(json_outputs)) {
|
||||
sway_log(L_ERROR, "%s is not an extant output", displays_paths[i * 2]);
|
||||
exit(EXIT_FAILURE);
|
||||
|
|
|
@ -149,7 +149,7 @@ static void pretty_print_version(json_object *v) {
|
|||
static void pretty_print_clipboard(json_object *v) {
|
||||
if (success(v, true)) {
|
||||
if (json_object_is_type(v, json_type_array)) {
|
||||
for (int i = 0; i < json_object_array_length(v); ++i) {
|
||||
for (size_t i = 0; i < json_object_array_length(v); ++i) {
|
||||
json_object *o = json_object_array_get_idx(v, i);
|
||||
printf("%s\n", json_object_get_string(o));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue