x11drv: use of uninitialized rect

Huw D M Davies h.davies1 at physics.ox.ac.uk
Wed Aug 24 04:20:06 CDT 2005


On Tue, Aug 23, 2005 at 08:18:09PM -0500, James Hawkins wrote:
> Hey,
> 
> While compiling x11drv, gcc gives the following error:
> 
> gcc -c -I. -I. -I../../include -I../../include -I/usr/X11R6/include
> -D__WINESRC__   -D_REENTRANT -fPIC -Wall -pipe
> -mpreferred-stack-boundary=2 -fno-strict-aliasing -gstabs+
> -Wpointer-arith  -g -O2  -o text.o text.c
> text.c: In function 'X11DRV_ExtTextOut':
> text.c:85: warning: 'rect.bottom' is used uninitialized in this function
> text.c:85: warning: 'rect.top' is used uninitialized in this function
> text.c:85: warning: 'rect.right' is used uninitialized in this function
> text.c:85: warning: 'rect.left' is used uninitialized in this function
> 
> Looking through the CVS log for text.c, I saw that before the latest
> patch, rect would be initialized if lprect == NULL; otherwise, rect =
> *lprect.  My guess is that we want to use lprect instead of rect, but
> I'm not familiar enough with that code to make the change.  Can you
> take a look at this Huw?

Opps, not sure how that slipped through - thanks!

      Huw Davies <huw at codeweavers.com>
      Use the correct rectangle for ETO_OPAQUE - spotted by James
      Hawkins.

-- 
Huw Davies
huw at codeweavers.com
Index: dlls/x11drv/text.c
===================================================================
RCS file: /home/wine/wine/dlls/x11drv/text.c,v
retrieving revision 1.16
diff -u -p -r1.16 text.c
--- dlls/x11drv/text.c	23 Aug 2005 09:38:59 -0000	1.16
+++ dlls/x11drv/text.c	24 Aug 2005 09:17:16 -0000
@@ -47,7 +47,6 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physD
     unsigned int i;
     fontObject*		pfo;
     XFontStruct*	font;
-    RECT 		rect;
     BOOL		rotated = FALSE;
     XChar2b		*str2b = NULL;
     BOOL		dibUpdateFlag = FALSE;
@@ -82,8 +81,8 @@ X11DRV_ExtTextOut( X11DRV_PDEVICE *physD
         wine_tsx11_lock();
         XSetForeground( gdi_display, physDev->gc, physDev->backgroundPixel );
         XFillRectangle( gdi_display, physDev->drawable, physDev->gc,
-                        physDev->org.x + rect.left, physDev->org.y + rect.top,
-                        rect.right-rect.left, rect.bottom-rect.top );
+                        physDev->org.x + lprect->left, physDev->org.y + lprect->top,
+                        lprect->right - lprect->left, lprect->bottom - lprect->top );
         wine_tsx11_unlock();
     }
     if (!count) goto END;  /* Nothing more to do */



More information about the wine-patches mailing list