From patchwork Wed Sep 28 12:01:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 9353769 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 25BD36077A for ; Wed, 28 Sep 2016 12:02:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17DAB29515 for ; Wed, 28 Sep 2016 12:02:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0CE0229520; Wed, 28 Sep 2016 12:02:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 92F2729515 for ; Wed, 28 Sep 2016 12:02:47 +0000 (UTC) Received: from localhost ([::1]:58303 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpDZW-0003Vd-Oh for patchwork-qemu-devel@patchwork.kernel.org; Wed, 28 Sep 2016 08:02:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42030) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpDYu-0003SR-BN for qemu-devel@nongnu.org; Wed, 28 Sep 2016 08:02:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bpDYo-0001O6-Do for qemu-devel@nongnu.org; Wed, 28 Sep 2016 08:02:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50162) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bpDYo-0001Nb-7h for qemu-devel@nongnu.org; Wed, 28 Sep 2016 08:02:02 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 478BF3F1EC; Wed, 28 Sep 2016 12:02:01 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-31.ams2.redhat.com [10.36.116.31]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u8SC202J024122; Wed, 28 Sep 2016 08:02:00 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 8A85680BAB; Wed, 28 Sep 2016 14:01:59 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Wed, 28 Sep 2016 14:01:57 +0200 Message-Id: <1475064117-11571-5-git-send-email-kraxel@redhat.com> In-Reply-To: <1475064117-11571-1-git-send-email-kraxel@redhat.com> References: <1475064117-11571-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Wed, 28 Sep 2016 12:02:01 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 4/4] ui/vnc-enc-tight: remove switch and have single return X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?UTF-8?q?Alex=20Benn=C3=A9e?= , Gerd Hoffmann Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Alex Bennée 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 Reviewed-by: Marc-André Lureau Signed-off-by: Gerd Hoffmann --- 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,