From 61c118768564eec07ac16494d90f567e75ea60cf Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Wed, 27 Jun 2018 17:23:44 +1000 Subject: [PATCH] Fix nitpicks --- sway/desktop/transaction.c | 10 ++++------ sway/tree/container.c | 3 ++- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/sway/desktop/transaction.c b/sway/desktop/transaction.c index 7a99bfe20..98cde889b 100644 --- a/sway/desktop/transaction.c +++ b/sway/desktop/transaction.c @@ -73,8 +73,7 @@ static void save_view_buffer(struct sway_view *view, remove_saved_view_buffer(instruction); } if (view->surface && wlr_surface_has_buffer(view->surface)) { - wlr_buffer_ref(view->surface->buffer); - instruction->saved_buffer = view->surface->buffer; + instruction->saved_buffer = wlr_buffer_ref(view->surface->buffer); } } @@ -198,12 +197,11 @@ static void transaction_apply(struct sway_transaction *transaction) { (now.tv_nsec - commit->tv_nsec) / 1000000.0; float ms_total = ms_arranging + ms_waiting; wlr_log(L_DEBUG, "Transaction %p: %.1fms arranging, %.1fms waiting, " - "%.1fms total (%.1f frames if 60hz)", transaction, + "%.1fms total (%.1f frames if 60Hz)", transaction, ms_arranging, ms_waiting, ms_total, ms_total / (1000 / 60)); } - int i; // Apply the instruction state to the container's current state - for (i = 0; i < transaction->instructions->length; ++i) { + for (int i = 0; i < transaction->instructions->length; ++i) { struct sway_transaction_instruction *instruction = transaction->instructions->items[i]; struct sway_container *container = instruction->container; @@ -220,7 +218,7 @@ static void transaction_apply(struct sway_transaction *transaction) { } // Apply damage - for (i = 0; i < transaction->damage->length; ++i) { + for (int i = 0; i < transaction->damage->length; ++i) { struct wlr_box *box = transaction->damage->items[i]; for (int j = 0; j < root_container.children->length; ++j) { struct sway_container *output = root_container.children->items[j]; diff --git a/sway/tree/container.c b/sway/tree/container.c index 2b9eb6368..8446c4575 100644 --- a/sway/tree/container.c +++ b/sway/tree/container.c @@ -296,7 +296,8 @@ static struct sway_container *container_output_destroy( /** * Implement the actual destroy logic, without reaping. */ -struct sway_container *container_destroy_noreaping(struct sway_container *con) { +static struct sway_container *container_destroy_noreaping( + struct sway_container *con) { if (con == NULL) { return NULL; }