glxcmds.c: In function ‘__glXGetDrawableAttributes’:
glxcmds.c:3295:8: warning: ‘screen’ may be used uninitialized in this function
glxcmds.c:3298:8: warning: ‘attribs_size’ may be used uninitialized in this 
function

Signed-off-by: Adam Jackson <[email protected]>
---
 hw/dmx/glxProxy/glxcmds.c |   42 ++++++++++++++++++------------------------
 1 files changed, 18 insertions(+), 24 deletions(-)

diff --git a/hw/dmx/glxProxy/glxcmds.c b/hw/dmx/glxProxy/glxcmds.c
index cbefdfa..72ecdea 100644
--- a/hw/dmx/glxProxy/glxcmds.c
+++ b/hw/dmx/glxProxy/glxcmds.c
@@ -3295,27 +3295,23 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, 
GLbyte *pc)
    int screen, rc;
    DMXScreenInfo *dmxScreen;
    CARD32 *attribs = NULL;
-   int attribs_size;
+   int attribs_size = 0;
 #ifdef PANORAMIX
     PanoramiXRes *pXinDraw = NULL;
 #endif
 
    if (drawId != None) {
       rc = dixLookupDrawable(&pDraw, drawId, client, 0, DixGetAttrAccess);
-      if (rc == Success) {
-        if (pDraw->type == DRAWABLE_WINDOW) {
-               WindowPtr pWin = (WindowPtr)pDraw;
-               be_drawable = 0;
-               screen = pWin->drawable.pScreen->myNum;
-
-        }
-        else {
-           /*
-            ** Drawable is not a Window , GLXWindow or a GLXPixmap.
-            */
-           client->errorValue = drawId;
-           return __glXBadDrawable;
-        }
+      if (rc == Success && pDraw->type == DRAWABLE_WINDOW) {
+        WindowPtr pWin = (WindowPtr)pDraw;
+        be_drawable = 0;
+        screen = pWin->drawable.pScreen->myNum;
+      } else {
+        /*
+         ** Drawable is not a Window , GLXWindow or a GLXPixmap.
+         */
+        client->errorValue = drawId;
+        return __glXBadDrawable;
       }
 
       if (!pDraw) {
@@ -3353,17 +3349,15 @@ int __glXGetDrawableAttributes(__GLXclientState *cl, 
GLbyte *pc)
            be_drawable = pGlxPbuffer->be_xids[screen];
         }
       }
-
-
-      if (!pDraw) {
-        /*
-         ** Drawable is not a Window , GLXWindow or a GLXPixmap.
-         */
-        client->errorValue = drawId;
-        return __glXBadDrawable;
-      }
     }
 
+    if (!pDraw) {
+       /*
+        ** Drawable is not a Window , GLXWindow or a GLXPixmap.
+        */
+       client->errorValue = drawId;
+       return __glXBadDrawable;
+   }
 
    /* if the drawable is a window or GLXWindow - 
     * we need to find the base id on the back-end server
-- 
1.7.3.5

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to