weston-log: fold weston_log_ctx_compositor_setup() into weston_compositor_create()

The function weston_log_ctx_compositor_setup() is being called only inside
weston_compositor_create() and it is so tiny that the code gets easier to
follow if it gets folded in weston_compositor_create().

Signed-off-by: Leandro Ribeiro <leandrohr@riseup.net>
dev
Leandro Ribeiro 5 years ago
parent dd718b0788
commit bd9c0a6ff5
  1. 7
      libweston/compositor.c
  2. 3
      libweston/weston-log-internal.h
  3. 22
      libweston/weston-log.c

@ -7203,10 +7203,14 @@ weston_compositor_create(struct wl_display *display,
struct weston_compositor *ec;
struct wl_event_loop *loop;
if (!log_ctx)
return NULL;
ec = zalloc(sizeof *ec);
if (!ec)
return NULL;
ec->weston_log_ctx = log_ctx;
ec->wl_display = display;
ec->user_data = user_data;
wl_signal_init(&ec->destroy_signal);
@ -7258,9 +7262,6 @@ weston_compositor_create(struct wl_display *display,
ec, bind_presentation))
goto fail;
if (weston_log_ctx_compositor_setup(ec, log_ctx) < 0)
goto fail;
if (weston_input_init(ec) != 0)
goto fail;

@ -93,9 +93,6 @@ weston_log_run_cb_new_subscription(struct weston_log_subscription *sub);
void
weston_debug_protocol_advertise_scopes(struct weston_log_context *log_ctx,
struct wl_resource *res);
int
weston_log_ctx_compositor_setup(struct weston_compositor *compositor,
struct weston_log_context *log_ctx);
int
weston_vlog(const char *fmt, va_list ap);

@ -398,28 +398,6 @@ weston_debug_protocol_advertise_scopes(struct weston_log_context *log_ctx,
weston_debug_v1_send_available(res, scope->name, scope->desc);
}
/**
* Connect weston_compositor structure to weston_log_context structure.
*
* \param compositor
* \param log_ctx
* \return 0 on success, -1 on failure
*
* Sets weston_compositor::weston_log_ctx.
*
* @ingroup log
*/
int
weston_log_ctx_compositor_setup(struct weston_compositor *compositor,
struct weston_log_context *log_ctx)
{
assert(!compositor->weston_log_ctx);
assert(log_ctx);
compositor->weston_log_ctx = log_ctx;
return 0;
}
/** Creates weston_log_context structure
*
* \return NULL in case of failure, or a weston_log_context object in case of

Loading…
Cancel
Save