From 8c02ea1069274c07424fa9a16256d97c726dca9e Mon Sep 17 00:00:00 2001 From: Leandro Ribeiro Date: Thu, 6 Feb 2020 15:41:32 -0300 Subject: [PATCH] weston-log: rename weston_log_subscriber::destroy to destroy_subscription weston_log_subscriber has a member named destroy. There are other structs (weston_output, for instance) that have this member, and by convention it is a pointer to a function that destroys the struct. In weston_log_subscriber it is being used to destroy subscriptions of the debug protocol, and not the subscriber, so this name is misleading. Rename it to destroy_subscription. Signed-off-by: Leandro Ribeiro --- libweston/weston-log-file.c | 2 +- libweston/weston-log-flight-rec.c | 2 +- libweston/weston-log-internal.h | 2 +- libweston/weston-log-wayland.c | 2 +- libweston/weston-log.c | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libweston/weston-log-file.c b/libweston/weston-log-file.c index 2cdb247d..219a15dd 100644 --- a/libweston/weston-log-file.c +++ b/libweston/weston-log-file.c @@ -79,7 +79,7 @@ weston_log_subscriber_create_log(FILE *dump_to) file->base.write = weston_log_file_write; - file->base.destroy = NULL; + file->base.destroy_subscription = NULL; file->base.complete = NULL; wl_list_init(&file->base.subscription_list); diff --git a/libweston/weston-log-flight-rec.c b/libweston/weston-log-flight-rec.c index 16d18a90..7243498e 100644 --- a/libweston/weston-log-flight-rec.c +++ b/libweston/weston-log-flight-rec.c @@ -241,7 +241,7 @@ weston_log_subscriber_create_flight_rec(size_t size) return NULL; flight_rec->base.write = weston_log_flight_recorder_write; - flight_rec->base.destroy = NULL; + flight_rec->base.destroy_subscription = NULL; flight_rec->base.complete = NULL; wl_list_init(&flight_rec->base.subscription_list); diff --git a/libweston/weston-log-internal.h b/libweston/weston-log-internal.h index 9c94dbb5..95e6e653 100644 --- a/libweston/weston-log-internal.h +++ b/libweston/weston-log-internal.h @@ -54,7 +54,7 @@ struct weston_log_subscriber { void (*write)(struct weston_log_subscriber *sub, const char *data, size_t len); /** For the type of streams that required additional destroy operation * for destroying the stream */ - void (*destroy)(struct weston_log_subscriber *sub); + void (*destroy_subscription)(struct weston_log_subscriber *sub); /** For the type of streams that can inform the 'consumer' part that * write operation has been terminated/finished and should close the * stream. diff --git a/libweston/weston-log-wayland.c b/libweston/weston-log-wayland.c index 43fc2885..892b1631 100644 --- a/libweston/weston-log-wayland.c +++ b/libweston/weston-log-wayland.c @@ -180,7 +180,7 @@ stream_create(struct weston_log_context *log_ctx, const char *name, stream->resource = stream_resource; stream->base.write = weston_log_debug_wayland_write; - stream->base.destroy = weston_log_debug_wayland_to_destroy; + stream->base.destroy_subscription = weston_log_debug_wayland_to_destroy; stream->base.complete = weston_log_debug_wayland_complete; wl_list_init(&stream->base.subscription_list); diff --git a/libweston/weston-log.c b/libweston/weston-log.c index 43ca1708..6afda2c6 100644 --- a/libweston/weston-log.c +++ b/libweston/weston-log.c @@ -712,8 +712,8 @@ weston_log_scope_destroy(struct weston_log_scope *scope) wl_list_for_each_safe(sub, sub_tmp, &scope->subscription_list, source_link) { /* destroy each subscription */ - if (sub->owner->destroy) - sub->owner->destroy(sub->owner); + if (sub->owner->destroy_subscription) + sub->owner->destroy_subscription(sub->owner); weston_log_subscription_destroy(sub); }