qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH] (dont commit) virtio-gl-fixes for build on F17


From: Alon Levy
Subject: [Qemu-devel] [PATCH] (dont commit) virtio-gl-fixes for build on F17
Date: Tue, 10 Jan 2012 10:44:04 +0200

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
-- 
1.7.8.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]