glx: move 'prime' var into #ifdef'd code block
authorBrian Paul <brianp@vmware.com>
Thu, 6 Sep 2012 14:16:08 +0000 (08:16 -0600)
committerBrian Paul <brianp@vmware.com>
Fri, 7 Sep 2012 00:58:49 +0000 (18:58 -0600)
To silence unused var warning.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
src/glx/dri2.c

index 1214cb47a782953f99382cd21ea270adbb6506e7..e17da6f7fc213c117db59c4dfa1526f3ea6afdcc 100644 (file)
@@ -269,7 +269,6 @@ DRI2Connect(Display * dpy, XID window, char **driverName, char **deviceName)
    XExtDisplayInfo *info = DRI2FindDisplay(dpy);
    xDRI2ConnectReply rep;
    xDRI2ConnectReq *req;
-   char *prime;
 
    XextCheckExtension(dpy, info, dri2ExtensionName, False);
 
@@ -281,13 +280,16 @@ DRI2Connect(Display * dpy, XID window, char **driverName, char **deviceName)
 
    req->driverType = DRI2DriverDRI;
 #ifdef DRI2DriverPrimeShift
-   prime = getenv("DRI_PRIME");
-   if (prime) {
-      uint32_t primeid;
-      errno = 0;
-      primeid = strtoul(prime, NULL, 0);
-      if (errno == 0)
-         req->driverType |= ((primeid & DRI2DriverPrimeMask) << DRI2DriverPrimeShift);
+   {
+      char *prime = getenv("DRI_PRIME");
+      if (prime) {
+         uint32_t primeid;
+         errno = 0;
+         primeid = strtoul(prime, NULL, 0);
+         if (errno == 0)
+            req->driverType |=
+               ((primeid & DRI2DriverPrimeMask) << DRI2DriverPrimeShift);
+      }
    }
 #endif