mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2026-04-17 06:46:39 -04:00
Merge branch 'build-errors' into 'master'
Fix build errors with -Werror and NDEBUG See merge request wlroots/wlroots!4557
This commit is contained in:
commit
ccf98e44cd
9 changed files with 33 additions and 38 deletions
|
|
@ -152,8 +152,7 @@ bool output_pick_format(struct wlr_output *output,
|
|||
const struct wlr_drm_format_set *display_formats,
|
||||
struct wlr_drm_format *format, uint32_t fmt) {
|
||||
struct wlr_renderer *renderer = output->renderer;
|
||||
struct wlr_allocator *allocator = output->allocator;
|
||||
assert(renderer != NULL && allocator != NULL);
|
||||
assert(renderer != NULL && output->allocator != NULL);
|
||||
|
||||
const struct wlr_drm_format_set *render_formats =
|
||||
wlr_renderer_get_render_formats(renderer);
|
||||
|
|
|
|||
|
|
@ -940,15 +940,14 @@ void wlr_surface_unlock_cached(struct wlr_surface *surface, uint32_t seq) {
|
|||
return;
|
||||
}
|
||||
|
||||
bool found = false;
|
||||
struct wlr_surface_state *cached;
|
||||
wl_list_for_each(cached, &surface->cached, cached_state_link) {
|
||||
if (cached->seq == seq) {
|
||||
found = true;
|
||||
struct wlr_surface_state *cached = NULL, *iter;
|
||||
wl_list_for_each(iter, &surface->cached, cached_state_link) {
|
||||
if (iter->seq == seq) {
|
||||
cached = iter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
assert(found);
|
||||
assert(cached);
|
||||
|
||||
assert(cached->cached_state_locks > 0);
|
||||
cached->cached_state_locks--;
|
||||
|
|
@ -1490,6 +1489,7 @@ void wlr_surface_synced_finish(struct wlr_surface_synced *synced) {
|
|||
}
|
||||
}
|
||||
assert(found);
|
||||
(void)found;
|
||||
|
||||
struct wlr_surface_state *cached;
|
||||
wl_list_for_each(cached, &surface->cached, cached_state_link) {
|
||||
|
|
|
|||
|
|
@ -759,16 +759,15 @@ static void head_send_state(struct wlr_output_head_v1 *head,
|
|||
}
|
||||
|
||||
if (state & HEAD_STATE_MODE) {
|
||||
bool found = false;
|
||||
struct wl_resource *mode_resource;
|
||||
wl_resource_for_each(mode_resource, &head->mode_resources) {
|
||||
if (wl_resource_get_client(mode_resource) == client &&
|
||||
mode_from_resource(mode_resource) == head->state.mode) {
|
||||
found = true;
|
||||
struct wl_resource *mode_resource = NULL, *iter;
|
||||
wl_resource_for_each(iter, &head->mode_resources) {
|
||||
if (wl_resource_get_client(iter) == client &&
|
||||
mode_from_resource(iter) == head->state.mode) {
|
||||
mode_resource = iter;
|
||||
break;
|
||||
}
|
||||
}
|
||||
assert(found);
|
||||
assert(mode_resource);
|
||||
|
||||
if (head->state.mode == NULL) {
|
||||
// Fake a single output mode if output doesn't support modes
|
||||
|
|
|
|||
|
|
@ -495,10 +495,8 @@ static void handle_display_destroy(struct wl_listener *listener, void *data) {
|
|||
free(shm);
|
||||
}
|
||||
|
||||
struct wlr_shm *wlr_shm_create(struct wl_display *display, uint32_t version,
|
||||
static bool __attribute__((unused)) has_argb8888_and_xrgb8888(
|
||||
const uint32_t *formats, size_t formats_len) {
|
||||
assert(version <= SHM_VERSION);
|
||||
|
||||
// ARGB8888 and XRGB8888 must be supported per the wl_shm spec
|
||||
bool has_argb8888 = false, has_xrgb8888 = false;
|
||||
for (size_t i = 0; i < formats_len; i++) {
|
||||
|
|
@ -511,7 +509,13 @@ struct wlr_shm *wlr_shm_create(struct wl_display *display, uint32_t version,
|
|||
break;
|
||||
}
|
||||
}
|
||||
assert(has_argb8888 && has_xrgb8888);
|
||||
return has_argb8888 && has_xrgb8888;
|
||||
}
|
||||
|
||||
struct wlr_shm *wlr_shm_create(struct wl_display *display, uint32_t version,
|
||||
const uint32_t *formats, size_t formats_len) {
|
||||
assert(version <= SHM_VERSION);
|
||||
assert(has_argb8888_and_xrgb8888(formats, formats_len));
|
||||
|
||||
struct wlr_shm *shm = calloc(1, sizeof(*shm));
|
||||
if (shm == NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue