[Xquartz-changes] xserver: Branch 'master' - 10 commits

Jeremy Huddleston jeremyhu at freedesktop.org
Thu May 19 14:42:30 PDT 2011


 configure.ac                          |    6 +
 dix/cursor.c                          |    2 
 dix/dispatch.c                        |    6 -
 dix/events.c                          |    7 +-
 dix/inpututils.c                      |    2 
 fb/fbblt.c                            |   12 +--
 fb/fbbltone.c                         |    8 +-
 hw/xquartz/X11Application.m           |    6 -
 hw/xquartz/darwin.c                   |   33 +++++++++-
 hw/xquartz/darwin.h                   |   15 +---
 hw/xquartz/mach-startup/bundle-main.c |    5 -
 hw/xquartz/mach-startup/stub.c        |    1 
 hw/xquartz/quartzStartup.c            |    1 
 hw/xquartz/xpr/xprScreen.c            |    2 
 mi/mibitblt.c                         |    1 
 mi/mieq.c                             |    1 
 mi/miexpose.c                         |  105 ++++++++++++++++++++++++++++++----
 mi/mispans.c                          |   16 ++---
 18 files changed, 168 insertions(+), 61 deletions(-)

New commits:
commit 3cea3ac5dfb18e9c8aa42119ed8869c388206ead
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Thu May 19 14:39:22 2011 -0700

    XQuartz: Mark functions _X_NORETURN
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index e90c33e..fa8d4ce 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -772,8 +772,8 @@ void ddxGiveUp( void )
  *      made to restore all original setting of the displays. Also all devices
  *      are closed.
  */
-void AbortDDX( void )
-{
+_X_NORETURN
+void AbortDDX( void ) {
     ErrorF( "   AbortDDX\n" );
     OsAbort();
 }
diff --git a/hw/xquartz/mach-startup/stub.c b/hw/xquartz/mach-startup/stub.c
index 8319dd0..d8e4abd 100644
--- a/hw/xquartz/mach-startup/stub.c
+++ b/hw/xquartz/mach-startup/stub.c
@@ -164,6 +164,7 @@ static void send_fd_handoff(int connected_fd, int launchd_fd) {
     close(connected_fd);
 }
 
+__attribute__((__noreturn__))
 static void signal_handler(int sig) {
     if(x11app_pid)
         kill(x11app_pid, sig);
diff --git a/hw/xquartz/quartzStartup.c b/hw/xquartz/quartzStartup.c
index 00a9e48..25ef76e 100644
--- a/hw/xquartz/quartzStartup.c
+++ b/hw/xquartz/quartzStartup.c
@@ -56,6 +56,7 @@ struct arg {
     char **envp;
 };
 
+_X_NORETURN
 static void server_thread (void *arg) {
     struct arg args = *((struct arg *)arg);
     free(arg);
commit f259a96a08aecb38e3a0d789c5b690300577e0c5
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Thu May 19 14:35:56 2011 -0700

    XQuartz: Silence clang warnings about shadow declarations
    
    X11Application.m:1272:26: warning: declaration shadows a local variable [-Wshadow,Semantic Issue]
                    xp_error e;
                             ^
    X11Application.m:1098:36: note: previous declaration is here
    - (void) sendX11NSEvent:(NSEvent *)e {
                                       ^
    1 warning generated.
    
    bundle-main.c:648:36: warning: declaration shadows a local variable [-Wshadow,Semantic Issue]
                        int max_files, i;
                                       ^
    bundle-main.c:594:9: note: previous declaration is here
        int i;
            ^
    1 warning generated.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/X11Application.m b/hw/xquartz/X11Application.m
index 283132e..7c41cbc 100644
--- a/hw/xquartz/X11Application.m
+++ b/hw/xquartz/X11Application.m
@@ -1269,7 +1269,7 @@ static const char *untrusted_str(NSEvent *e) {
 #if defined(XPLUGIN_VERSION) && XPLUGIN_VERSION > 0
 /* Older libXplugin (Tiger/"Stock" Leopard) aren't thread safe, so we can't call xp_find_window from the Appkit thread */
                 xp_window_id wid = 0;
-                xp_error e;
+                xp_error err;
 
                 /* Sigh. Need to check that we're really over one of
                  * our windows. (We need to receive pointer events while
@@ -1277,9 +1277,9 @@ static const char *untrusted_str(NSEvent *e) {
                  * when another window is over us or we might show a tooltip)
                  */
 
-                e = xp_find_window(location.x, location.y, 0, &wid);
+                err = xp_find_window(location.x, location.y, 0, &wid);
 
-                if (e != XP_Success || (e == XP_Success && wid == 0))
+                if (err != XP_Success || (err == XP_Success && wid == 0))
 #endif
                 {
                     bgMouseLocation = location;
diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index 0e62914..94c6068 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -645,7 +645,7 @@ int main(int argc, char **argv, char **envp) {
                 child2 = fork();
 
                 switch (child2) {
-                    int max_files, i;
+                    int max_files;
 
                     case -1:                            /* error */
                         FatalError("fork() failed: %s\n", strerror(errno));
commit 390cde1b588a7eedf674eb4b77853ef35708a471
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Thu May 19 14:34:39 2011 -0700

    XQuartz: Update DEBUG_LOG to report to ASL
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index 50234f2..e90c33e 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -60,6 +60,7 @@
 #include <stdio.h>
 #include <fcntl.h>
 #include <unistd.h>
+#include <stdarg.h>
 
 #define HAS_UTSNAME 1
 #include <sys/utsname.h>
@@ -76,9 +77,31 @@
 #include "quartzKeyboard.h"
 #include "quartz.h"
 
-#ifdef ENABLE_DEBUG_LOG
-FILE *debug_log_fp = NULL;
-#endif
+aslclient aslc;
+
+void debug_asl (const char *file, const char *function, int line, const char *fmt, ...) {
+    va_list args;
+    aslmsg msg = asl_new(ASL_TYPE_MSG);
+
+    if(msg) {
+        char *_line;
+
+        asl_set(msg, "File", file);
+        asl_set(msg, "Function", function);
+        asprintf(&_line, "%d", line);
+        if(_line) {
+            asl_set(msg, "Line", _line);
+            free(_line);
+        }
+    }
+
+    va_start(args, fmt);
+    asl_vlog(aslc, msg, ASL_LEVEL_DEBUG, fmt, args);
+    va_end(args);
+
+    if(msg)
+        asl_free(msg);
+}
 
 /*
  * X server shared global variables
diff --git a/hw/xquartz/darwin.h b/hw/xquartz/darwin.h
index 507c6f7..659de43 100644
--- a/hw/xquartz/darwin.h
+++ b/hw/xquartz/darwin.h
@@ -32,7 +32,7 @@
 #include "inputstr.h"
 #include "scrnintstr.h"
 #include <X11/extensions/XKB.h>
-#include <assert.h>
+#include <asl.h>
 
 #include "darwinfb.h"
 
@@ -76,16 +76,9 @@ extern int              darwinMainScreenY;
 // bundle-main.c
 extern char *bundle_id_prefix;
 
-#define ENABLE_DEBUG_LOG 1
+extern void debug_asl (const char *file, const char *function, int line, const char *fmt, ...) _X_ATTRIBUTE_PRINTF(4,5);
 
-#ifdef ENABLE_DEBUG_LOG
-extern FILE *debug_log_fp;
-#define DEBUG_LOG_NAME "x11-debug.txt"
-#define DEBUG_LOG(msg, args...) if (debug_log_fp) fprintf(debug_log_fp, "%s:%s:%d " msg, __FILE__, __FUNCTION__, __LINE__, ##args ); fflush(debug_log_fp);
-#else
-#define DEBUG_LOG(msg, args...) 
-#endif
-
-#define TRACE() DEBUG_LOG("\n")
+#define DEBUG_LOG(msg, args...) debug_asl(__FILE__, __FUNCTION__, __LINE__, msg, ##args);
+#define TRACE() DEBUG_LOG("TRACE")
 
 #endif  /* _DARWIN_H */
diff --git a/hw/xquartz/mach-startup/bundle-main.c b/hw/xquartz/mach-startup/bundle-main.c
index 8e34376..0e62914 100644
--- a/hw/xquartz/mach-startup/bundle-main.c
+++ b/hw/xquartz/mach-startup/bundle-main.c
@@ -66,6 +66,8 @@
 /* From darwinEvents.c ... but don't want to pull in all the server cruft */
 void DarwinListenOnOpenFD(int fd);
 
+extern aslclient aslc;
+
 /* Ditto, from os/log.c */
 extern void ErrorF(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2);
 extern void FatalError(const char *f, ...) _X_ATTRIBUTE_PRINTF(1,2) _X_NORETURN;
@@ -485,7 +487,6 @@ static void ensure_path(const char *dir) {
 static void setup_console_redirect(const char *bundle_id) {
     char *asl_sender;
     char *asl_facility;
-    aslclient aslc;
 
     asprintf(&asl_sender, "%s.server", bundle_id);
     assert(asl_sender);
diff --git a/hw/xquartz/xpr/xprScreen.c b/hw/xquartz/xpr/xprScreen.c
index f6a7129..d2968dc 100644
--- a/hw/xquartz/xpr/xprScreen.c
+++ b/hw/xquartz/xpr/xprScreen.c
@@ -253,7 +253,7 @@ xprDisplayInit(void)
 {
     CGDisplayCount displayCount;
 
-    DEBUG_LOG("");
+    TRACE();
 
     CGGetActiveDisplayList(0, NULL, &displayCount);
 
commit 3b6a004452968a61c0e29c990bc72d1bf7e44d64
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Fri Apr 30 13:08:25 2010 -0700

    Workaround the GC clipping problem in miPaintWindow and add some debugging output.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/mi/miexpose.c b/mi/miexpose.c
index 94258b8..4f25c23 100644
--- a/mi/miexpose.c
+++ b/mi/miexpose.c
@@ -521,6 +521,7 @@ void RootlessSetPixmapOfAncestors(WindowPtr pWin);
 void RootlessStartDrawing(WindowPtr pWin);
 void RootlessDamageRegion(WindowPtr pWin, RegionPtr prgn);
 Bool IsFramedWindow(WindowPtr pWin);
+#include "../fb/fb.h"
 #endif 
 
 void
@@ -548,24 +549,37 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     Bool	solid = TRUE;
     DrawablePtr	drawable = &pWin->drawable;
 
+#ifdef XQUARTZ_CLIP_DEBUG
+    ErrorF("START %d BS %d (pR = %ld)\n", what, pWin->backgroundState, ParentRelative);
+    ErrorF("      Rgn: %d %d %d %d\n", prgn->extents.x1, prgn->extents.y1,
+	                               prgn->extents.x2 - prgn->extents.x1,
+	                               prgn->extents.y2 - prgn->extents.y1);
+    ErrorF("      Win: %d %d (%d %d) %d %d\n", pWin->origin.x, pWin->origin.y,
+	                                       pWin->winSize.extents.x1, pWin->winSize.extents.y1,
+	                                       pWin->winSize.extents.x2 - pWin->winSize.extents.x1,
+					       pWin->winSize.extents.y2 - pWin->winSize.extents.y1);
+    ErrorF("     Draw: %d %d %d %d\n", pWin->drawable.x, pWin->drawable.y,
+				       pWin->drawable.width, pWin->drawable.height);
+#endif
+
 #ifdef ROOTLESS
     if(!drawable || drawable->type == UNDRAWABLE_WINDOW)
 	return;
-
-    if(IsFramedWindow(pWin)) {
-        RootlessStartDrawing(pWin);
-        RootlessDamageRegion(pWin, prgn);
-    
-        if(pWin->backgroundState == ParentRelative) {
-            if((what == PW_BACKGROUND) || 
-               (what == PW_BORDER && !pWin->borderIsPixel))
-                RootlessSetPixmapOfAncestors(pWin);
-        }
-    }
 #endif
     
     if (what == PW_BACKGROUND)
     {
+#ifdef ROOTLESS
+	if(IsFramedWindow(pWin)) {
+	    RootlessStartDrawing(pWin);
+	    RootlessDamageRegion(pWin, prgn);
+
+	    if(pWin->backgroundState == ParentRelative) {
+		RootlessSetPixmapOfAncestors(pWin);
+	    }
+	}
+#endif
+
 	while (pWin->backgroundState == ParentRelative)
 	    pWin = pWin->parent;
 
@@ -587,6 +601,18 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     {
 	PixmapPtr   pixmap;
 
+#ifdef ROOTLESS
+	if(IsFramedWindow(pWin)) {
+	    RootlessStartDrawing(pWin);
+	    RootlessDamageRegion(pWin, prgn);
+	    
+	    if(!pWin->borderIsPixel &&
+		pWin->backgroundState == ParentRelative) {
+		RootlessSetPixmapOfAncestors(pWin);
+	    }
+	}
+#endif
+
 	tile_x_off = drawable->x;
 	tile_y_off = drawable->y;
 	
@@ -595,6 +621,12 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
 	    return;
 	pixmap = (*pScreen->GetWindowPixmap) ((WindowPtr) drawable);
 	drawable = &pixmap->drawable;
+
+#ifdef XQUARTZ_CLIP_DEBUG
+	ErrorF("     Draw: %d %d %d %d\n",
+	       drawable->x, drawable->y, drawable->width, drawable->height);    
+#endif
+	
 #ifdef COMPOSITE
 	draw_x_off = pixmap->screen_x;
 	draw_y_off = pixmap->screen_y;
@@ -657,6 +689,57 @@ miPaintWindow(WindowPtr pWin, RegionPtr prgn, int what)
     ChangeGC (NullClient, pGC, gcmask, gcval);
     ValidateGC (drawable, pGC);
 
+#ifdef XQUARTZ_CLIP_DEBUG
+    ErrorF("       GC: %d %d %d %d\n",
+	   pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1,
+	   pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1,
+	   pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1);
+#endif
+    
+#ifdef XQUARTZ
+    /* Looks like our clipping isn't set right for some reason:
+     * http://xquartz.macosforge.org/trac/ticket/290
+     */
+    if(what == PW_BORDER) {
+
+#if 0
+	if(solid) {
+#if 1
+	    fbFillRegionSolid(&pWin->drawable,
+			      prgn,
+			      0,
+			      fbReplicatePixel(fill.pixel,
+					       pWin->drawable.bitsPerPixel));
+#else
+	    fbFillRegionSolid(drawable,
+			      prgn,
+			      0,
+			      fbReplicatePixel(fill.pixel,
+					       drawable->bitsPerPixel));
+#endif
+	    return;
+	}
+#endif
+    
+	pGC->pCompositeClip->extents.x1 += prgn->extents.x1;
+	pGC->pCompositeClip->extents.y1 += prgn->extents.y1;
+	pGC->pCompositeClip->extents.x2 += prgn->extents.x1;
+	pGC->pCompositeClip->extents.y2 += prgn->extents.y1;
+	
+	if(pGC->pCompositeClip->extents.x2 > drawable->pScreen->width)
+	    pGC->pCompositeClip->extents.x2 = drawable->pScreen->width;
+	if(pGC->pCompositeClip->extents.y2 > drawable->pScreen->height)
+	    pGC->pCompositeClip->extents.y2 = drawable->pScreen->height;
+    }
+#endif
+
+#ifdef XQUARTZ_CLIP_DEBUG
+    ErrorF("       GC: %d %d %d %d\n",
+	   pGC->pCompositeClip->extents.x1, pGC->pCompositeClip->extents.y1,
+	   pGC->pCompositeClip->extents.x2 - pGC->pCompositeClip->extents.x1,
+	   pGC->pCompositeClip->extents.y2 - pGC->pCompositeClip->extents.y1);    
+#endif
+
     numRects = RegionNumRects(prgn);
     pbox = RegionRects(prgn);
     for (i= numRects; --i >= 0; pbox++, prect++)
commit 418c441bb261dfd6b0276a0d9a2937c4058ced2c
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sat Oct 30 14:55:06 2010 -0700

    configure.ac: Add -fno-strict-aliasing to CFLAGS
    
    This should address https://bugs.freedesktop.org/show_bug.cgi?id=31238
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/configure.ac b/configure.ac
index 655c0e4..146da80 100644
--- a/configure.ac
+++ b/configure.ac
@@ -87,6 +87,12 @@ XORG_PROG_RAWCPP
 # easier overrides at build time.
 XSERVER_CFLAGS='$(CWARNFLAGS)'
 
+dnl Explicitly add -fno-strict-aliasing since this option should disappear
+dnl from util-macros CWARNFLAGS
+if  test "x$GCC" = xyes ; then
+    XSERVER_CFLAGS="$XSERVER_CFLAGS -fno-strict-aliasing"
+fi
+
 dnl Check for dtrace program (needed to build Xserver dtrace probes)
 dnl Also checks for <sys/sdt.h>, since some Linux distros have an 
 dnl ISDN trace program named dtrace
commit 089cca9f27958984988c66f7308e2c08685f9a88
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sat May 14 16:48:53 2011 -0700

    mi: Fix compilation warnings
    
    mibitblt.c:654:13: warning: declaration shadows a local variable [-Wshadow,Semantic Issue]
                xPoint pt;
                       ^
    mibitblt.c:644:18: note: previous declaration is here
        DDXPointRec         pt = {0, 0};
                            ^
    1 warning generated.
    
    mispans.c:452:12: warning: declaration shadows a local variable [-Wshadow,Semantic Issue]
                                int i;
                                    ^
    mispans.c:376:14: note: previous declaration is here
        int                 i;
                            ^
    mispans.c:486:10: warning: declaration shadows a local variable [-Wshadow,Semantic Issue]
                int i;
                    ^
    mispans.c:376:14: note: previous declaration is here
        int                 i;
                            ^
    2 warnings generated.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index 49e17bd..47bebd8 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -651,7 +651,6 @@ miGetImage( DrawablePtr pDraw, int sx, int sy, int w, int h,
 	if ( (((1<<depth)-1)&planeMask) != (1<<depth)-1 )
 	{
 	    ChangeGCVal gcv;
-	    xPoint pt;
 
 	    pGC = GetScratchGC(depth, pDraw->pScreen);
 	    if (!pGC)
diff --git a/mi/mispans.c b/mi/mispans.c
index 21ba4da..c2308a2 100644
--- a/mi/mispans.c
+++ b/mi/mispans.c
@@ -449,12 +449,12 @@ void miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup *spanGroup)
 			    ysizes[index] * sizeof(int));
 			if (!newpoints || !newwidths)
 			{
-			    int	i;
+			    int	k;
 
-			    for (i = 0; i < ylength; i++)
+			    for (k = 0; k < ylength; k++)
 			    {
-				free(yspans[i].points);
-				free(yspans[i].widths);
+				free(yspans[k].points);
+				free(yspans[k].widths);
 			    }
 			    free(yspans);
 			    free(ysizes);
@@ -483,12 +483,12 @@ void miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup *spanGroup)
 	widths = malloc(count * sizeof(int));
 	if (!points || !widths)
 	{
-	    int	i;
+	    int	j;
 
-	    for (i = 0; i < ylength; i++)
+	    for (j = 0; j < ylength; j++)
 	    {
-		free(yspans[i].points);
-		free(yspans[i].widths);
+		free(yspans[j].points);
+		free(yspans[j].widths);
 	    }
 	    free(yspans);
 	    free(ysizes);
commit ea3d6f2727ae61f2f76f935b2d1246071ea13d00
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sat May 14 16:41:59 2011 -0700

    fb: Fix compilation warnings
    
    fbbltone.c:795:6: warning: declaration shadows a local variable [-Wshadow,Semantic Issue]
            int w = 24;
                ^
    fbbltone.c:777:10: note: previous declaration is here
        int         w;
                    ^
    1 warning generated.
    
    fbblt.c:80:16: warning: declaration shadows a local variable [-Wshadow,Semantic Issue]
            CARD8 *src = (CARD8 *) srcLine;
                   ^
    fbblt.c:61:14: note: previous declaration is here
        FbBits  *src, *dst;
                 ^
    fbblt.c:81:16: warning: declaration shadows a local variable [-Wshadow,Semantic Issue]
            CARD8 *dst = (CARD8 *) dstLine;
                   ^
    fbblt.c:61:20: note: previous declaration is here
        FbBits  *src, *dst;
                       ^
    2 warnings generated.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/fb/fbblt.c b/fb/fbblt.c
index a040298..6cee526 100644
--- a/fb/fbblt.c
+++ b/fb/fbblt.c
@@ -77,21 +77,21 @@ fbBlt (FbBits   *srcLine,
     if (alu == GXcopy && pm == FB_ALLONES && !reverse &&
             !(srcX & 7) && !(dstX & 7) && !(width & 7)) {
         int i;
-        CARD8 *src = (CARD8 *) srcLine;
-        CARD8 *dst = (CARD8 *) dstLine;
+        CARD8 *srcb = (CARD8 *) srcLine;
+        CARD8 *dstb = (CARD8 *) dstLine;
         
         srcStride *= sizeof(FbBits);
         dstStride *= sizeof(FbBits);
         width >>= 3;
-        src += (srcX >> 3);
-        dst += (dstX >> 3);
+        srcb += (srcX >> 3);
+        dstb += (dstX >> 3);
 
         if (!upsidedown)
             for (i = 0; i < height; i++)
-                MEMCPY_WRAPPED(dst + i * dstStride, src + i * srcStride, width);
+                MEMCPY_WRAPPED(dstb + i * dstStride, srcb + i * srcStride, width);
         else
             for (i = height - 1; i >= 0; i--)
-                MEMCPY_WRAPPED(dst + i * dstStride, src + i * srcStride, width);
+                MEMCPY_WRAPPED(dstb + i * dstStride, srcb + i * srcStride, width);
 
         return;
     }
diff --git a/fb/fbbltone.c b/fb/fbbltone.c
index 0a91575..8ce65c5 100644
--- a/fb/fbbltone.c
+++ b/fb/fbbltone.c
@@ -792,12 +792,12 @@ fbBltPlane (FbBits	    *src,
     pm = fbReplicatePixel (planeMask, srcBpp);
     if (srcBpp == 24)
     {
-	int w = 24;
+	int wi = 24;
 
 	rot0 = FbFirst24Rot (srcX);
-	if (srcX + w > FB_UNIT)
-	    w = FB_UNIT - srcX;
-	srcMaskFirst = FbRot24(pm,rot0) & FbBitsMask(srcX,w);
+	if (srcX + wi > FB_UNIT)
+	    wi = FB_UNIT - srcX;
+	srcMaskFirst = FbRot24(pm,rot0) & FbBitsMask(srcX,wi);
     }
     else
     {
commit 7fa3b9951af30c0109e64ee1eb0b153093a40e10
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sat May 14 16:31:17 2011 -0700

    dix: Fix compilation warnings
    
    cursor.c:155:6: warning: declaration shadows a local variable [-Wshadow,Semantic Issue]
            int n = bits->width * bits->height;
                ^
    cursor.c:146:9: note: previous declaration is here
        int n = BitmapBytePad(bits->width) * bits->height;
            ^
    1 warning generated.
    
    dispatch.c:1629:5: warning: declaration shadows a local variable [-Wshadow,Semantic Issue]
        VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, DixWriteAccess);
        ^
    In file included from dispatch.c:112:
    In file included from ../include/windowstr.h:52:
    In file included from ../include/pixmapstr.h:53:
    In file included from ../include/privates.h:145:
    ../include/dix.h:91:6: note: instantiated from:
            int rc = dixLookupDrawable(&(pDraw), drawID, client, M_ANY, mode);\
                ^
    dispatch.c:1625:9: note: previous declaration is here
        int rc;
            ^
    dispatch.c:1670:5: warning: declaration shadows a local variable [-Wshadow,Semantic Issue]
        VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, DixWriteAccess);
        ^
    In file included from dispatch.c:112:
    In file included from ../include/windowstr.h:52:
    In file included from ../include/pixmapstr.h:53:
    In file included from ../include/privates.h:145:
    ../include/dix.h:91:6: note: instantiated from:
            int rc = dixLookupDrawable(&(pDraw), drawID, client, M_ANY, mode);\
                ^
    dispatch.c:1666:9: note: previous declaration is here
        int rc;
            ^
    2 warnings generated.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/dix/cursor.c b/dix/cursor.c
index c191c1e..e967b01 100644
--- a/dix/cursor.c
+++ b/dix/cursor.c
@@ -152,7 +152,7 @@ CheckForEmptyMask(CursorBitsPtr bits)
     if (bits->argb)
     {
 	CARD32 *argb = bits->argb;
-	int n = bits->width * bits->height;
+	n = bits->width * bits->height;
 	while (n--)
 	    if (*argb++ & 0xff000000) return;
     }
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 192c8c3..ea67132 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -1622,14 +1622,13 @@ ProcCopyArea(ClientPtr client)
     GC *pGC;
     REQUEST(xCopyAreaReq);
     RegionPtr pRgn;
-    int rc;
 
     REQUEST_SIZE_MATCH(xCopyAreaReq);
 
     VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pDst, DixWriteAccess); 
     if (stuff->dstDrawable != stuff->srcDrawable)
     {
-	rc = dixLookupDrawable(&pSrc, stuff->srcDrawable, client, 0,
+	int rc = dixLookupDrawable(&pSrc, stuff->srcDrawable, client, 0,
 				 DixReadAccess);
 	if (rc != Success)
 	    return rc;
@@ -1663,14 +1662,13 @@ ProcCopyPlane(ClientPtr client)
     GC *pGC;
     REQUEST(xCopyPlaneReq);
     RegionPtr pRgn;
-    int rc;
 
     REQUEST_SIZE_MATCH(xCopyPlaneReq);
 
     VALIDATE_DRAWABLE_AND_GC(stuff->dstDrawable, pdstDraw, DixWriteAccess);
     if (stuff->dstDrawable != stuff->srcDrawable)
     {
-	rc = dixLookupDrawable(&psrcDraw, stuff->srcDrawable, client, 0,
+	int rc = dixLookupDrawable(&psrcDraw, stuff->srcDrawable, client, 0,
 			       DixReadAccess);
 	if (rc != Success)
 	    return rc;
commit 3f1e90889886e19bc5827c322d79e0077fad14ce
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sat May 14 16:29:09 2011 -0700

    input: Fix format string for verify_internal_event
    
    inpututils.c:577:25: warning: conversion specifies type 'unsigned short' but the argument has type 'unsigned char' [-Wformat,Format String Issue]
                ErrorF("%02hx ", *data);
                        ~~~~^    ~~~~~
                        %02hhx
    1 warning generated.
    
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/dix/inpututils.c b/dix/inpututils.c
index aeace6e..49e1758 100644
--- a/dix/inpututils.c
+++ b/dix/inpututils.c
@@ -574,7 +574,7 @@ void verify_internal_event(const InternalEvent *ev)
 
         for (i = 0; i < sizeof(xEvent); i++, data++)
         {
-            ErrorF("%02hx ", *data);
+            ErrorF("%02hhx ", *data);
 
             if ((i % 8) == 7)
                 ErrorF("\n");
commit 179defde384be48367dca809cda4aed51564e749
Author: Jeremy Huddleston <jeremyhu at apple.com>
Date:   Sat May 14 12:23:44 2011 -0700

    input: Don't implicitly define verify_internal_event
    
    Fixes regression introduced by 56901998020b6f443cbaa5eb303100d979e81b22
    
    mieq.c:159:5: error: implicit declaration of function 'verify_internal_event' is invalid in C99 [-Wimplicit-function-declaration,Semantic Issue]
        verify_internal_event(e);
        ^
    1 error generated.
    
    Also includes some other warning cleanups in events.c we're there.
    
    events.c:2198:24: warning: equality comparison with extraneous parentheses [-Wparentheses,Semantic Issue]
            else if ((type == MotionNotify))
                      ~~~~~^~~~~~~~~~~~~~~
    events.c:2198:24: note: remove extraneous parentheses around the comparison to silence this warning [Semantic Issue]
            else if ((type == MotionNotify))
                     ~     ^              ~
    events.c:2198:24: note: use '=' to turn this equality comparison into an assignment [Semantic Issue]
            else if ((type == MotionNotify))
                           ^~
                           =
    events.c:2487:5: error: implicit declaration of function 'verify_internal_event' is invalid in C99 [-Wimplicit-function-declaration,Semantic Issue]
        verify_internal_event(event);
        ^
    events.c:5909:22: warning: declaration shadows a local variable [-Wshadow,Semantic Issue]
            DeviceIntPtr it = inputInfo.devices;
                         ^
    events.c:5893:18: note: previous declaration is here
        DeviceIntPtr it = inputInfo.devices;
                     ^
    3 warnings and 1 error generated.
    
    events.c:2836:27: warning: incompatible pointer types passing 'DeviceEvent *' (aka 'struct _DeviceEvent *') to parameter of type
          'const InternalEvent *' (aka 'const union _InternalEvent *')
        verify_internal_event(ev);
                              ^~
    ../include/inpututils.h:40:56: note: passing argument to parameter 'ev' here
    extern void verify_internal_event(const InternalEvent *ev);
                                                           ^
    1 warning generated.
    
    Found-by: yuffie tinderbox (-Werror=implicit)
    Signed-off-by: Jeremy Huddleston <jeremyhu at apple.com>

diff --git a/dix/events.c b/dix/events.c
index 14f6f90..b60c299 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -112,6 +112,7 @@ Equipment Corporation.
 #include <X11/Xproto.h>
 #include "windowstr.h"
 #include "inputstr.h"
+#include "inpututils.h"
 #include "scrnintstr.h"
 #include "cursorstr.h"
 
@@ -2195,7 +2196,7 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
          */
         if (!grab && ActivateImplicitGrab(pDev, client, pWin, pEvents, deliveryMask))
             /* grab activated */;
-        else if ((type == MotionNotify))
+        else if (type == MotionNotify)
             pDev->valuator->motionHintWindow = pWin;
         else if (type == DeviceMotionNotify || type == DeviceButtonPress)
                 CheckDeviceGrabAndHintWindow (pWin, type,
@@ -2832,7 +2833,7 @@ CheckMotion(DeviceEvent *ev, DeviceIntPtr pDev)
     WindowPtr prevSpriteWin, newSpriteWin;
     SpritePtr pSprite = pDev->spriteInfo->sprite;
 
-    verify_internal_event(ev);
+    verify_internal_event((InternalEvent *)ev);
 
     prevSpriteWin = pSprite->win;
 
@@ -5906,7 +5907,7 @@ PickPointer(ClientPtr client)
 
     if (!client->clientPtr)
     {
-        DeviceIntPtr it = inputInfo.devices;
+        it = inputInfo.devices;
         while (it)
         {
             if (IsMaster(it) && it->spriteInfo->spriteOwner)
diff --git a/mi/mieq.c b/mi/mieq.c
index 031b11a..fc3738a 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -43,6 +43,7 @@ in this Software without prior written authorization from The Open Group.
 # include   "windowstr.h"
 # include   "pixmapstr.h"
 # include   "inputstr.h"
+# include   "inpututils.h"
 # include   "mi.h"
 # include   "mipointer.h"
 # include   "scrnintstr.h"


More information about the Xquartz-changes mailing list