[Spice-devel] remove two 'set but not used' warnings in src/qxl_surface.c

Submitted by Christophe Fergeau on July 25, 2011, 3:17 p.m.

Details

Message ID 20110725081735.GC21367@teriyaki.redhat.com
State New, archived
Headers show

Not browsing as part of any series.

Commit Message

Christophe Fergeau July 25, 2011, 3:17 p.m.
On Sun, Jul 24, 2011 at 08:05:46AM +0300, Yaniv Kaul wrote:
> Fixes the compilation warnings:

I'd even go with this patch to group all this debugging in the same spot:



Christophe

Patch hide | download patch | download mbox

diff --git a/src/qxl_surface.c b/src/qxl_surface.c
index 047b35a..3292507 100644
--- a/src/qxl_surface.c
+++ b/src/qxl_surface.c
@@ -940,7 +940,6 @@  qxl_surface_prepare_access (qxl_surface_t  *surface,
     ScreenPtr pScreen = pixmap->drawable.pScreen;
     ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
     RegionRec new;
-    int stride, height;
 
     if (!pScrn->vtSema)
         return FALSE;
@@ -957,16 +956,17 @@  qxl_surface_prepare_access (qxl_surface_t  *surface,
     boxes = REGION_RECTS (region);
 
 #if 0
-    ErrorF ("Preparing access to %d boxes\n", n_boxes);
-#endif
+    {
+        int stride, height;
+        ErrorF ("Preparing access to %d boxes\n", n_boxes);
 
-    stride = pixman_image_get_stride (surface->dev_image);
-    height = pixman_image_get_height (surface->dev_image);
+        stride = pixman_image_get_stride (surface->dev_image);
+        height = pixman_image_get_height (surface->dev_image);
 
-#if 0
-    ErrorF ("Flattening %p -> %p  (allocated end %p)\n", 
-	    surface->address, 
-	    surface->address + stride * height, surface->end);
+        ErrorF ("Flattening %p -> %p  (allocated end %p)\n",
+                surface->address,
+                surface->address + stride * height, surface->end);
+    }
 #endif
 
     if (n_boxes < 25)