[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 1/9] ui/vnc-enc-tight: remove switch and have sin
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PATCH v2 1/9] ui/vnc-enc-tight: remove switch and have single return |
Date: |
Thu, 22 Sep 2016 11:13:08 +0100 |
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: Alex Bennée <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
---
v2
- use QEMU_BUILD_BUG_ON instead and just return
---
ui/vnc-enc-tight.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/ui/vnc-enc-tight.c b/ui/vnc-enc-tight.c
index 49df85e..1e53b1c 100644
--- a/ui/vnc-enc-tight.c
+++ b/ui/vnc-enc-tight.c
@@ -707,10 +707,8 @@ 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:
- return check_solid_tile32(vs, x, y, w, h, color, samecolor);
- }
+ 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,
--
2.9.3
- [Qemu-devel] [PATCH v2 0/9] A couple of fixes for ThreadSanitizer, Alex Bennée, 2016/09/22
- [Qemu-devel] [PATCH v2 2/9] tcg/optimize: move default return out of if statement, Alex Bennée, 2016/09/22
- [Qemu-devel] [PATCH v2 1/9] ui/vnc-enc-tight: remove switch and have single return,
Alex Bennée <=
- [Qemu-devel] [PATCH v2 4/9] seqlock: use atomic writes for the sequence, Alex Bennée, 2016/09/22
- [Qemu-devel] [PATCH v2 6/9] cpu: atomically modify cpu->exit_request, Alex Bennée, 2016/09/22
- [Qemu-devel] [PATCH v2 3/9] new: blacklist.tsan, Alex Bennée, 2016/09/22
- [Qemu-devel] [PATCH v2 8/9] qga/command: use QEMU atomic primitives, Alex Bennée, 2016/09/22
- [Qemu-devel] [PATCH v2 5/9] qom/object: update class cache atomically, Alex Bennée, 2016/09/22
- [Qemu-devel] [PATCH v2 9/9] .travis.yml: add gcc sanitizer build, Alex Bennée, 2016/09/22