[Spice-devel] [PATCH 2/3] Simplify some boolean arithmetic
Pavel Grunt
pgrunt at redhat.com
Fri Sep 16 07:50:55 UTC 2016
On Fri, 2016-09-16 at 08:30 +0100, Frediano Ziglio wrote:
> Pass boolean directly.
>
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Pavel Grunt <pgrunt at redhat.com>
> ---
> server/dcc-send.c | 15 +++------------
> 1 file changed, 3 insertions(+), 12 deletions(-)
>
> diff --git a/server/dcc-send.c b/server/dcc-send.c
> index 317d906..89c3dc5 100644
> --- a/server/dcc-send.c
> +++ b/server/dcc-send.c
> @@ -147,11 +147,7 @@ static int is_bitmap_lossy(RedChannelClient
> *rcc, SpiceImage *image, SpiceRect *
> out_data->id = image->descriptor.id;
> if (dcc_pixmap_cache_hit(dcc, image->descriptor.id,
> &is_hit_lossy)) {
> out_data->type = BITMAP_DATA_TYPE_CACHE;
> - if (is_hit_lossy) {
> - return TRUE;
> - } else {
> - return FALSE;
> - }
> + return is_hit_lossy;
> } else {
> out_data->type = BITMAP_DATA_TYPE_BITMAP_TO_CACHE;
> }
> @@ -166,13 +162,8 @@ static int is_bitmap_lossy(RedChannelClient
> *rcc, SpiceImage *image, SpiceRect *
> out_data->type = BITMAP_DATA_TYPE_SURFACE;
> out_data->id = image->u.surface.surface_id;
>
> - if (is_surface_area_lossy(dcc, out_data->id,
> - area, &out_data->lossy_rect))
> - {
> - return TRUE;
> - } else {
> - return FALSE;
> - }
> + return is_surface_area_lossy(dcc, out_data->id,
> + area, &out_data->lossy_rect);
> }
>
> static int is_brush_lossy(RedChannelClient *rcc, SpiceBrush *brush,
>
More information about the Spice-devel
mailing list