From 5e19e0053a5800252a27ce127fd015d641ee2e9e Mon Sep 17 00:00:00 2001 From: Tadeo Kondrak Date: Mon, 8 Feb 2021 09:54:58 -0700 Subject: [PATCH] xdg-foreign: rename finish_* functions to destroy_* They free their argument, so the name is more clear. --- types/wlr_xdg_foreign_v1.c | 12 ++++++------ types/wlr_xdg_foreign_v2.c | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/types/wlr_xdg_foreign_v1.c b/types/wlr_xdg_foreign_v1.c index cd07b6f5..49216e68 100644 --- a/types/wlr_xdg_foreign_v1.c +++ b/types/wlr_xdg_foreign_v1.c @@ -145,7 +145,7 @@ static struct wlr_xdg_foreign_v1 *xdg_foreign_from_exporter_resource( return wl_resource_get_user_data(resource); } -static void finish_imported(struct wlr_xdg_imported_v1 *imported) { +static void destroy_imported(struct wlr_xdg_imported_v1 *imported) { imported->exported = NULL; struct wlr_xdg_imported_child_v1 *child, *child_tmp; wl_list_for_each_safe(child, child_tmp, &imported->children, link) { @@ -163,7 +163,7 @@ static void finish_imported(struct wlr_xdg_imported_v1 *imported) { free(imported); } -static void finish_exported(struct wlr_xdg_exported_v1 *exported) { +static void destroy_exported(struct wlr_xdg_exported_v1 *exported) { wlr_xdg_foreign_exported_finish(&exported->base); wl_list_remove(&exported->xdg_surface_destroy.link); @@ -178,7 +178,7 @@ static void xdg_exported_handle_resource_destroy( xdg_exported_from_resource(resource); if (exported) { - finish_exported(exported); + destroy_exported(exported); } } @@ -187,7 +187,7 @@ static void handle_xdg_surface_destroy( struct wlr_xdg_exported_v1 *exported = wl_container_of(listener, exported, xdg_surface_destroy); - finish_exported(exported); + destroy_exported(exported); } static void xdg_exporter_handle_export(struct wl_client *wl_client, @@ -277,7 +277,7 @@ static void xdg_imported_handle_resource_destroy( return; } - finish_imported(imported); + destroy_imported(imported); } static void xdg_imported_handle_exported_destroy(struct wl_listener *listener, @@ -285,7 +285,7 @@ static void xdg_imported_handle_exported_destroy(struct wl_listener *listener, struct wlr_xdg_imported_v1 *imported = wl_container_of(listener, imported, exported_destroyed); zxdg_imported_v1_send_destroyed(imported->resource); - finish_imported(imported); + destroy_imported(imported); } static void xdg_importer_handle_import(struct wl_client *wl_client, diff --git a/types/wlr_xdg_foreign_v2.c b/types/wlr_xdg_foreign_v2.c index 3ef74a94..d946e7f9 100644 --- a/types/wlr_xdg_foreign_v2.c +++ b/types/wlr_xdg_foreign_v2.c @@ -145,7 +145,7 @@ static struct wlr_xdg_foreign_v2 *xdg_foreign_from_exporter_resource( return wl_resource_get_user_data(resource); } -static void finish_imported(struct wlr_xdg_imported_v2 *imported) { +static void destroy_imported(struct wlr_xdg_imported_v2 *imported) { imported->exported = NULL; struct wlr_xdg_imported_child_v2 *child, *child_tmp; wl_list_for_each_safe(child, child_tmp, &imported->children, link) { @@ -163,7 +163,7 @@ static void finish_imported(struct wlr_xdg_imported_v2 *imported) { free(imported); } -static void finish_exported(struct wlr_xdg_exported_v2 *exported) { +static void destroy_exported(struct wlr_xdg_exported_v2 *exported) { wlr_xdg_foreign_exported_finish(&exported->base); wl_list_remove(&exported->xdg_surface_destroy.link); @@ -178,7 +178,7 @@ static void xdg_exported_handle_resource_destroy( xdg_exported_from_resource(resource); if (exported) { - finish_exported(exported); + destroy_exported(exported); } } @@ -187,7 +187,7 @@ static void handle_xdg_surface_destroy( struct wlr_xdg_exported_v2 *exported = wl_container_of(listener, exported, xdg_surface_destroy); - finish_exported(exported); + destroy_exported(exported); } static void xdg_exporter_handle_export(struct wl_client *wl_client, @@ -277,7 +277,7 @@ static void xdg_imported_handle_resource_destroy( return; } - finish_imported(imported); + destroy_imported(imported); } static void xdg_imported_handle_exported_destroy(struct wl_listener *listener, @@ -285,7 +285,7 @@ static void xdg_imported_handle_exported_destroy(struct wl_listener *listener, struct wlr_xdg_imported_v2 *imported = wl_container_of(listener, imported, exported_destroyed); zxdg_imported_v2_send_destroyed(imported->resource); - finish_imported(imported); + destroy_imported(imported); } static void xdg_importer_handle_import(struct wl_client *wl_client,