Received: from eggs.gnu.org ([140.186.70.92]:34725) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlI74-0000pW-Nn for qemu-devel@nongnu.org; Thu, 12 Jan 2012 05:42:34 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RlI72-0005PJ-Ja for qemu-devel@nongnu.org; Thu, 12 Jan 2012 05:42:30 -0500 Received: from mx1.redhat.com ([209.132.183.28]:21487) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RlI72-0005PE-Cv for qemu-devel@nongnu.org; Thu, 12 Jan 2012 05:42:28 -0500 Date: Thu, 12 Jan 2012 12:42:22 +0200 From: Alon Levy Message-ID: <20120112104222.GE5762@garlic.tlv.redhat.com> References: <1326095876-31319-1-git-send-email-balrogg@gmail.com> <1326185044-31983-1-git-send-email-alevy@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH] (dont commit) virtio-gl-fixes for build on F17 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: andrzej zaborowski Cc: qemu-devel@nongnu.org On Tue, Jan 10, 2012 at 08:13:00PM +0100, andrzej zaborowski wrote: > On 10 January 2012 09:44, Alon Levy wrote: > > 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 cal= l > > in the buffer (vmgl-exec.c). > > --- > > =A0gl/gloffscreen-xcomposite.c | =A0 =A04 +--- > > =A0gl/vmgl-exec.c =A0 =A0 =A0 =A0 =A0 =A0 =A0| =A0 10 +++++----- > > =A02 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) > > =A0/* Initialise gloffscreen */ > > =A0int glo_init(void) > > =A0{ > > - =A0 =A0XErrorHandler old_handler; > > - > > =A0 =A0 if (glo_inited) { > > =A0 =A0 =A0 =A0 return 0; > > =A0 =A0 } > > @@ -204,7 +202,7 @@ int glo_init(void) > > =A0 =A0 /* Safe because we are single threaded. Otherwise we cause re= cursion > > =A0 =A0 =A0* on the next call. =A0Set the X error handler. =A0*/ > > =A0 =A0 glo_inited =3D 1; > > - =A0 =A0old_handler =3D XSetErrorHandler(x_errhandler); > > + =A0 =A0(void)XSetErrorHandler(x_errhandler); > > =A0 =A0 glo_test_readback_methods(); > > > > =A0 =A0 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, ui= nt32_t attrib, uint32_t *value) > > =A0{ > > =A0 =A0 const VmglGLXFBConfig *config =3D &fbconfigs[0]; > > > > - =A0 =A0if (visualid >=3D 0 && visualid < ARRAY_SIZE(fbconfigs)) { > > + =A0 =A0if (visualid < ARRAY_SIZE(fbconfigs)) { > > =A0 =A0 =A0 =A0 config =3D &fbconfigs[visualid]; > > =A0 =A0 } else { > > =A0 =A0 =A0 =A0 DEBUGF("Unknown visual ID %d\n", visualid); > > @@ -3072,11 +3072,12 @@ static inline int do_decode_call(ProcessStruc= t *p, const uint8_t *args_in, > > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 int args_len, uint8_t *r_buffer) > > =A0{ > > =A0 =A0 Signature *signature; > > - =A0 =A0int i, ret; > > - =A0 =A0const uint8_t *arg_ptr, *tmp; > > + =A0 =A0int i; > > + =A0 =A0const uint8_t *arg_ptr; > > =A0 =A0 static arg_t args[50]; > > =A0 =A0 int func_number; > > =A0 =A0 ProcessState *process =3D DO_UPCAST(ProcessState, p, p); > > + =A0 =A0int ret =3D 1; > > > > =A0 =A0 if (!args_len) { > > =A0 =A0 =A0 =A0 return 0; > > @@ -3099,7 +3100,6 @@ static inline int do_decode_call(ProcessStruct = *p, const uint8_t *args_in, > > =A0#endif > > > > =A0 =A0 =A0 =A0 signature =3D (Signature *) tab_opengl_calls[func_num= ber]; > > - =A0 =A0 =A0 =A0tmp =3D arg_ptr; > > > > =A0 =A0 =A0 =A0 for (i =3D 0; i < signature->nb_args; i++) { > > =A0 =A0 =A0 =A0 =A0 =A0 int args_size =3D *(const uint32_t *) arg_ptr= ; > > @@ -3220,7 +3220,7 @@ static inline int do_decode_call(ProcessStruct = *p, const uint8_t *args_in, > > =A0 =A0 } > > =A0#endif > > > > - =A0 =A0return 1; > > + =A0 =A0return ret; >=20 > Thanks for the compile test. I think I was meaning to check ret after > every do_function_call call and return immediately if 0. I'll fix it > in a future iteration and add your other fixes if you don't mind. Don't mind at all! But for some reason this email and the other one I send before it to you and to the qemu-devel list didn't reach the list. If you saw this email is it too much to assume you saw the other one as well? >=20 > Cheers