From patchwork Tue Jan 10 08:44:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alon Levy X-Patchwork-Id: 135443 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [140.186.70.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 64AD9B6EEA for ; Thu, 12 Jan 2012 04:50:00 +1100 (EST) Received: from localhost ([::1]:45245 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rkzgk-0005bE-2J for incoming@patchwork.ozlabs.org; Wed, 11 Jan 2012 10:02:06 -0500 Received: from eggs.gnu.org ([140.186.70.92]:53983) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkXJT-0006MS-RH for qemu-devel@nongnu.org; Tue, 10 Jan 2012 03:44:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RkXJR-00074K-Mz for qemu-devel@nongnu.org; Tue, 10 Jan 2012 03:44:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:45338) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkXJR-000748-GI for qemu-devel@nongnu.org; Tue, 10 Jan 2012 03:44:09 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0A8i7dq021387 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 10 Jan 2012 03:44:07 -0500 Received: from garlic.redhat.com (vpn-202-236.tlv.redhat.com [10.35.202.236]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q0A8i56A002584; Tue, 10 Jan 2012 03:44:06 -0500 From: Alon Levy To: Andrzej Zaborowski Date: Tue, 10 Jan 2012 10:44:04 +0200 Message-Id: <1326185044-31983-1-git-send-email-alevy@redhat.com> In-Reply-To: <1326095876-31319-1-git-send-email-balrogg@gmail.com> References: <1326095876-31319-1-git-send-email-balrogg@gmail.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 209.132.183.28 X-Mailman-Approved-At: Wed, 11 Jan 2012 10:01:13 -0500 Cc: qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH] (dont commit) virtio-gl-fixes for build on F17 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org All but the last are assigned but unused variables, and an always true comparison, but the last looks like a logic error - decode not returning the actual return value for the last call in the buffer (vmgl-exec.c). --- gl/gloffscreen-xcomposite.c | 4 +--- gl/vmgl-exec.c | 10 +++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/gl/gloffscreen-xcomposite.c b/gl/gloffscreen-xcomposite.c index 5c63ed4..00a419b 100644 --- a/gl/gloffscreen-xcomposite.c +++ b/gl/gloffscreen-xcomposite.c @@ -186,8 +186,6 @@ static void glo_test_readback_methods(void) /* Initialise gloffscreen */ int glo_init(void) { - XErrorHandler old_handler; - if (glo_inited) { return 0; } @@ -204,7 +202,7 @@ int glo_init(void) /* Safe because we are single threaded. Otherwise we cause recursion * on the next call. Set the X error handler. */ glo_inited = 1; - old_handler = XSetErrorHandler(x_errhandler); + (void)XSetErrorHandler(x_errhandler); glo_test_readback_methods(); return 0; diff --git a/gl/vmgl-exec.c b/gl/vmgl-exec.c index e538ff4..3cf5eba 100644 --- a/gl/vmgl-exec.c +++ b/gl/vmgl-exec.c @@ -668,7 +668,7 @@ static int glXGetConfigFunc(uint32_t visualid, uint32_t attrib, uint32_t *value) { const VmglGLXFBConfig *config = &fbconfigs[0]; - if (visualid >= 0 && visualid < ARRAY_SIZE(fbconfigs)) { + if (visualid < ARRAY_SIZE(fbconfigs)) { config = &fbconfigs[visualid]; } else { DEBUGF("Unknown visual ID %d\n", visualid); @@ -3072,11 +3072,12 @@ static inline int do_decode_call(ProcessStruct *p, const uint8_t *args_in, int args_len, uint8_t *r_buffer) { Signature *signature; - int i, ret; - const uint8_t *arg_ptr, *tmp; + int i; + const uint8_t *arg_ptr; static arg_t args[50]; int func_number; ProcessState *process = DO_UPCAST(ProcessState, p, p); + int ret = 1; if (!args_len) { return 0; @@ -3099,7 +3100,6 @@ static inline int do_decode_call(ProcessStruct *p, const uint8_t *args_in, #endif signature = (Signature *) tab_opengl_calls[func_number]; - tmp = arg_ptr; for (i = 0; i < signature->nb_args; i++) { int args_size = *(const uint32_t *) arg_ptr; @@ -3220,7 +3220,7 @@ static inline int do_decode_call(ProcessStruct *p, const uint8_t *args_in, } #endif - return 1; + return ret; } #define GL_PASSTHROUGH_ABI 1