Skip to content

weston-log: rename confusing function names and parameters

Leandro Ribeiro requested to merge leandrohrb/weston:log_scope into master

As addressed by @pq in #328 (closed) and @daniels in !347 (comment 368667), we have some confusing names in weston-log:

  • 1/4 - In the function weston_compositor_add_log_scope() we have a struct weston_log_context parameter that in the .c file is named log_ctx. In the .h, the same parameter is named compositor. This is confusing, since its type is not struct weston_compositor, but struct weston_log_context. Rename the parameter to log_ctx in the .h.

  • 2/4 - Something similar happens in the function weston_log_subscription_printf(), where we have a struct weston_log_subscription parameter that in the .c file is named sub. In the .h, the same parameter is named scope. This is confusing, since its type is not struct weston_log_scope, but struct weston_log_subscription. Rename the parameter to sub in the .h.

  • 3/4 - Also, the name weston_compositor_add_log_scope() is confusing as well, as it doesn't take a struct weston_compositor argument. Rename the function to weston_log_ctx_add_log_scope().

  • 4/4 - The same happens for the function weston_compositor_log_scope_destroy(), that doesn't take a struct weston_compositor argument. Rename the function to weston_log_scope_destroy().

Fixes: #328 (closed)

Edited by Leandro Ribeiro

Merge request reports