xserver: Branch 'master' - 14 commits

Keith Packard keithp at kemper.freedesktop.org
Mon Nov 5 13:03:52 PST 2012


 Xext/panoramiX.c                           |    2 -
 Xext/shm.c                                 |   10 +++---
 Xext/xace.c                                |   12 +++----
 Xext/xf86bigfont.c                         |   12 -------
 Xext/xres.c                                |    2 -
 Xext/xtest.c                               |    2 -
 Xi/exevents.c                              |    2 -
 configure.ac                               |   14 ++++++++-
 dix/dixfonts.c                             |    9 +++++
 dix/events.c                               |   24 +++++++--------
 fb/fbblt.c                                 |   12 +++----
 fb/fbbltone.c                              |    8 ++---
 hw/xfree86/os-support/bus/nobus.c          |    2 -
 hw/xfree86/os-support/shared/agp_noop.c    |    2 -
 hw/xfree86/os-support/shared/ioperm_noop.c |    4 +-
 hw/xfree86/os-support/stub/stub_init.c     |    6 +--
 hw/xfree86/sdksyms.sh                      |    1 
 include/Makefile.am                        |    2 -
 include/dix-config.h.in                    |    3 +
 include/dix.h                              |   12 +++----
 include/dixfont.h                          |   39 -------------------------
 include/dixfontstubs.h                     |   45 +++++++++++++++++++++++++++++
 mi/mibitblt.c                              |    6 +--
 mi/mispans.c                               |    4 --
 os/xsha1.c                                 |   30 +++++++++++++++++++
 randr/randrstr.h                           |    8 +++++
 render/picturestr.h                        |    8 ++---
 xkb/ddxList.c                              |    2 -
 xkb/xkb.c                                  |   27 ++++++++---------
 xkb/xkbPrKeyEv.c                           |    4 +-
 xkb/xkbtext.c                              |    1 
 xkb/xkmread.c                              |    2 -
 xorg-server.m4                             |    6 +--
 33 files changed, 183 insertions(+), 140 deletions(-)

New commits:
commit 54ba26cb1f9c59559cc3c449abeb31b2ce23bdba
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Mon Oct 29 22:37:37 2012 -0500

    os: Add libnettle as a choice of SHA1 implementation
    
    libnettle is smaller than libgcrypt, currently being released more
    frequently, and has replaced the latter in gnutls-3.x (which is used
    by TigerVNC, so they can avoid pulling in two crypto libraries
    simultaneously).
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Julien Cristau <jcristau at debian.org>

diff --git a/configure.ac b/configure.ac
index 86153ec..38ac240 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1360,7 +1360,7 @@ CORE_INCS='-I$(top_srcdir)/include -I$(top_builddir)/include'
 
 # SHA1 hashing
 AC_ARG_WITH([sha1],
-            [AS_HELP_STRING([--with-sha1=libc|libmd|libgcrypt|libcrypto|libsha1|CommonCrypto|CryptoAPI],
+            [AS_HELP_STRING([--with-sha1=libc|libmd|libnettle|libgcrypt|libcrypto|libsha1|CommonCrypto|CryptoAPI],
                             [choose SHA1 implementation])])
 AC_CHECK_FUNC([SHA1Init], [HAVE_SHA1_IN_LIBC=yes])
 if test "x$with_sha1" = x && test "x$HAVE_SHA1_IN_LIBC" = xyes; then
@@ -1423,6 +1423,18 @@ if test "x$with_sha1" = xlibsha1; then
 	          [Use libsha1 for SHA1])
 	SHA1_LIBS=-lsha1
 fi
+AC_CHECK_LIB([nettle], [nettle_sha1_init], [HAVE_LIBNETTLE=yes])
+if test "x$with_sha1" = x && test "x$HAVE_LIBNETTLE" = xyes; then
+	with_sha1=libnettle
+fi
+if test "x$with_sha1" = xlibnettle && test "x$HAVE_LIBNETTLE" != xyes; then
+	AC_MSG_ERROR([libnettle requested but not found])
+fi
+if test "x$with_sha1" = xlibnettle; then
+	AC_DEFINE([HAVE_SHA1_IN_LIBNETTLE], [1],
+	          [Use libnettle SHA1 functions])
+	SHA1_LIBS=-lnettle
+fi
 AC_CHECK_LIB([gcrypt], [gcry_md_open], [HAVE_LIBGCRYPT=yes])
 if test "x$with_sha1" = x && test "x$HAVE_LIBGCRYPT" = xyes; then
 	with_sha1=libgcrypt
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index 578f249..b270a32 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -157,6 +157,9 @@
 /* Define to use libgcrypt SHA1 functions */
 #undef HAVE_SHA1_IN_LIBGCRYPT
 
+/* Define to use libnettle SHA1 functions */
+#undef HAVE_SHA1_IN_LIBNETTLE
+
 /* Define to use libsha1 for SHA1 */
 #undef HAVE_SHA1_IN_LIBSHA1
 
diff --git a/os/xsha1.c b/os/xsha1.c
index fa66c7a..24c0aa2 100644
--- a/os/xsha1.c
+++ b/os/xsha1.c
@@ -116,6 +116,36 @@ x_sha1_final(void *ctx, unsigned char result[20])
     return 1;
 }
 
+#elif defined(HAVE_SHA1_IN_LIBNETTLE)   /* Use libnettle for SHA1 */
+
+#include <nettle/sha.h>
+
+void *
+x_sha1_init(void)
+{
+    struct sha1_ctx *ctx = malloc(sizeof(*ctx));
+
+    if (!ctx)
+        return NULL;
+    sha1_init(ctx);
+    return ctx;
+}
+
+int
+x_sha1_update(void *ctx, void *data, int size)
+{
+    sha1_update(ctx, size, data);
+    return 1;
+}
+
+int
+x_sha1_final(void *ctx, unsigned char result[20])
+{
+    sha1_digest(ctx, 20, result);
+    free(ctx);
+    return 1;
+}
+
 #elif defined(HAVE_SHA1_IN_LIBGCRYPT)   /* Use libgcrypt for SHA1 */
 
 #include <gcrypt.h>
commit 2ff56033de2b493a11d2bdf411b7057b1b3a22d7
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Tue Oct 16 02:11:59 2012 -0500

    Xi: fix fprint format warning
    
    exevents.c: In function 'ProcessTouchEvent':
    exevents.c:1601:20: warning: too many arguments for format
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xi/exevents.c b/Xi/exevents.c
index 4cbeb37..eb8a3de 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1598,7 +1598,7 @@ ProcessTouchEvent(InternalEvent *ev, DeviceIntPtr dev)
         if (!ti) {
             DebugF("[Xi] %s: Failed to create new dix record for explicitly "
                    "grabbed touchpoint %d\n",
-                   dev->name, type, touchid);
+                   dev->name, touchid);
             return;
         }
 
commit d631dbe9b6a1faa4cd18ab7a4a0276db02b84b77
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Sat Oct 27 21:50:01 2012 -0500

    Xext: fix shadow warnings
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xext/shm.c b/Xext/shm.c
index 3fa04b9..5596090 100644
--- a/Xext/shm.c
+++ b/Xext/shm.c
@@ -135,11 +135,11 @@ static ShmFuncs fbFuncs = { fbShmCreatePixmap, NULL };
 
 #define VERIFY_SHMSEG(shmseg,shmdesc,client) \
 { \
-    int rc; \
-    rc = dixLookupResourceByType((pointer *)&(shmdesc), shmseg, ShmSegType, \
-                                 client, DixReadAccess); \
-    if (rc != Success) \
-	return rc; \
+    int tmprc; \
+    tmprc = dixLookupResourceByType((pointer *)&(shmdesc), shmseg, ShmSegType, \
+                                    client, DixReadAccess); \
+    if (tmprc != Success) \
+	return tmprc; \
 }
 
 #define VERIFY_SHMPTR(shmseg,offset,needwrite,shmdesc,client) \
diff --git a/Xext/xace.c b/Xext/xace.c
index b2e7dda..026d3c5 100644
--- a/Xext/xace.c
+++ b/Xext/xace.c
@@ -47,18 +47,18 @@ XaceHookDispatch(ClientPtr client, int major)
 
     if (major < 128) {
         /* Call the core dispatch hook */
-        XaceCoreDispatchRec rec = { client, Success /* default allow */  };
-        CallCallbacks(&XaceHooks[XACE_CORE_DISPATCH], &rec);
-        return rec.status;
+        XaceCoreDispatchRec drec = { client, Success /* default allow */  };
+        CallCallbacks(&XaceHooks[XACE_CORE_DISPATCH], &drec);
+        return drec.status;
     }
     else {
         /* Call the extension dispatch hook */
         ExtensionEntry *ext = GetExtensionEntry(major);
-        XaceExtAccessRec rec = { client, ext, DixUseAccess, Success };
+        XaceExtAccessRec erec = { client, ext, DixUseAccess, Success };
         if (ext)
-            CallCallbacks(&XaceHooks[XACE_EXT_DISPATCH], &rec);
+            CallCallbacks(&XaceHooks[XACE_EXT_DISPATCH], &erec);
         /* On error, pretend extension doesn't exist */
-        return (rec.status == Success) ? Success : BadRequest;
+        return (erec.status == Success) ? Success : BadRequest;
     }
 }
 
commit 20cf7918ed954a932a4cc404b3d0c4ca87a6ae16
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Tue Oct 16 21:08:52 2012 -0500

    Xext: fix redundant redeclaration warnings
    
    panoramiX.c:595:13: warning: redundant redeclaration of 'CreateConnectionBlock'
    ../include/dix.h:167:23: note: previous declaration of 'CreateConnectionBlock' was here
    xres.c:193:13: warning: redundant redeclaration of 'ResExtensionInit'
    ../include/extinit.h:109:13: note: previous declaration of 'ResExtensionInit'
    xtest.c:60:12: warning: redundant redeclaration of 'DeviceValuator'
    ../Xi/exglobals.h:61:12: note: previous declaration of 'DeviceValuator' was here
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xext/panoramiX.c b/Xext/panoramiX.c
index 1c7197d..be475f7 100644
--- a/Xext/panoramiX.c
+++ b/Xext/panoramiX.c
@@ -592,8 +592,6 @@ PanoramiXExtensionInit(void)
 
 }
 
-extern Bool CreateConnectionBlock(void);
-
 Bool
 PanoramiXCreateConnectionBlock(void)
 {
diff --git a/Xext/xres.c b/Xext/xres.c
index 7d21ad7..445abca 100644
--- a/Xext/xres.c
+++ b/Xext/xres.c
@@ -190,8 +190,6 @@ DestroyConstructResourceBytesCtx(ConstructResourceBytesCtx *ctx)
     ht_destroy(ctx->visitedResources);
 }
 
-extern void ResExtensionInit(void);
-
 static int
 ProcXResQueryVersion(ClientPtr client)
 {
diff --git a/Xext/xtest.c b/Xext/xtest.c
index c593372..2abdc7f 100644
--- a/Xext/xtest.c
+++ b/Xext/xtest.c
@@ -57,8 +57,6 @@
 
 #include "extinit.h"
 
-extern int DeviceValuator;
-
 /* XTest events are sent during request processing and may be interruped by
  * a SIGIO. We need a separate event list to avoid events overwriting each
  * other's memory */
commit 89447e1b50d2fb0e046102664045d1f9d4efc542
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Mon Oct 15 01:33:05 2012 -0500

    Xext: fix unused variable warnings in xf86bigfont.c
    
    These were rendered unused by commit 2c7c520cfe0df30f4bc3adba59d9c62582823bf8.
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/Xext/xf86bigfont.c b/Xext/xf86bigfont.c
index faf81f7..46b3242 100644
--- a/Xext/xf86bigfont.c
+++ b/Xext/xf86bigfont.c
@@ -296,8 +296,6 @@ ProcXF86BigfontQueryVersion(ClientPtr client)
 #endif
     };
     if (client->swapped) {
-        char tmp;
-
         swaps(&reply.sequenceNumber);
         swapl(&reply.length);
         swaps(&reply.majorVersion);
@@ -313,8 +311,6 @@ ProcXF86BigfontQueryVersion(ClientPtr client)
 static void
 swapCharInfo(xCharInfo * pCI)
 {
-    char tmp;
-
     swaps(&pCI->leftSideBearing);
     swaps(&pCI->rightSideBearing);
     swaps(&pCI->characterWidth);
@@ -585,8 +581,6 @@ ProcXF86BigfontQueryFont(ClientPtr client)
         reply->shmid = shmid;
         reply->shmsegoffset = 0;
         if (client->swapped) {
-            char tmp;
-
             swaps(&reply->sequenceNumber);
             swapl(&reply->length);
             swapCharInfo(&reply->minBounds);
@@ -613,8 +607,6 @@ ProcXF86BigfontQueryFont(ClientPtr client)
                 prFP->name = pFP->name;
                 prFP->value = pFP->value;
                 if (client->swapped) {
-                    char tmp;
-
                     swapl(&prFP->name);
                     swapl(&prFP->value);
                 }
@@ -636,8 +628,6 @@ ProcXF86BigfontQueryFont(ClientPtr client)
             for (j = 0; j < nCharInfos; j++, ps++) {
                 *ps = pIndex2UniqIndex[j];
                 if (client->swapped) {
-                    char tmp;
-
                     swaps(ps);
                 }
             }
@@ -673,7 +663,6 @@ static int
 SProcXF86BigfontQueryVersion(ClientPtr client)
 {
     REQUEST(xXF86BigfontQueryVersionReq);
-    char tmp;
 
     swaps(&stuff->length);
     return ProcXF86BigfontQueryVersion(client);
@@ -683,7 +672,6 @@ static int
 SProcXF86BigfontQueryFont(ClientPtr client)
 {
     REQUEST(xXF86BigfontQueryFontReq);
-    char tmp;
 
     swaps(&stuff->length);
     REQUEST_SIZE_MATCH(xXF86BigfontQueryFontReq);
commit 344eea237fc07dedfd733d14f95ed0ad26bb5f81
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Tue Oct 16 02:04:34 2012 -0500

    xkb: fix shadow warnings
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/xkb/ddxList.c b/xkb/ddxList.c
index 79f4637..729c5ae 100644
--- a/xkb/ddxList.c
+++ b/xkb/ddxList.c
@@ -131,8 +131,6 @@ XkbDDXListComponent(DeviceIntPtr dev,
     file = list->pattern[what];
     map = strrchr(file, '(');
     if (map != NULL) {
-        char *tmp;
-
         map++;
         tmp = strrchr(map, ')');
         if ((tmp == NULL) || (tmp[1] != '\0')) {
diff --git a/xkb/xkb.c b/xkb/xkb.c
index 4440a98..efb178c 100644
--- a/xkb/xkb.c
+++ b/xkb/xkb.c
@@ -57,10 +57,10 @@ static RESTYPE RT_XKBCLIENT;
 
 #define	CHK_DEVICE(dev, id, client, access_mode, lf) {\
     int why;\
-    int rc = lf(&(dev), id, client, access_mode, &why);\
-    if (rc != Success) {\
+    int tmprc = lf(&(dev), id, client, access_mode, &why);\
+    if (tmprc != Success) {\
 	client->errorValue = _XkbErrCode2(why, id);\
-	return rc;\
+	return tmprc;\
     }\
 }
 
@@ -1026,22 +1026,22 @@ XkbWriteKeyTypes(XkbDescPtr xkb,
 
         buf = (char *) &wire[1];
         if (wire->nMapEntries > 0) {
-            xkbKTMapEntryWireDesc *wire;
+            xkbKTMapEntryWireDesc *ewire;
             XkbKTMapEntryPtr entry;
 
-            wire = (xkbKTMapEntryWireDesc *) buf;
+            ewire = (xkbKTMapEntryWireDesc *) buf;
             entry = type->map;
-            for (n = 0; n < type->map_count; n++, wire++, entry++) {
-                wire->active = entry->active;
-                wire->mask = entry->mods.mask;
-                wire->level = entry->level;
-                wire->realMods = entry->mods.real_mods;
-                wire->virtualMods = entry->mods.vmods;
+            for (n = 0; n < type->map_count; n++, ewire++, entry++) {
+                ewire->active = entry->active;
+                ewire->mask = entry->mods.mask;
+                ewire->level = entry->level;
+                ewire->realMods = entry->mods.real_mods;
+                ewire->virtualMods = entry->mods.vmods;
                 if (client->swapped) {
-                    swaps(&wire->virtualMods);
+                    swaps(&ewire->virtualMods);
                 }
             }
-            buf = (char *) wire;
+            buf = (char *) ewire;
             if (type->preserve != NULL) {
                 xkbModsWireDesc *pwire;
                 XkbModsPtr preserve;
@@ -2903,7 +2903,6 @@ _XkbSetCompatMap(ClientPtr client, DeviceIntPtr dev,
     }
 
     if (req->groups != 0) {
-        unsigned i, bit;
         xkbModsWireDesc *wire = (xkbModsWireDesc *) data;
 
         for (i = 0, bit = 1; i < XkbNumKbdGroups; i++, bit <<= 1) {
diff --git a/xkb/xkbPrKeyEv.c b/xkb/xkbPrKeyEv.c
index 3241183..b24fd6c 100644
--- a/xkb/xkbPrKeyEv.c
+++ b/xkb/xkbPrKeyEv.c
@@ -104,13 +104,13 @@ XkbProcessKeyboardEvent(DeviceEvent *event, DeviceIntPtr keybd)
                     return;
                 }
                 if (rg->currentDown != 0) {
-                    int key = event->detail.key;
+                    int tmpkey = event->detail.key;
 
                     event->type = ET_KeyRelease;
                     event->detail.key = rg->currentDown;
                     XkbHandleActions(keybd, keybd, event);
                     event->type = ET_KeyPress;
-                    event->detail.key = key;
+                    event->detail.key = tmpkey;
                 }
                 rg->currentDown = key;
             }
diff --git a/xkb/xkbtext.c b/xkb/xkbtext.c
index f66a08f..fdf1d17 100644
--- a/xkb/xkbtext.c
+++ b/xkb/xkbtext.c
@@ -1266,7 +1266,6 @@ XkbBehaviorText(XkbDescPtr xkb, XkbBehavior * behavior, unsigned format)
         }
         else if (type == XkbKB_RadioGroup) {
             int g;
-            char *tmp;
 
             g = ((behavior->data) & (~XkbKB_RGAllowNone)) + 1;
             if (XkbKB_RGAllowNone & behavior->data) {
diff --git a/xkb/xkmread.c b/xkb/xkmread.c
index 45da965..258bb91 100644
--- a/xkb/xkmread.c
+++ b/xkb/xkmread.c
@@ -772,8 +772,6 @@ ReadXkmSymbols(FILE * file, XkbDescPtr xkb)
         memset((char *) typeName, 0, XkbNumKbdGroups * sizeof(Atom));
         memset((char *) type, 0, XkbNumKbdGroups * sizeof(XkbKeyTypePtr));
         if (wireMap.flags & XkmKeyHasTypes) {
-            register int g;
-
             for (g = 0; g < XkbNumKbdGroups; g++) {
                 if ((wireMap.flags & (1 << g)) &&
                     ((tmp = XkmGetCountedString(file, buf, 100)) > 0)) {
commit 7f1d74e8a906210eafc637df81ded62c3adff748
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Tue Oct 16 02:06:54 2012 -0500

    render: fix shadow warnings
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/render/picturestr.h b/render/picturestr.h
index dc00f41..5644f28 100644
--- a/render/picturestr.h
+++ b/render/picturestr.h
@@ -363,10 +363,10 @@ extern _X_EXPORT RESTYPE GlyphSetType;
 #define SetPictureWindow(w,p) dixSetPrivate(&(w)->devPrivates, PictureWindowPrivateKey, p)
 
 #define VERIFY_PICTURE(pPicture, pid, client, mode) {\
-    int rc = dixLookupResourceByType((pointer)&(pPicture), pid,\
-	                             PictureType, client, mode);\
-    if (rc != Success)\
-	return rc;\
+    int tmprc = dixLookupResourceByType((pointer)&(pPicture), pid,\
+	                                PictureType, client, mode);\
+    if (tmprc != Success)\
+	return tmprc;\
 }
 
 #define VERIFY_ALPHA(pPicture, pid, client, mode) {\
commit 8e86123998d26d26f0f60dcbb9836c38e5a4c3a5
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Tue Oct 16 01:19:12 2012 -0500

    randr: export more provider property symbols
    
    These were added as part of commit 66d92afeaeed9f4a19267d95a1f81b9bf27162a5
    but never declared or exported.  Fixes warnings:
    
    rrproviderproperty.c:255:1: warning: no previous prototype for 'RRPostProviderPendingProperties'
    rrproviderproperty.c:327:1: warning: no previous prototype for 'RRConfigureProviderProperty'
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Dave Airlie <airlied at redhat.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/randr/randrstr.h b/randr/randrstr.h
index 212b0a9..a16302f 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -933,6 +933,14 @@ RRChangeProviderProperty(RRProviderPtr provider, Atom property, Atom type,
                        pointer value, Bool sendevent, Bool pending);
 
 extern _X_EXPORT int
+ RRConfigureProviderProperty(RRProviderPtr provider, Atom property,
+                             Bool pending, Bool range, Bool immutable,
+                             int num_values, INT32 *values);
+
+extern _X_EXPORT Bool
+ RRPostProviderPendingProperties(RRProviderPtr provider);
+
+extern _X_EXPORT int
  ProcRRGetProviderProperty(ClientPtr client);
 
 extern _X_EXPORT int
commit f02e27e4fcc34413b2051e5a01edc92172fa8612
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Tue Oct 16 02:16:17 2012 -0500

    mi: fix shadow warnings
    
    mibitblt.c: In function 'miGetImage':
    mibitblt.c:617:20: warning: declaration of 'pt' shadows a previous local
    mibitblt.c:609:17: warning: shadowed declaration is here
    mispans.c: In function 'miFillUniqueSpanGroup':
    mispans.c:456:33: warning: declaration of 'i' shadows a previous local
    mispans.c:382:9: warning: shadowed declaration is here
    mispans.c:488:17: warning: declaration of 'i' shadows a previous local
    mispans.c:382:9: warning: shadowed declaration is here
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/mi/mibitblt.c b/mi/mibitblt.c
index b9873c1..b0d14ae 100644
--- a/mi/mibitblt.c
+++ b/mi/mibitblt.c
@@ -614,7 +614,7 @@ miGetImage(DrawablePtr pDraw, int sx, int sy, int w, int h,
     if (format == ZPixmap) {
         if ((((1LL << depth) - 1) & planeMask) != (1LL << depth) - 1) {
             ChangeGCVal gcv;
-            xPoint pt;
+            xPoint xpt;
 
             pGC = GetScratchGC(depth, pDraw->pScreen);
             if (!pGC)
@@ -629,9 +629,9 @@ miGetImage(DrawablePtr pDraw, int sx, int sy, int w, int h,
              * Clear the pixmap before doing anything else
              */
             ValidateGC((DrawablePtr) pPixmap, pGC);
-            pt.x = pt.y = 0;
+            xpt.x = xpt.y = 0;
             width = w;
-            (*pGC->ops->FillSpans) ((DrawablePtr) pPixmap, pGC, 1, &pt, &width,
+            (*pGC->ops->FillSpans) ((DrawablePtr) pPixmap, pGC, 1, &xpt, &width,
                                     TRUE);
 
             /* alu is already GXCopy */
diff --git a/mi/mispans.c b/mi/mispans.c
index 0f89880..11c8a43 100644
--- a/mi/mispans.c
+++ b/mi/mispans.c
@@ -453,8 +453,6 @@ miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup * spanGroup)
                             (int *) realloc(newspans->widths,
                                             ysizes[index] * sizeof(int));
                         if (!newpoints || !newwidths) {
-                            int i;
-
                             for (i = 0; i < ylength; i++) {
                                 free(yspans[i].points);
                                 free(yspans[i].widths);
@@ -485,8 +483,6 @@ miFillUniqueSpanGroup(DrawablePtr pDraw, GCPtr pGC, SpanGroup * spanGroup)
         points = malloc(count * sizeof(DDXPointRec));
         widths = malloc(count * sizeof(int));
         if (!points || !widths) {
-            int i;
-
             for (i = 0; i < ylength; i++) {
                 free(yspans[i].points);
                 free(yspans[i].widths);
commit 1fe30c00679bd36a6355b48b94b87564d528ff28
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Tue Oct 16 02:21:04 2012 -0500

    fb: fix shadow warnings
    
    fbblt.c: In function 'fbBlt':
    fbblt.c:76:16: warning: declaration of 'src' shadows a previous local
    fbblt.c:52:13: warning: shadowed declaration is here
    fbblt.c:77:16: warning: declaration of 'dst' shadows a previous local
    fbblt.c:52:19: warning: shadowed declaration is here
    fbbltone.c: In function 'fbBltPlane':
    fbbltone.c:742:13: warning: declaration of 'w' shadows a previous local
    fbbltone.c:725:9: warning: shadowed declaration is here
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/fb/fbblt.c b/fb/fbblt.c
index 17bd698..72a05f6 100644
--- a/fb/fbblt.c
+++ b/fb/fbblt.c
@@ -73,21 +73,21 @@ fbBlt(FbBits * srcLine,
     if (alu == GXcopy && pm == FB_ALLONES && !careful &&
         !(srcX & 7) && !(dstX & 7) && !(width & 7)) {
         int i;
-        CARD8 *src = (CARD8 *) srcLine;
-        CARD8 *dst = (CARD8 *) dstLine;
+        CARD8 *tmpsrc = (CARD8 *) srcLine;
+        CARD8 *tmpdst = (CARD8 *) dstLine;
 
         srcStride *= sizeof(FbBits);
         dstStride *= sizeof(FbBits);
         width >>= 3;
-        src += (srcX >> 3);
-        dst += (dstX >> 3);
+        tmpsrc += (srcX >> 3);
+        tmpdst += (dstX >> 3);
 
         if (!upsidedown)
             for (i = 0; i < height; i++)
-                MEMCPY_WRAPPED(dst + i * dstStride, src + i * srcStride, width);
+                MEMCPY_WRAPPED(tmpdst + i * dstStride, tmpsrc + i * srcStride, width);
         else
             for (i = height - 1; i >= 0; i--)
-                MEMCPY_WRAPPED(dst + i * dstStride, src + i * srcStride, width);
+                MEMCPY_WRAPPED(tmpdst + i * dstStride, tmpsrc + i * srcStride, width);
 
         return;
     }
diff --git a/fb/fbbltone.c b/fb/fbbltone.c
index eb7cf94..bfcb5a2 100644
--- a/fb/fbbltone.c
+++ b/fb/fbbltone.c
@@ -739,12 +739,12 @@ fbBltPlane(FbBits * src,
 
     pm = fbReplicatePixel(planeMask, srcBpp);
     if (srcBpp == 24) {
-        int w = 24;
+        int tmpw = 24;
 
         rot0 = FbFirst24Rot(srcX);
-        if (srcX + w > FB_UNIT)
-            w = FB_UNIT - srcX;
-        srcMaskFirst = FbRot24(pm, rot0) & FbBitsMask(srcX, w);
+        if (srcX + tmpw > FB_UNIT)
+            tmpw = FB_UNIT - srcX;
+        srcMaskFirst = FbRot24(pm, rot0) & FbBitsMask(srcX, tmpw);
     }
     else {
         rot0 = 0;
commit e8d45f301845f70b76407577b92363934ca4f19e
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Tue Oct 16 20:54:56 2012 -0500

    dix: fix shadow warnings
    
    dispatch.c: In function 'ProcCopyArea':
    dispatch.c:1608:5: warning: declaration of 'rc' shadows a previous local
    dispatch.c:1604:9: warning: shadowed declaration is here
    dispatch.c: In function 'ProcCopyPlane':
    dispatch.c:1647:5: warning: declaration of 'rc' shadows a previous local
    dispatch.c:1643:9: warning: shadowed declaration is here
    events.c: In function 'GetClientsForDelivery':
    events.c:2030:68: warning: declaration of 'clients' shadows a global declaration
    ../include/dix.h:124:28: warning: shadowed declaration is here
    events.c: In function 'DeliverEventToWindowMask':
    events.c:2113:19: warning: declaration of 'clients' shadows a global declaration
    ../include/dix.h:124:28: warning: shadowed declaration is here
    events.c: In function 'EventSuppressForWindow':
    events.c:4420:12: warning: declaration of 'free' shadows a global declaration
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/events.c b/dix/events.c
index ddb5b34..e790bfc 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -2027,19 +2027,19 @@ DeliverToWindowOwner(DeviceIntPtr dev, WindowPtr win,
  */
 static Bool
 GetClientsForDelivery(DeviceIntPtr dev, WindowPtr win,
-                      xEvent *events, Mask filter, InputClients ** clients)
+                      xEvent *events, Mask filter, InputClients ** iclients)
 {
     int rc = 0;
 
     if (core_get_type(events) != 0)
-        *clients = (InputClients *) wOtherClients(win);
+        *iclients = (InputClients *) wOtherClients(win);
     else if (xi2_get_type(events) != 0) {
         OtherInputMasks *inputMasks = wOtherInputMasks(win);
 
         /* Has any client selected for the event? */
         if (!WindowXI2MaskIsset(dev, win, events))
             goto out;
-        *clients = inputMasks->inputClients;
+        *iclients = inputMasks->inputClients;
     }
     else {
         OtherInputMasks *inputMasks = wOtherInputMasks(win);
@@ -2048,7 +2048,7 @@ GetClientsForDelivery(DeviceIntPtr dev, WindowPtr win,
         if (!inputMasks || !(inputMasks->inputEvents[dev->id] & filter))
             goto out;
 
-        *clients = inputMasks->inputClients;
+        *iclients = inputMasks->inputClients;
     }
 
     rc = 1;
@@ -2110,12 +2110,12 @@ DeliverEventToWindowMask(DeviceIntPtr dev, WindowPtr win, xEvent *events,
                          int count, Mask filter, GrabPtr grab,
                          ClientPtr *client_return, Mask *mask_return)
 {
-    InputClients *clients;
+    InputClients *iclients;
 
-    if (!GetClientsForDelivery(dev, win, events, filter, &clients))
+    if (!GetClientsForDelivery(dev, win, events, filter, &iclients))
         return EVENT_SKIP;
 
-    return DeliverEventToInputClients(dev, clients, win, events, count, filter,
+    return DeliverEventToInputClients(dev, iclients, win, events, count, filter,
                                       grab, client_return, mask_return);
 
 }
@@ -4417,7 +4417,7 @@ int
 EventSuppressForWindow(WindowPtr pWin, ClientPtr client,
                        Mask mask, Bool *checkOptional)
 {
-    int i, free;
+    int i, freed;
 
     if (mask & ~PropagateMask) {
         client->errorValue = mask;
@@ -4428,14 +4428,14 @@ EventSuppressForWindow(WindowPtr pWin, ClientPtr client,
     if (!mask)
         i = 0;
     else {
-        for (i = DNPMCOUNT, free = 0; --i > 0;) {
+        for (i = DNPMCOUNT, freed = 0; --i > 0;) {
             if (!DontPropagateRefCnts[i])
-                free = i;
+                freed = i;
             else if (mask == DontPropagateMasks[i])
                 break;
         }
-        if (!i && free) {
-            i = free;
+        if (!i && freed) {
+            i = freed;
             DontPropagateMasks[i] = mask;
         }
     }
diff --git a/include/dix.h b/include/dix.h
index 74123b5..171e56e 100644
--- a/include/dix.h
+++ b/include/dix.h
@@ -88,12 +88,12 @@ SOFTWARE.
 
 #define VALIDATE_DRAWABLE_AND_GC(drawID, pDraw, mode)\
     {\
-	int rc = dixLookupDrawable(&(pDraw), drawID, client, M_ANY, mode);\
-	if (rc != Success)\
-	    return rc;\
-	rc = dixLookupGC(&(pGC), stuff->gc, client, DixUseAccess);\
-	if (rc != Success)\
-	    return rc;\
+	int tmprc = dixLookupDrawable(&(pDraw), drawID, client, M_ANY, mode);\
+	if (tmprc != Success)\
+	    return tmprc;\
+	tmprc = dixLookupGC(&(pGC), stuff->gc, client, DixUseAccess);\
+	if (tmprc != Success)\
+	    return tmprc;\
 	if ((pGC->depth != pDraw->depth) || (pGC->pScreen != pDraw->pScreen))\
 	    return BadMatch;\
     }\
commit 1aa783754e21a263b0973516850656b13fd18f0d
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Tue Oct 16 14:06:30 2012 -0500

    dix: fix redundant redeclaration warnings in dixfont
    
    These functions are already declared in <X11/fonts/fontproto.h>.
    Redeclaring them just for _X_EXPORT causes tons of warnings throughout
    xserver, but they need to be declared somewhere to be picked up by
    sdksyms.sh.  Doing so in a private header limits the warnings to
    sdksyms.c; fixing those as well would require changes to fontsproto.
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/dix/dixfonts.c b/dix/dixfonts.c
index ad21860..feb765d 100644
--- a/dix/dixfonts.c
+++ b/dix/dixfonts.c
@@ -1823,12 +1823,14 @@ InitFonts(void)
     register_fpe_functions();
 }
 
+_X_EXPORT
 int
 GetDefaultPointSize(void)
 {
     return 120;
 }
 
+_X_EXPORT
 FontResolutionPtr
 GetClientResolutions(int *num)
 {
@@ -1861,6 +1863,7 @@ GetClientResolutions(int *num)
  * should be called (only once!) by each type of fpe when initialized
  */
 
+_X_EXPORT
 int
 RegisterFPEFunctions(NameCheckFunc name_func,
                      InitFpeFunc init_func,
@@ -1932,24 +1935,28 @@ find_old_font(XID id)
     return (FontPtr) pFont;
 }
 
+_X_EXPORT
 Font
 GetNewFontClientID(void)
 {
     return FakeClientID(0);
 }
 
+_X_EXPORT
 int
 StoreFontClientFont(FontPtr pfont, Font id)
 {
     return AddResource(id, RT_NONE, (pointer) pfont);
 }
 
+_X_EXPORT
 void
 DeleteFontClientID(Font id)
 {
     FreeResource(id, RT_NONE);
 }
 
+_X_EXPORT
 int
 client_auth_generation(ClientPtr client)
 {
@@ -1959,6 +1966,7 @@ client_auth_generation(ClientPtr client)
 static int fs_handlers_installed = 0;
 static unsigned int last_server_gen;
 
+_X_EXPORT
 int
 init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler)
 {
@@ -1977,6 +1985,7 @@ init_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler)
     return Successful;
 }
 
+_X_EXPORT
 void
 remove_fs_handlers(FontPathElementPtr fpe, BlockHandlerProcPtr block_handler,
                    Bool all)
diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh
index fa19893..48b48b5 100755
--- a/hw/xfree86/sdksyms.sh
+++ b/hw/xfree86/sdksyms.sh
@@ -259,6 +259,7 @@ cat > sdksyms.c << EOF
 #include "dixevents.h"
 #include "dixfont.h"
 #include "dixfontstr.h"
+#include "dixfontstubs.h"
 #include "dixgrabs.h"
 #include "dixstruct.h"
 #include "exevents.h"
diff --git a/include/Makefile.am b/include/Makefile.am
index 33116f2..5cdea1d 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -69,6 +69,6 @@ AM_CFLAGS = $(DIX_CFLAGS)
 
 EXTRA_DIST = 	\
 	dix-config-apple-verbatim.h \
-	eventconvert.h eventstr.h inpututils.h \
+	dixfontstubs.h eventconvert.h eventstr.h inpututils.h \
 	protocol-versions.h \
 	xsha1.h
diff --git a/include/dixfont.h b/include/dixfont.h
index 3d09eb5..0a5f105 100644
--- a/include/dixfont.h
+++ b/include/dixfont.h
@@ -28,6 +28,7 @@ SOFTWARE.
 #include <X11/fonts/font.h>
 #include "closure.h"
 #include <X11/fonts/fontstruct.h>
+#include <X11/fonts/fontproto.h>
 
 #define NullDIXFontProp ((DIXFontPropPtr)0)
 
@@ -143,42 +144,4 @@ extern _X_EXPORT void SetGlyphCachingMode(int /*newmode */ );
 
 extern _X_EXPORT void register_fpe_functions(void);
 
-/*
- * libXfont stubs.
- */
-extern _X_EXPORT int client_auth_generation(ClientPtr client);
-
-extern _X_EXPORT void DeleteFontClientID(Font id);
-
-extern _X_EXPORT FontResolutionPtr GetClientResolutions(int *num);
-
-extern _X_EXPORT int GetDefaultPointSize(void);
-
-extern _X_EXPORT Font GetNewFontClientID(void);
-
-extern _X_EXPORT int init_fs_handlers(FontPathElementPtr fpe,
-                                      BlockHandlerProcPtr block_handler);
-
-extern _X_EXPORT int RegisterFPEFunctions(NameCheckFunc name_func,
-                                          InitFpeFunc init_func,
-                                          FreeFpeFunc free_func,
-                                          ResetFpeFunc reset_func,
-                                          OpenFontFunc open_func,
-                                          CloseFontFunc close_func,
-                                          ListFontsFunc list_func,
-                                          StartLfwiFunc start_lfwi_func,
-                                          NextLfwiFunc next_lfwi_func,
-                                          WakeupFpeFunc wakeup_func,
-                                          ClientDiedFunc client_died,
-                                          LoadGlyphsFunc load_glyphs,
-                                          StartLaFunc start_list_alias_func,
-                                          NextLaFunc next_list_alias_func,
-                                          SetPathFunc set_path_func);
-
-extern _X_EXPORT void remove_fs_handlers(FontPathElementPtr fpe,
-                                         BlockHandlerProcPtr blockHandler,
-                                         Bool all);
-
-extern _X_EXPORT int StoreFontClientFont(FontPtr pfont, Font id);
-
 #endif                          /* DIXFONT_H */
diff --git a/include/dixfontstubs.h b/include/dixfontstubs.h
new file mode 100644
index 0000000..0454ffa
--- /dev/null
+++ b/include/dixfontstubs.h
@@ -0,0 +1,45 @@
+#ifndef DIXFONTSTUBS_H
+#define DIXFONTSTUBS_H 1
+
+/*
+ * libXfont stubs replacements
+ * This header exists solely for the purpose of sdksyms generation;
+ * source code should #include "dixfonts.h" instead, which pulls in these
+ * declarations from <X11/fonts/fontproto.h>
+ */
+extern _X_EXPORT int client_auth_generation(ClientPtr client);
+
+extern _X_EXPORT void DeleteFontClientID(Font id);
+
+extern _X_EXPORT FontResolutionPtr GetClientResolutions(int *num);
+
+extern _X_EXPORT int GetDefaultPointSize(void);
+
+extern _X_EXPORT Font GetNewFontClientID(void);
+
+extern _X_EXPORT int init_fs_handlers(FontPathElementPtr fpe,
+                                      BlockHandlerProcPtr block_handler);
+
+extern _X_EXPORT int RegisterFPEFunctions(NameCheckFunc name_func,
+                                          InitFpeFunc init_func,
+                                          FreeFpeFunc free_func,
+                                          ResetFpeFunc reset_func,
+                                          OpenFontFunc open_func,
+                                          CloseFontFunc close_func,
+                                          ListFontsFunc list_func,
+                                          StartLfwiFunc start_lfwi_func,
+                                          NextLfwiFunc next_lfwi_func,
+                                          WakeupFpeFunc wakeup_func,
+                                          ClientDiedFunc client_died,
+                                          LoadGlyphsFunc load_glyphs,
+                                          StartLaFunc start_list_alias_func,
+                                          NextLaFunc next_list_alias_func,
+                                          SetPathFunc set_path_func);
+
+extern _X_EXPORT void remove_fs_handlers(FontPathElementPtr fpe,
+                                         BlockHandlerProcPtr blockHandler,
+                                         Bool all);
+
+extern _X_EXPORT int StoreFontClientFont(FontPtr pfont, Font id);
+
+#endif
commit 27c5966de35d4726dd9795b4828d4236851f6a88
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Mon Oct 15 01:25:17 2012 -0500

    xfree86: os-support: fix old-style function definition warnings
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/hw/xfree86/os-support/bus/nobus.c b/hw/xfree86/os-support/bus/nobus.c
index dca58fe..dc36ecd 100644
--- a/hw/xfree86/os-support/bus/nobus.c
+++ b/hw/xfree86/os-support/bus/nobus.c
@@ -1,5 +1,5 @@
 static void
-__noop_to_appease_ar__()
+__noop_to_appease_ar__(void)
 {
     return;
 }
diff --git a/hw/xfree86/os-support/shared/agp_noop.c b/hw/xfree86/os-support/shared/agp_noop.c
index 9c6ed4b..da486c0 100644
--- a/hw/xfree86/os-support/shared/agp_noop.c
+++ b/hw/xfree86/os-support/shared/agp_noop.c
@@ -47,7 +47,7 @@ xf86GARTCloseScreen(int screenNum)
 }
 
 Bool
-xf86AgpGARTSupported()
+xf86AgpGARTSupported(void)
 {
     return FALSE;
 }
diff --git a/hw/xfree86/os-support/shared/ioperm_noop.c b/hw/xfree86/os-support/shared/ioperm_noop.c
index 30688c0..eeacee9 100644
--- a/hw/xfree86/os-support/shared/ioperm_noop.c
+++ b/hw/xfree86/os-support/shared/ioperm_noop.c
@@ -36,13 +36,13 @@
 #include "xf86_OSlib.h"
 
 Bool
-xf86EnableIO()
+xf86EnableIO(void)
 {
     return TRUE;
 }
 
 void
-xf86DisableIO()
+xf86DisableIO(void)
 {
     return;
 }
diff --git a/hw/xfree86/os-support/stub/stub_init.c b/hw/xfree86/os-support/stub/stub_init.c
index 629675d..d3e0c3f 100644
--- a/hw/xfree86/os-support/stub/stub_init.c
+++ b/hw/xfree86/os-support/stub/stub_init.c
@@ -5,12 +5,12 @@
 #include "xf86_OSlib.h"
 
 void
-xf86OpenConsole()
+xf86OpenConsole(void)
 {
 }
 
 void
-xf86CloseConsole()
+xf86CloseConsole(void)
 {
 }
 
@@ -21,6 +21,6 @@ xf86ProcessArgument(int argc, char *argv[], int i)
 }
 
 void
-xf86UseMsg()
+xf86UseMsg(void)
 {
 }
commit 64b961bb21369aaea694d883f361a36bc23b19b9
Author: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
Date:   Wed Oct 24 23:57:11 2012 -0500

    macros: clarify documentation
    
    Signed-off-by: Yaakov Selkowitz <yselkowitz at users.sourceforge.net>
    Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

diff --git a/xorg-server.m4 b/xorg-server.m4
index bdecf62..18255b9 100644
--- a/xorg-server.m4
+++ b/xorg-server.m4
@@ -23,10 +23,10 @@ dnl other dealings in this Software without prior written authorization
 dnl from the copyright holders.
 dnl 
 
-# XORG_DRIVER_CHECK_EXT()
+# XORG_DRIVER_CHECK_EXT(MACRO, PROTO)
 # --------------------------
-# Checks for the $1 define in xorg-server.h (from the sdk).  If it
-# is defined, then add $1 to $REQUIRED_MODULES.
+# Checks for the MACRO define in xorg-server.h (from the sdk).  If it
+# is defined, then add the given PROTO to $REQUIRED_MODULES.
 
 AC_DEFUN([XORG_DRIVER_CHECK_EXT],[
 	AC_REQUIRE([PKG_PROG_PKG_CONFIG])


More information about the xorg-commit mailing list