Commit bd9c0a6f authored by Leandro Ribeiro's avatar Leandro Ribeiro
Browse files

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: default avatarLeandro Ribeiro <leandrohr@riseup.net>
parent dd718b07
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment