mirror of
https://gitlab.uni-freiburg.de/opensourcevdi/spice
synced 2026-01-08 12:24:55 +00:00
Remove use of spice_warn_if()
spice_warn_if_fail() is doing the same thing except for the inverted condition. spice_warn_if() is being removed from spice-common to avoid having potentially confusing redundancy.
This commit is contained in:
parent
30f873d033
commit
4b8607c40c
@ -270,7 +270,7 @@ void display_channel_surface_unref(DisplayChannel *display, uint32_t surface_id)
|
||||
dcc_destroy_surface(dcc, surface_id);
|
||||
}
|
||||
|
||||
spice_warn_if(!ring_is_empty(&surface->depend_on_me));
|
||||
spice_warn_if_fail(ring_is_empty(&surface->depend_on_me));
|
||||
}
|
||||
|
||||
/* TODO: perhaps rename to "ready" or "realized" ? */
|
||||
@ -325,7 +325,7 @@ static void pipes_add_drawable(DisplayChannel *display, Drawable *drawable)
|
||||
DisplayChannelClient *dcc;
|
||||
RingItem *dcc_ring_item, *next;
|
||||
|
||||
spice_warn_if(!ring_is_empty(&drawable->pipes));
|
||||
spice_warn_if_fail(ring_is_empty(&drawable->pipes));
|
||||
FOREACH_DCC(display, dcc_ring_item, next, dcc) {
|
||||
dcc_prepend_drawable(dcc, drawable);
|
||||
}
|
||||
@ -1886,7 +1886,7 @@ void display_channel_create_surface(DisplayChannel *display, uint32_t surface_id
|
||||
{
|
||||
RedSurface *surface = &display->surfaces[surface_id];
|
||||
|
||||
spice_warn_if(surface->context.canvas);
|
||||
spice_warn_if_fail(!surface->context.canvas);
|
||||
|
||||
surface->context.canvas_draws_on_surface = FALSE;
|
||||
surface->context.width = width;
|
||||
|
||||
@ -835,9 +835,9 @@ static void dev_create_primary_surface(RedWorker *worker, uint32_t surface_id,
|
||||
int error;
|
||||
|
||||
spice_debug(NULL);
|
||||
spice_warn_if(surface_id != 0);
|
||||
spice_warn_if(surface.height == 0);
|
||||
spice_warn_if(((uint64_t)abs(surface.stride) * (uint64_t)surface.height) !=
|
||||
spice_warn_if_fail(surface_id == 0);
|
||||
spice_warn_if_fail(surface.height != 0);
|
||||
spice_warn_if_fail(((uint64_t)abs(surface.stride) * (uint64_t)surface.height) ==
|
||||
abs(surface.stride) * surface.height);
|
||||
|
||||
line_0 = (uint8_t*)memslot_get_virt(&worker->mem_slots, surface.mem,
|
||||
@ -887,7 +887,7 @@ static void destroy_primary_surface(RedWorker *worker, uint32_t surface_id)
|
||||
|
||||
if (!validate_surface(display, surface_id))
|
||||
return;
|
||||
spice_warn_if(surface_id != 0);
|
||||
spice_warn_if_fail(surface_id == 0);
|
||||
|
||||
spice_debug(NULL);
|
||||
if (!display->surfaces[surface_id].context.canvas) {
|
||||
@ -1593,7 +1593,7 @@ RedWorker* red_worker_new(QXLInstance *qxl, RedDispatcher *red_dispatcher)
|
||||
init_info.memslot_id_bits,
|
||||
init_info.internal_groupslot_id);
|
||||
|
||||
spice_warn_if(init_info.n_surfaces > NUM_SURFACES);
|
||||
spice_warn_if_fail(init_info.n_surfaces <= NUM_SURFACES);
|
||||
|
||||
worker->event_timeout = INF_EVENT_WAIT;
|
||||
|
||||
|
||||
@ -421,7 +421,7 @@ static void snd_receive(void* data)
|
||||
for (;;) {
|
||||
ssize_t n;
|
||||
n = channel->receive_data.end - channel->receive_data.now;
|
||||
spice_warn_if(n <= 0);
|
||||
spice_warn_if_fail(n > 0);
|
||||
n = reds_stream_read(channel->stream, channel->receive_data.now, n);
|
||||
if (n <= 0) {
|
||||
if (n == 0) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user