Module Name: xsrc
Committed By: mrg
Date: Wed Jul 22 02:23:01 UTC 2015
Modified Files:
xsrc/external/mit/libXext/dist/src: XSync.c Xge.c
xsrc/external/mit/libXi/dist/src: XIPassiveGrab.c
xsrc/external/mit/libXinerama/dist/src: Xinerama.c
xsrc/external/mit/libpthread-stubs/include: config.h
Removed Files:
xsrc/external/mit/libXext/dist/src: eat.h
Log Message:
merge libXext 1.3.3, libXi 1.7.4, libXinerama 1.1.3 and libpthread-stubs 0.3.
To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/libXext/dist/src/XSync.c
cvs rdiff -u -r1.5 -r1.6 xsrc/external/mit/libXext/dist/src/Xge.c
cvs rdiff -u -r1.1.1.1 -r0 xsrc/external/mit/libXext/dist/src/eat.h
cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/libXi/dist/src/XIPassiveGrab.c
cvs rdiff -u -r1.3 -r1.4 xsrc/external/mit/libXinerama/dist/src/Xinerama.c
cvs rdiff -u -r1.1 -r1.2 xsrc/external/mit/libpthread-stubs/include/config.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: xsrc/external/mit/libXext/dist/src/XSync.c
diff -u xsrc/external/mit/libXext/dist/src/XSync.c:1.3 xsrc/external/mit/libXext/dist/src/XSync.c:1.4
--- xsrc/external/mit/libXext/dist/src/XSync.c:1.3 Sat Jun 1 07:45:50 2013
+++ xsrc/external/mit/libXext/dist/src/XSync.c Wed Jul 22 02:23:01 2015
@@ -60,7 +60,6 @@ PERFORMANCE OF THIS SOFTWARE.
#include <X11/extensions/sync.h>
#include <X11/extensions/syncproto.h>
#include <limits.h>
-#include "eat.h"
static XExtensionInfo _sync_info_data;
static XExtensionInfo *sync_info = &_sync_info_data;
@@ -189,7 +188,7 @@ char *error_string(Display *dpy, int cod
code -= codes->first_error;
if (code >= 0 && code < nerr) {
char tmp[256];
- sprintf (tmp, "%s.%d", sync_extension_name, code);
+ snprintf (tmp, sizeof(tmp), "%s.%d", sync_extension_name, code);
XGetErrorDatabaseText (dpy, "XProtoError", tmp, sync_error_list[code], buf, n);
return buf;
}
Index: xsrc/external/mit/libXext/dist/src/Xge.c
diff -u xsrc/external/mit/libXext/dist/src/Xge.c:1.5 xsrc/external/mit/libXext/dist/src/Xge.c:1.6
--- xsrc/external/mit/libXext/dist/src/Xge.c:1.5 Sat Jun 1 07:45:50 2013
+++ xsrc/external/mit/libXext/dist/src/Xge.c Wed Jul 22 02:23:01 2015
@@ -108,15 +108,21 @@ static XExtDisplayInfo *_xgeFindDisplay(
&xge_extension_hooks,
0 /* no events, see below */,
NULL);
- /* We don't use an extension opcode, so we have to set the handlers
- * directly. If GenericEvent would be > 64, the job would be done by
- * XExtAddDisplay */
- XESetWireToEvent (dpy,
- GenericEvent,
- xge_extension_hooks.wire_to_event);
- XESetEventToWire (dpy,
- GenericEvent,
- xge_extension_hooks.event_to_wire);
+ /* dpyinfo->codes is only null if the server claims not to suppport
+ XGE. Don't set up the hooks then, so that an XGE event from the
+ server doesn't crash our client */
+ if (dpyinfo && dpyinfo->codes)
+ {
+ /* We don't use an extension opcode, so we have to set the handlers
+ * directly. If GenericEvent would be > 64, the job would be done by
+ * XExtAddDisplay */
+ XESetWireToEvent (dpy,
+ GenericEvent,
+ xge_extension_hooks.wire_to_event);
+ XESetEventToWire (dpy,
+ GenericEvent,
+ xge_extension_hooks.event_to_wire);
+ }
}
return dpyinfo;
}
@@ -238,7 +244,7 @@ _xgeWireToEvent(Display* dpy, XEvent* re
int extension;
XGEExtList it;
XExtDisplayInfo* info = _xgeFindDisplay(dpy);
- if (!info)
+ if (!info || !info->data)
return False;
/*
_xgeCheckExtInit() calls LockDisplay, leading to a SIGABRT.
@@ -259,9 +265,6 @@ _xgeWireToEvent(Display* dpy, XEvent* re
it = it->next;
}
- fprintf(stderr,
- "_xgeWireToEvent: Unknown extension %d, this should never happen.\n",
- extension);
return False;
}
@@ -274,7 +277,7 @@ _xgeEventToWire(Display* dpy, XEvent* re
int extension;
XGEExtList it;
XExtDisplayInfo* info = _xgeFindDisplay(dpy);
- if (!info)
+ if (!info || !info->data)
return 1; /* error! */
extension = ((XGenericEvent*)re)->extension;
@@ -289,10 +292,6 @@ _xgeEventToWire(Display* dpy, XEvent* re
it = it->next;
}
- fprintf(stderr,
- "_xgeEventToWire: Unknown extension %d, this should never happen.\n",
- extension);
-
return Success;
}
Index: xsrc/external/mit/libXi/dist/src/XIPassiveGrab.c
diff -u xsrc/external/mit/libXi/dist/src/XIPassiveGrab.c:1.4 xsrc/external/mit/libXi/dist/src/XIPassiveGrab.c:1.5
--- xsrc/external/mit/libXi/dist/src/XIPassiveGrab.c:1.4 Fri Jul 11 18:31:47 2014
+++ xsrc/external/mit/libXi/dist/src/XIPassiveGrab.c Wed Jul 22 02:23:01 2015
@@ -249,6 +249,7 @@ XIUngrabTouchBegin(Display* display, int
LockDisplay(display);
if (_XiCheckExtInit(display, XInput_2_2, extinfo) == -1)
return -1;
+ UnlockDisplay(display);
return _XIPassiveUngrabDevice(display, deviceid, XIGrabtypeTouchBegin, 0,
grab_window, num_modifiers, modifiers);
Index: xsrc/external/mit/libXinerama/dist/src/Xinerama.c
diff -u xsrc/external/mit/libXinerama/dist/src/Xinerama.c:1.3 xsrc/external/mit/libXinerama/dist/src/Xinerama.c:1.4
--- xsrc/external/mit/libXinerama/dist/src/Xinerama.c:1.3 Mon Jun 3 04:37:59 2013
+++ xsrc/external/mit/libXinerama/dist/src/Xinerama.c Wed Jul 22 02:23:01 2015
@@ -23,6 +23,10 @@ dealings in this Software without prior
Equipment Corporation.
******************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
#include <X11/Xlibint.h>
#include <X11/Xutil.h>
#include <X11/extensions/Xext.h>
@@ -31,6 +35,19 @@ Equipment Corporation.
#include <X11/extensions/panoramiXproto.h>
#include <X11/extensions/Xinerama.h>
+#ifndef HAVE__XEATDATAWORDS
+#include <X11/Xmd.h> /* for LONG64 on 64-bit platforms */
+#include <limits.h>
+
+static inline void _XEatDataWords(Display *dpy, unsigned long n)
+{
+# ifndef LONG64
+ if (n >= (ULONG_MAX >> 2))
+ _XIOError(dpy);
+# endif
+ _XEatData (dpy, n << 2);
+}
+#endif
static XExtensionInfo _panoramiX_ext_info_data;
static XExtensionInfo *panoramiX_ext_info = &_panoramiX_ext_info_data;
@@ -286,24 +303,36 @@ XineramaQueryScreens(
return NULL;
}
- if(rep.number) {
- if((scrnInfo = Xmalloc(sizeof(XineramaScreenInfo) * rep.number))) {
+ /*
+ * rep.number is a CARD32 so could be as large as 2^32
+ * The X11 protocol limits the total screen size to 64k x 64k,
+ * and no screen can be smaller than a pixel. While technically
+ * that means we could theoretically reach 2^32 screens, and that's
+ * not even taking overlap into account, Xorg is currently limited
+ * to 16 screens, and few known servers have a much higher limit,
+ * so 1024 seems more than enough to prevent both integer overflow
+ * and insane X server responses causing massive memory allocation.
+ */
+ if ((rep.number > 0) && (rep.number <= 1024))
+ scrnInfo = Xmalloc(sizeof(XineramaScreenInfo) * rep.number);
+ if (scrnInfo != NULL) {
+ int i;
+
+ for (i = 0; i < rep.number; i++) {
xXineramaScreenInfo scratch;
- int i;
- for(i = 0; i < rep.number; i++) {
- _XRead(dpy, (char*)(&scratch), sz_XineramaScreenInfo);
- scrnInfo[i].screen_number = i;
- scrnInfo[i].x_org = scratch.x_org;
- scrnInfo[i].y_org = scratch.y_org;
- scrnInfo[i].width = scratch.width;
- scrnInfo[i].height = scratch.height;
- }
-
- *number = rep.number;
- } else
- _XEatData(dpy, rep.length << 2);
+ _XRead(dpy, (char*)(&scratch), sz_XineramaScreenInfo);
+
+ scrnInfo[i].screen_number = i;
+ scrnInfo[i].x_org = scratch.x_org;
+ scrnInfo[i].y_org = scratch.y_org;
+ scrnInfo[i].width = scratch.width;
+ scrnInfo[i].height = scratch.height;
+ }
+
+ *number = rep.number;
} else {
+ _XEatDataWords(dpy, rep.length);
*number = 0;
}
Index: xsrc/external/mit/libpthread-stubs/include/config.h
diff -u xsrc/external/mit/libpthread-stubs/include/config.h:1.1 xsrc/external/mit/libpthread-stubs/include/config.h:1.2
--- xsrc/external/mit/libpthread-stubs/include/config.h:1.1 Mon Mar 17 07:10:53 2014
+++ xsrc/external/mit/libpthread-stubs/include/config.h Wed Jul 22 02:23:01 2015
@@ -10,6 +10,12 @@
/* Define to 1 if you have the <memory.h> header file. */
#define HAVE_MEMORY_H 1
+/* Define to 1 if you have the `pthread_condattr_destroy' function. */
+#define HAVE_PTHREAD_CONDATTR_DESTROY 1
+
+/* Define to 1 if you have the `pthread_condattr_init' function. */
+#define HAVE_PTHREAD_CONDATTR_INI 1
+
/* Define to 1 if you have the `pthread_cond_broadcast' function. */
#define HAVE_PTHREAD_COND_BROADCAST 1
@@ -22,12 +28,18 @@
/* Define to 1 if you have the `pthread_cond_signal' function. */
#define HAVE_PTHREAD_COND_SIGNAL 1
+/* Define to 1 if you have the `pthread_cond_timedwait' function. */
+#define HAVE_PTHREAD_COND_TIMEDWAIT 1
+
/* Define to 1 if you have the `pthread_cond_wait' function. */
#define HAVE_PTHREAD_COND_WAIT 1
/* Define to 1 if you have the `pthread_equal' function. */
#define HAVE_PTHREAD_EQUAL 1
+/* Define to 1 if you have the `pthread_exit' function. */
+#define HAVE_PTHREAD_EXIT 1
+
/* Define to 1 if you have the `pthread_mutex_destroy' function. */
#define HAVE_PTHREAD_MUTEX_DESTROY 1
@@ -64,6 +76,10 @@
/* Define to 1 if you have the <unistd.h> header file. */
#define HAVE_UNISTD_H 1
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LT_OBJDIR
+
/* Name of package */
#define PACKAGE "libpthread-stubs"
@@ -74,13 +90,16 @@
#define PACKAGE_NAME "libpthread-stubs"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "libpthread-stubs 0.1"
+#define PACKAGE_STRING "libpthread-stubs 0.3"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "libpthread-stubs"
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
/* Define to the version of this package. */
-#define PACKAGE_VERSION "0.1"
+#define PACKAGE_VERSION "0.3"
/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1
@@ -89,4 +108,4 @@
#define SUPPORT_ATTRIBUTE_ALIAS 1
/* Version number of package */
-#define VERSION "0.1"
+#define VERSION "0.3"