Module Name: xsrc Committed By: mrg Date: Sat Mar 4 21:48:03 UTC 2017
Modified Files: xsrc/external/mit/libXi/dist: INSTALL xsrc/external/mit/libXi/dist/src: XIQueryDevice.c XListDev.c xsrc/external/mit/libXpm/dist/src: create.c Log Message: merge libXi 1.7.9 and libXpm 3.5.12: merge a local patch. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 xsrc/external/mit/libXi/dist/INSTALL cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/libXi/dist/src/XIQueryDevice.c cvs rdiff -u -r1.4 -r1.5 xsrc/external/mit/libXi/dist/src/XListDev.c cvs rdiff -u -r1.2 -r1.3 xsrc/external/mit/libXpm/dist/src/create.c 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/libXi/dist/INSTALL diff -u xsrc/external/mit/libXi/dist/INSTALL:1.5 xsrc/external/mit/libXi/dist/INSTALL:1.6 --- xsrc/external/mit/libXi/dist/INSTALL:1.5 Tue Oct 4 22:01:49 2016 +++ xsrc/external/mit/libXi/dist/INSTALL Sat Mar 4 21:48:03 2017 @@ -1,11 +1,13 @@ Installation Instructions ************************* -Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, -2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation, +Inc. - This file is free documentation; the Free Software Foundation gives -unlimited permission to copy, distribute and modify it. + Copying and distribution of this file, with or without modification, +are permitted in any medium without royalty provided the copyright +notice and this notice are preserved. This file is offered as-is, +without warranty of any kind. Basic Installation ================== @@ -13,7 +15,11 @@ Basic Installation Briefly, the shell commands `./configure; make; make install' should configure, build, and install this package. The following more-detailed instructions are generic; see the `README' file for -instructions specific to this package. +instructions specific to this package. Some packages provide this +`INSTALL' file but do not implement all of the features documented +below. The lack of an optional feature in a given package is not +necessarily a bug. More recommendations for GNU packages can be found +in *note Makefile Conventions: (standards)Makefile Conventions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses @@ -42,7 +48,7 @@ may remove or edit it. you want to change it or regenerate `configure' using a newer version of `autoconf'. -The simplest way to compile this package is: + The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. @@ -53,12 +59,22 @@ The simplest way to compile this package 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with - the package. + the package, generally using the just-built uninstalled binaries. 4. Type `make install' to install the programs and any data files and - documentation. + documentation. When installing into a prefix owned by root, it is + recommended that the package be configured and built as a regular + user, and only the `make install' phase executed with root + privileges. + + 5. Optionally, type `make installcheck' to repeat any self-tests, but + this time using the binaries in their final installed location. + This target does not install anything. Running this target as a + regular user, particularly if the prior `make install' required + root privileges, verifies that the installation completed + correctly. - 5. You can remove the program binaries and object files from the + 6. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is @@ -67,8 +83,15 @@ The simplest way to compile this package all sorts of other programs in order to regenerate files that came with the distribution. - 6. Often, you can also type `make uninstall' to remove the installed - files again. + 7. Often, you can also type `make uninstall' to remove the installed + files again. In practice, not all packages have tested that + uninstallation works correctly, even though it is required by the + GNU Coding Standards. + + 8. Some packages, particularly those that use Automake, provide `make + distcheck', which can by used by developers to test that all other + targets like `make install' and `make uninstall' work correctly. + This target is generally not run by end users. Compilers and Options ===================== @@ -93,7 +116,8 @@ same time, by placing the object files f own directory. To do this, you can use GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the -source code in the directory that `configure' is in and in `..'. +source code in the directory that `configure' is in and in `..'. This +is known as a "VPATH" build. With a non-GNU `make', it is safer to compile the package for one architecture at a time in the source code directory. After you have @@ -120,7 +144,8 @@ Installation Names By default, `make install' installs the package's commands under `/usr/local/bin', include files under `/usr/local/include', etc. You can specify an installation prefix other than `/usr/local' by giving -`configure' the option `--prefix=PREFIX'. +`configure' the option `--prefix=PREFIX', where PREFIX must be an +absolute file name. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you @@ -131,15 +156,46 @@ Documentation and other data files still In addition, if you use an unusual directory layout you can give options like `--bindir=DIR' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories -you can set and what kinds of files go in them. +you can set and what kinds of files go in them. In general, the +default for these options is expressed in terms of `${prefix}', so that +specifying just `--prefix' will affect all of the other directory +specifications that were not explicitly provided. + + The most portable way to affect installation locations is to pass the +correct locations to `configure'; however, many packages provide one or +both of the following shortcuts of passing variable assignments to the +`make install' command line to change installation locations without +having to reconfigure or recompile. + + The first method involves providing an override variable for each +affected directory. For example, `make install +prefix=/alternate/directory' will choose an alternate location for all +directory configuration variables that were expressed in terms of +`${prefix}'. Any directories that were specified during `configure', +but not in terms of `${prefix}', must each be overridden at install +time for the entire installation to be relocated. The approach of +makefile variable overrides for each directory variable is required by +the GNU Coding Standards, and ideally causes no recompilation. +However, some platforms have known limitations with the semantics of +shared libraries that end up requiring recompilation when using this +method, particularly noticeable in packages that use GNU Libtool. + + The second method involves providing the `DESTDIR' variable. For +example, `make install DESTDIR=/alternate/directory' will prepend +`/alternate/directory' before all installation names. The approach of +`DESTDIR' overrides is not required by the GNU Coding Standards, and +does not work on platforms that have drive letters. On the other hand, +it does better at avoiding recompilation issues, and works well even +when some directory options were not specified in terms of `${prefix}' +at `configure' time. + +Optional Features +================= If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. -Optional Features -================= - Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE @@ -152,6 +208,13 @@ find the X include and library files aut you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. + Some packages offer the ability to configure how verbose the +execution of `make' will be. For these packages, running `./configure +--enable-silent-rules' sets the default to minimal output, which can be +overridden with `make V=1'; while running `./configure +--disable-silent-rules' sets the default to verbose, which can be +overridden with `make V=0'. + Particular systems ================== @@ -159,10 +222,15 @@ Particular systems CC is not installed, it is recommended to use the following options in order to use an ANSI C compiler: - ./configure CC="cc -Ae" + ./configure CC="cc -Ae -D_XOPEN_SOURCE=500" and if that doesn't work, install pre-built binaries of GCC for HP-UX. + HP-UX `make' updates targets which have the same time stamps as +their prerequisites, which makes it generally unusable when shipped +generated files such as `configure' are involved. Use GNU `make' +instead. + On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot parse its `<wchar.h>' header file. The option `-nodtk' can be used as a workaround. If GNU CC is not installed, it is therefore recommended @@ -174,6 +242,16 @@ and if that doesn't work, try ./configure CC="cc -nodtk" + On Solaris, don't put `/usr/ucb' early in your `PATH'. This +directory contains several dysfunctional programs; working variants of +these programs are available in `/usr/bin'. So, if you need `/usr/ucb' +in your `PATH', put it _after_ `/usr/bin'. + + On Haiku, software installed for all users goes in `/boot/common', +not `/usr/local'. It is recommended to use the following options: + + ./configure --prefix=/boot/common + Specifying the System Type ========================== @@ -189,7 +267,8 @@ type, such as `sun4', or a canonical nam where SYSTEM can have one of these forms: - OS KERNEL-OS + OS + KERNEL-OS See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't @@ -277,7 +356,7 @@ operates. `configure' can determine that directory automatically. `--prefix=DIR' - Use DIR as the installation prefix. *Note Installation Names:: + Use DIR as the installation prefix. *note Installation Names:: for more details, including other options available for fine-tuning the installation locations. Index: xsrc/external/mit/libXi/dist/src/XIQueryDevice.c diff -u xsrc/external/mit/libXi/dist/src/XIQueryDevice.c:1.2 xsrc/external/mit/libXi/dist/src/XIQueryDevice.c:1.3 --- xsrc/external/mit/libXi/dist/src/XIQueryDevice.c:1.2 Fri Oct 7 16:06:39 2016 +++ xsrc/external/mit/libXi/dist/src/XIQueryDevice.c Sat Mar 4 21:48:03 2017 @@ -46,7 +46,7 @@ XIQueryDevice(Display *dpy, int deviceid char *ptr; char *end; int i; - char *buf; + char *buf = NULL; XExtDisplayInfo *extinfo = XInput_find_display(dpy); @@ -66,17 +66,18 @@ XIQueryDevice(Display *dpy, int deviceid { *ndevices_return = reply.num_devices; info = Xmalloc((reply.num_devices + 1) * sizeof(XIDeviceInfo)); + buf = Xmalloc(reply.length * 4); } else { *ndevices_return = 0; info = NULL; + buf = NULL; } - if (!info) + if (!info || !buf) goto error; - buf = Xmalloc(reply.length * 4); _XRead(dpy, buf, reply.length * 4); ptr = buf; end = buf + reply.length * 4; @@ -136,11 +137,12 @@ error_loop: Xfree(info[i].classes); } error: + Xfree(info); + Xfree(buf); UnlockDisplay(dpy); error_unlocked: SyncHandle(); *ndevices_return = -1; - Xfree(buf); return NULL; } Index: xsrc/external/mit/libXi/dist/src/XListDev.c diff -u xsrc/external/mit/libXi/dist/src/XListDev.c:1.4 xsrc/external/mit/libXi/dist/src/XListDev.c:1.5 --- xsrc/external/mit/libXi/dist/src/XListDev.c:1.4 Tue Oct 4 22:01:49 2016 +++ xsrc/external/mit/libXi/dist/src/XListDev.c Sat Mar 4 21:48:03 2017 @@ -73,27 +73,28 @@ static int pad_to_xid(int base_size) return ((base_size + padsize - 1)/padsize) * padsize; } -static size_t -SizeClassInfo(xAnyClassPtr *any, size_t len, int num_classes) +static int +SizeClassInfo(xAnyClassPtr *any, size_t len, int num_classes, size_t *size) { - int size = 0; int j; + size_t sz = 0; + for (j = 0; j < num_classes; j++) { switch ((*any)->class) { case KeyClass: - size += pad_to_xid(sizeof(XKeyInfo)); + sz += pad_to_xid(sizeof(XKeyInfo)); break; case ButtonClass: - size += pad_to_xid(sizeof(XButtonInfo)); + sz += pad_to_xid(sizeof(XButtonInfo)); break; case ValuatorClass: { xValuatorInfoPtr v; if (len < sizeof(v)) - return 0; + return 1; v = (xValuatorInfoPtr) *any; - size += pad_to_xid(sizeof(XValuatorInfo) + + sz += pad_to_xid(sizeof(XValuatorInfo) + (v->num_axes * sizeof(XAxisInfo))); break; } @@ -101,11 +102,13 @@ SizeClassInfo(xAnyClassPtr *any, size_t break; } if ((*any)->length > len) - return 0; + return 1; *any = (xAnyClassPtr) ((char *)(*any) + (*any)->length); } - return size; + *size = sz; + + return 0; } static void @@ -172,7 +175,7 @@ ParseClassInfo(xAnyClassPtr *any, XAnyCl XDeviceInfo * XListInputDevices( register Display *dpy, - int *ndevices) + int *ndevices_return) { size_t s, size; xListInputDevicesReq *req; @@ -187,6 +190,7 @@ XListInputDevices( int i; unsigned long rlen; XExtDisplayInfo *info = XInput_find_display(dpy); + int ndevices; LockDisplay(dpy); if (_XiCheckExtInit(dpy, XInput_Initial_Release, info) == -1) @@ -202,8 +206,8 @@ XListInputDevices( return (XDeviceInfo *) NULL; } - if ((*ndevices = rep.ndevices)) { /* at least 1 input device */ - size = *ndevices * sizeof(XDeviceInfo); + if ((ndevices = rep.ndevices)) { /* at least 1 input device */ + size = ndevices * sizeof(XDeviceInfo); if (rep.length < (INT_MAX >> 2)) { rlen = rep.length << 2; /* multiply length by 4 */ slist = list = Xmalloc(rlen); @@ -216,18 +220,17 @@ XListInputDevices( } _XRead(dpy, (char *)list, rlen); - any = (xAnyClassPtr) ((char *)list + (*ndevices * sizeof(xDeviceInfo))); + any = (xAnyClassPtr) ((char *)list + (ndevices * sizeof(xDeviceInfo))); sav_any = any; end = (char *)list + rlen; - for (i = 0; i < *ndevices; i++, list++) { - s = SizeClassInfo(&any, end - (char *)any, (int)list->num_classes); - if (!s) + for (i = 0; i < ndevices; i++, list++) { + if(SizeClassInfo(&any, end - (char *)any, (int)list->num_classes, &s)) goto out; size += s; } Nptr = ((unsigned char *)list) + rlen; - for (i = 0, nptr = (unsigned char *)any; i < *ndevices; i++) { + for (i = 0, nptr = (unsigned char *)any; i < ndevices; i++) { if (nptr >= Nptr) goto out; size += *nptr + 1; @@ -243,10 +246,10 @@ XListInputDevices( } sclist = clist; Any = (XAnyClassPtr) ((char *)clist + - (*ndevices * sizeof(XDeviceInfo))); + (ndevices * sizeof(XDeviceInfo))); list = slist; any = sav_any; - for (i = 0; i < *ndevices; i++, list++, clist++) { + for (i = 0; i < ndevices; i++, list++, clist++) { clist->type = list->type; clist->id = list->id; clist->use = list->use; @@ -259,7 +262,7 @@ XListInputDevices( clist = sclist; nptr = (unsigned char *)any; Nptr = (unsigned char *)Any; - for (i = 0; i < *ndevices; i++, clist++) { + for (i = 0; i < ndevices; i++, clist++) { clist->name = (char *)Nptr; memcpy(Nptr, nptr + 1, *nptr); Nptr += (*nptr); @@ -268,6 +271,8 @@ XListInputDevices( } } + *ndevices_return = ndevices; + out: XFree((char *)slist); UnlockDisplay(dpy); Index: xsrc/external/mit/libXpm/dist/src/create.c diff -u xsrc/external/mit/libXpm/dist/src/create.c:1.2 xsrc/external/mit/libXpm/dist/src/create.c:1.3 --- xsrc/external/mit/libXpm/dist/src/create.c:1.2 Wed Mar 5 21:29:31 2014 +++ xsrc/external/mit/libXpm/dist/src/create.c Sat Mar 4 21:48:03 2017 @@ -647,7 +647,8 @@ CreateColors( while (def_index <= 5 && defaults[def_index] == NULL) ++def_index; } - if (def_index >= 2 && defaults[def_index] != NULL && + if (def_index >= 2 && def_index <= 5 && + defaults[def_index] != NULL && !xpmstrcasecmp(symbol->value, defaults[def_index])) break; }