Commit d9d2663c authored by Alex Bennée's avatar Alex Bennée Committed by Gerd Hoffmann
Browse files

ui/vnc-enc-tight: remove switch and have single return



When enabling the sanitizer build it will complain about control
reaching a non-void function. Normally the compiler should detect that
there is only one possible exit given a static VNC_SERVER_FB_BYTES.

As we always expect a static VNC_SERVER_FB_BYTES I've added a compile
time assert and just called the sub-function directly.

Signed-off-by: default avatarAlex Bennée <alex.bennee@linaro.org>
Reviewed-by: default avatarMarc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent 44231843
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -707,11 +707,9 @@ check_solid_tile32(VncState *vs, int x, int y, int w, int h,
static bool check_solid_tile(VncState *vs, int x, int y, int w, int h,
                             uint32_t* color, bool samecolor)
{
    switch (VNC_SERVER_FB_BYTES) {
    case 4:
    QEMU_BUILD_BUG_ON(VNC_SERVER_FB_BYTES != 4);
    return check_solid_tile32(vs, x, y, w, h, color, samecolor);
}
}

static void find_best_solid_area(VncState *vs, int x, int y, int w, int h,
                                 uint32_t color, int *w_ptr, int *h_ptr)