Fix bool return types

This makes wlroots build in C23 mode.

C23 is more strict and rejects implicit conversions from bool to a
pointer.
master
Simon Ser 11 months ago
parent 2f2a55ebd3
commit a0b1329ee6

@ -600,7 +600,7 @@ struct wlr_backend *wlr_x11_backend_create(struct wl_display *display,
if (!query_formats(x11)) { if (!query_formats(x11)) {
wlr_log(WLR_ERROR, "Failed to query supported DRM formats"); wlr_log(WLR_ERROR, "Failed to query supported DRM formats");
return false; goto error_event;
} }
x11->drm_fd = -1; x11->drm_fd = -1;
@ -637,7 +637,7 @@ struct wlr_backend *wlr_x11_backend_create(struct wl_display *display,
#if HAVE_XCB_ERRORS #if HAVE_XCB_ERRORS
if (xcb_errors_context_new(x11->xcb, &x11->errors_context) != 0) { if (xcb_errors_context_new(x11->xcb, &x11->errors_context) != 0) {
wlr_log(WLR_ERROR, "Failed to create error context"); wlr_log(WLR_ERROR, "Failed to create error context");
return false; goto error_event;
} }
#endif #endif

@ -1816,12 +1816,12 @@ struct wlr_vk_pipeline_layout *get_or_create_pipeline_layout(
if (res != VK_SUCCESS) { if (res != VK_SUCCESS) {
wlr_vk_error("vkCreateSampler", res); wlr_vk_error("vkCreateSampler", res);
free(pipeline_layout); free(pipeline_layout);
return false; return NULL;
} }
if (!init_tex_layouts(renderer, pipeline_layout->sampler, &pipeline_layout->ds, &pipeline_layout->vk)) { if (!init_tex_layouts(renderer, pipeline_layout->sampler, &pipeline_layout->ds, &pipeline_layout->vk)) {
free(pipeline_layout); free(pipeline_layout);
return false; return NULL;
} }
wl_list_insert(&renderer->pipeline_layouts, &pipeline_layout->link); wl_list_insert(&renderer->pipeline_layouts, &pipeline_layout->link);

@ -806,7 +806,7 @@ static struct wlr_texture *vulkan_texture_from_dmabuf_buffer(
struct wlr_vk_texture *texture = vulkan_texture_from_dmabuf(renderer, dmabuf); struct wlr_vk_texture *texture = vulkan_texture_from_dmabuf(renderer, dmabuf);
if (texture == NULL) { if (texture == NULL) {
return false; return NULL;
} }
texture->buffer = wlr_buffer_lock(buffer); texture->buffer = wlr_buffer_lock(buffer);

@ -52,12 +52,12 @@ static struct wlr_buffer *output_acquire_empty_buffer(struct wlr_output *output,
// wlr_output_test_state(), which will prevent us from being called. // wlr_output_test_state(), which will prevent us from being called.
if (!wlr_output_configure_primary_swapchain(output, state, if (!wlr_output_configure_primary_swapchain(output, state,
&output->swapchain)) { &output->swapchain)) {
return false; return NULL;
} }
struct wlr_buffer *buffer = wlr_swapchain_acquire(output->swapchain, NULL); struct wlr_buffer *buffer = wlr_swapchain_acquire(output->swapchain, NULL);
if (buffer == NULL) { if (buffer == NULL) {
return false; return NULL;
} }
struct wlr_render_pass *pass = struct wlr_render_pass *pass =

Loading…
Cancel
Save