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>
This commit is contained in:
@@ -7203,10 +7203,14 @@ weston_compositor_create(struct wl_display *display,
|
|||||||
struct weston_compositor *ec;
|
struct weston_compositor *ec;
|
||||||
struct wl_event_loop *loop;
|
struct wl_event_loop *loop;
|
||||||
|
|
||||||
|
if (!log_ctx)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
ec = zalloc(sizeof *ec);
|
ec = zalloc(sizeof *ec);
|
||||||
if (!ec)
|
if (!ec)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
ec->weston_log_ctx = log_ctx;
|
||||||
ec->wl_display = display;
|
ec->wl_display = display;
|
||||||
ec->user_data = user_data;
|
ec->user_data = user_data;
|
||||||
wl_signal_init(&ec->destroy_signal);
|
wl_signal_init(&ec->destroy_signal);
|
||||||
@@ -7258,9 +7262,6 @@ weston_compositor_create(struct wl_display *display,
|
|||||||
ec, bind_presentation))
|
ec, bind_presentation))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (weston_log_ctx_compositor_setup(ec, log_ctx) < 0)
|
|
||||||
goto fail;
|
|
||||||
|
|
||||||
if (weston_input_init(ec) != 0)
|
if (weston_input_init(ec) != 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
|||||||
@@ -93,9 +93,6 @@ weston_log_run_cb_new_subscription(struct weston_log_subscription *sub);
|
|||||||
void
|
void
|
||||||
weston_debug_protocol_advertise_scopes(struct weston_log_context *log_ctx,
|
weston_debug_protocol_advertise_scopes(struct weston_log_context *log_ctx,
|
||||||
struct wl_resource *res);
|
struct wl_resource *res);
|
||||||
int
|
|
||||||
weston_log_ctx_compositor_setup(struct weston_compositor *compositor,
|
|
||||||
struct weston_log_context *log_ctx);
|
|
||||||
|
|
||||||
int
|
int
|
||||||
weston_vlog(const char *fmt, va_list ap);
|
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);
|
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
|
/** Creates weston_log_context structure
|
||||||
*
|
*
|
||||||
* \return NULL in case of failure, or a weston_log_context object in case of
|
* \return NULL in case of failure, or a weston_log_context object in case of
|
||||||
|
|||||||
Reference in New Issue
Block a user