[Spice-devel] [PATCH 01/19] worker: changed some spice_assert in display_channel_draw_till

Jonathon Jongsma jjongsma at redhat.com
Wed Nov 25 07:33:36 PST 2015


On Wed, 2015-11-25 at 15:27 +0000, Frediano Ziglio wrote:
> From: Marc-André Lureau <marcandre.lureau at gmail.com>
> 
> ---
>  server/display-channel.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/server/display-channel.c b/server/display-channel.c
> index 1496f07..cffd6fa 100644
> --- a/server/display-channel.c
> +++ b/server/display-channel.c
> @@ -1344,8 +1344,8 @@ void display_channel_draw_till(DisplayChannel *display,
> const SpiceRect *area, i
>      Drawable *now;
>      QRegion rgn;
>  
> -    spice_assert(last);
> -    spice_assert(ring_item_is_linked(&last->list_link));
> +    spice_return_if_fail(last);
> +    spice_return_if_fail(ring_item_is_linked(&last->list_link));
>  
>      surface = &display->surfaces[surface_id];
>  


Changing these to early return here seems fine. The caller doesn't depend on any
side-effects from calling this function.

Reviewed-by: Jonathon Jongsma <jjongsma at redhat.com>


More information about the Spice-devel mailing list