diff --git a/lib/libICE/ChangeLog b/lib/libICE/ChangeLog index a60586cfb..a86906c01 100644 --- a/lib/libICE/ChangeLog +++ b/lib/libICE/ChangeLog @@ -1,3 +1,183 @@ +commit 0dfab4253e26d5c6e5f058126eb5e9f7a7732ae8 +Author: Alan Coopersmith +Date: Fri Jun 6 18:28:28 2014 -0700 + + libICE 1.0.9 + + Signed-off-by: Alan Coopersmith + +commit 9fb6ba03d7183ae06644f8a747fdb99b970d65fc +Author: Alan Coopersmith +Date: Tue Dec 24 09:35:02 2013 -0800 + + Delete unused name variable in register.c + + Found by cppcheck 1.62: + [src/register.c:84]: (style) Variable 'name' is assigned a value + that is never used. + [src/register.c:182]: (style) Variable 'name' is assigned a value + that is never used. + + Signed-off-by: Alan Coopersmith + +commit c5060918164168c0a4f737b76e92df3c03356dc6 +Author: Alan Coopersmith +Date: Tue Dec 24 09:18:17 2013 -0800 + + Free iceConn->connection_string when unwinding after malloc fails + + Found by cppcheck 1.62: + [src/accept.c:113]: (error) Memory leak: iceConn.connection_string + + Signed-off-by: Alan Coopersmith + +commit 80f62c54fbd50a3bbdf9c37258525098c9117830 +Author: Matthieu Herrb +Date: Thu Aug 29 22:18:14 2013 +0200 + + Use arc4random when available to produce the auth cookie. + + arc4random() and associated functions can be found in libbsd on + GNU/Linux systems. + + Signed-off-by: Matthieu Herrb + Reviewed-by: Alan Coopersmith + +commit 2312ee00402088307e69589c3d12529b5232df66 +Author: Alan Coopersmith +Date: Thu Aug 8 23:01:30 2013 -0700 + + Make STORE_STRING cast strlen result to CARD16 when storing in CARD16 + + Clears a number of clang warnings of the form: + + connect.c:328:6: warning: implicit conversion loses integer precision: + 'size_t' (aka 'unsigned long') to 'CARD16' (aka 'unsigned short') + [-Wconversion] + STORE_STRING (pData, _IceAuthNames[i]); + ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + ./ICElibint.h:173:19: note: expanded from macro 'STORE_STRING' + CARD16 _len = strlen (_string); \ + ~~~~ ^~~~~~~~~~~~~~~~ + + Signed-off-by: Alan Coopersmith + +commit 6d6aa84dc6acb2daa3ef7e20942c38a1416bf543 +Author: Alan Coopersmith +Date: Thu Aug 8 22:58:46 2013 -0700 + + Cast assignments in IceErrorHeader() macro + + Clears many clang warnings about implicit conversions losing + integer precision, such as from storing ints into CARD8 or CARD16. + + Signed-off-by: Alan Coopersmith + +commit 9450bb648ef98efd6f08ea7d14ab8b9ea6e7bb54 +Author: Alan Coopersmith +Date: Thu Aug 8 22:47:41 2013 -0700 + + Make write_string call write_counted_string instead of copying it + + Signed-off-by: Alan Coopersmith + +commit 84153eee4db318cd897c464e70cb9f8bc8e469f6 +Author: Alan Coopersmith +Date: Thu Aug 8 22:37:09 2013 -0700 + + Mark input arguments to write_string functions as const + + Signed-off-by: Alan Coopersmith + +commit 9a74512ffdc1628f1b87d2191439915c63b9104f +Author: Alan Coopersmith +Date: Thu Aug 8 22:31:41 2013 -0700 + + Stop casting return values from malloc + + Signed-off-by: Alan Coopersmith + +commit 4033226105fa861ab5f0276850afc24c0fa45406 +Author: Alan Coopersmith +Date: Thu Aug 8 22:17:27 2013 -0700 + + Get rid of casts to (char *) in calls to free() + + Signed-off-by: Alan Coopersmith + +commit 10c30ae6a7df1a7c352a1d611a313dffcaa42082 +Author: Alan Coopersmith +Date: Sat Jul 20 14:48:33 2013 -0700 + + Convert remaining sprintf() call to snprintf() + + Signed-off-by: Alan Coopersmith + +commit 0a94633e3d805ca477fba6b7acb673d055a3f43d +Author: Alan Coopersmith +Date: Sat Jul 20 14:46:09 2013 -0700 + + Convert strcpy/strcat pairs to snprintf calls + + Signed-off-by: Alan Coopersmith + +commit 0d276835222eeb57de56f56cd9e12611b1d30466 +Author: Alan Coopersmith +Date: Sat Jul 20 14:35:11 2013 -0700 + + Fix some clang warnings about integer sign/size conversions + + Signed-off-by: Alan Coopersmith + +commit bb3d8a7767cf260b97c7e019e4fec0ee7d7b65a8 +Author: Alan Coopersmith +Date: Sat Jul 20 14:24:04 2013 -0700 + + unifdef WORD64 + + Remove leftover remnants of CRAY support, which still had some + functions consisting solely of /* NOT IMPLEMENTED YET */ comments. + + Signed-off-by: Alan Coopersmith + +commit 9561eca1ad28afee6dcd0aebea3dd20a154ec481 +Author: Alan Coopersmith +Date: Thu Jul 18 00:36:28 2013 -0700 + + Constify filename argument to IceLockAuthFile & IceUnlockAuthFile + + Needed to fix const string warnings in iceauth - functions already + copy provided arguments to temporary local buffer for modifications. + + Signed-off-by: Alan Coopersmith + Reviewed-by: Peter Hutterer + +commit 1b1cf8072b2559e15ac440d5484a29a81d6918c6 +Author: Colin Walters +Date: Wed Jan 4 17:37:06 2012 -0500 + + autogen.sh: Implement GNOME Build API + + http://people.gnome.org/~walters/docs/build-api.txt + + Signed-off-by: Adam Jackson + +commit 5e784ca7f37823e62733765371c0b8ed1c58e5aa +Author: Adam Jackson +Date: Tue Jan 15 14:28:48 2013 -0500 + + configure: Remove AM_MAINTAINER_MODE + + Signed-off-by: Adam Jackson + +commit e1677ce019219ac164d99f1e04f17caf16fc785a +Author: Alan Coopersmith +Date: Fri Jan 4 19:32:08 2013 -0800 + + unifdef -U__UNIXOS2__ + + Signed-off-by: Alan Coopersmith + commit f166e8bbf16ec214fefdcf02ce81f80442899cb7 Author: Alan Coopersmith Date: Fri Mar 2 19:59:50 2012 -0800 diff --git a/lib/libICE/INSTALL b/lib/libICE/INSTALL index 8b82ade08..a1e89e18a 100644 --- a/lib/libICE/INSTALL +++ b/lib/libICE/INSTALL @@ -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 is: 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. You can remove the program binaries and object files from the + 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. + + 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 is: 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 for each architecture in their 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 use the regular prefix. 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 automatically, but if it doesn't, 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 `' 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 name which has the form: 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. diff --git a/lib/libICE/Makefile.in b/lib/libICE/Makefile.in index 4a26408f5..76f3ea683 100644 --- a/lib/libICE/Makefile.in +++ b/lib/libICE/Makefile.in @@ -54,7 +54,7 @@ subdir = . DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(srcdir)/ice.pc.in $(top_srcdir)/configure AUTHORS COPYING \ - ChangeLog INSTALL NEWS config.guess config.sub depcomp \ + ChangeLog INSTALL NEWS compile config.guess config.sub depcomp \ install-sh ltmain.sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac @@ -231,7 +231,6 @@ LINT_FLAGS = @LINT_FLAGS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -330,7 +329,7 @@ all: config.h .SUFFIXES: am--refresh: Makefile @: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -357,9 +356,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): @@ -370,7 +369,7 @@ config.h: stamp-h1 stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h -$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(srcdir)/config.h.in: $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f stamp-h1 touch $@ diff --git a/lib/libICE/aclocal.m4 b/lib/libICE/aclocal.m4 index 182ea49fb..0606b3b81 100644 --- a/lib/libICE/aclocal.m4 +++ b/lib/libICE/aclocal.m4 @@ -9386,44 +9386,6 @@ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) -# Add --enable-maintainer-mode option to configure. -*- Autoconf -*- -# From Jim Meyering - -# Copyright (C) 1996-2012 Free Software Foundation, Inc. -# -# This file is free software; the Free Software Foundation -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. - -# AM_MAINTAINER_MODE([DEFAULT-MODE]) -# ---------------------------------- -# Control maintainer-specific portions of Makefiles. -# Default is to disable them, unless 'enable' is passed literally. -# For symmetry, 'disable' may be passed as well. Anyway, the user -# can override the default with the --enable/--disable switch. -AC_DEFUN([AM_MAINTAINER_MODE], -[m4_case(m4_default([$1], [disable]), - [enable], [m4_define([am_maintainer_other], [disable])], - [disable], [m4_define([am_maintainer_other], [enable])], - [m4_define([am_maintainer_other], [enable]) - m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) -AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode's default is 'disable' unless 'enable' is passed - AC_ARG_ENABLE([maintainer-mode], - [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], - am_maintainer_other[ make rules and dependencies not useful - (and sometimes confusing) to the casual installer])], - [USE_MAINTAINER_MODE=$enableval], - [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) - AC_MSG_RESULT([$USE_MAINTAINER_MODE]) - AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) - MAINT=$MAINTAINER_MODE_TRUE - AC_SUBST([MAINT])dnl -] -) - -AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) - # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2012 Free Software Foundation, Inc. @@ -9830,7 +9792,7 @@ AC_SUBST([am__untar]) dnl xorg-macros.m4. Generated from xorg-macros.m4.in xorgversion.m4 by configure. dnl dnl Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved. -dnl +dnl dnl Permission is hereby granted, free of charge, to any person obtaining a dnl copy of this software and associated documentation files (the "Software"), dnl to deal in the Software without restriction, including without limitation @@ -9863,10 +9825,10 @@ dnl DEALINGS IN THE SOFTWARE. # [m4_fatal([must install xorg-macros 1.1 or later before running autoconf/autogen])]) # # -# See the "minimum version" comment for each macro you use to see what +# See the "minimum version" comment for each macro you use to see what # version you require. m4_defun([XORG_MACROS_VERSION],[ -m4_define([vers_have], [1.16.2]) +m4_define([vers_have], [1.19.0]) m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) m4_if(m4_cmp(maj_have, maj_needed), 0,, @@ -9886,7 +9848,7 @@ m4_undefine([maj_needed]) # such as man pages and config files AC_DEFUN([XORG_PROG_RAWCPP],[ AC_REQUIRE([AC_PROG_CPP]) -AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], +AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}], [$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib]) # Check for flag to avoid builtin definitions - assumes unix is predefined, @@ -9916,6 +9878,7 @@ if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then AC_MSG_RESULT([no]) else if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then + TRADITIONALCPPFLAGS="-traditional" RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" AC_MSG_RESULT([yes]) else @@ -9924,6 +9887,7 @@ else fi rm -f conftest.$ac_ext AC_SUBST(RAWCPPFLAGS) +AC_SUBST(TRADITIONALCPPFLAGS) ]) # XORG_PROG_RAWCPP # XORG_MANPAGE_SECTIONS() @@ -10448,9 +10412,10 @@ AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) ]) # XORG_WITH_ASCIIDOC # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT]) -# -------------------------------- +# ------------------------------------------- # Minimum version: 1.5.0 # Minimum version for optional DEFAULT argument: 1.11.0 +# Minimum version for optional DOT checking: 1.18.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the @@ -10470,6 +10435,7 @@ AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) # AC_DEFUN([XORG_WITH_DOXYGEN],[ AC_ARG_VAR([DOXYGEN], [Path to doxygen command]) +AC_ARG_VAR([DOT], [Path to the dot graphics utility]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(doxygen, AS_HELP_STRING([--with-doxygen], @@ -10513,6 +10479,20 @@ m4_ifval([$1], AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) fi]) fi]) + +dnl Check for DOT if we have doxygen. The caller decides if it is mandatory +dnl HAVE_DOT is a variable that can be used in your doxygen.in config file: +dnl HAVE_DOT = @HAVE_DOT@ +HAVE_DOT=no +if test "x$have_doxygen" = "xyes"; then + AC_PATH_PROG([DOT], [dot]) + if test "x$DOT" != "x"; then + HAVE_DOT=yes + fi +fi + +AC_SUBST([HAVE_DOT]) +AM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"]) AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) ]) # XORG_WITH_DOXYGEN @@ -10695,6 +10675,29 @@ fi]) AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) ]) # XORG_WITH_FOP +# XORG_WITH_M4([MIN-VERSION]) +# --------------------------- +# Minimum version: 1.19.0 +# +# This macro attempts to locate an m4 macro processor which supports +# -I option and is only useful for modules relying on M4 in order to +# expand macros in source code files. +# +# Interface to module: +# M4: returns the path of the m4 program found +# returns the path set by the user in the environment +# +AC_DEFUN([XORG_WITH_M4], [ +AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4], + [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4], + [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \ + ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]], + [AC_MSG_ERROR([could not find m4 that supports -I option])], + [$PATH:/usr/gnu/bin])]) + +AC_SUBST([M4], [$ac_cv_path_M4]) +]) # XORG_WITH_M4 + # XORG_WITH_PS2PDF([DEFAULT]) # ---------------- # Minimum version: 1.6.0 @@ -11149,7 +11152,8 @@ AC_ARG_ENABLE(malloc0returnsnull, AC_MSG_CHECKING([whether malloc(0) returns NULL]) if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then - AC_RUN_IFELSE([AC_LANG_PROGRAM([ +AC_CACHE_VAL([xorg_cv_malloc0_returns_null], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([ #include ],[ char *m0, *r0, *c0, *p; @@ -11159,9 +11163,9 @@ if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then c0 = calloc(0,10); exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1); ])], - [MALLOC_ZERO_RETURNS_NULL=yes], - [MALLOC_ZERO_RETURNS_NULL=no], - [MALLOC_ZERO_RETURNS_NULL=yes]) + [xorg_cv_malloc0_returns_null=yes], + [xorg_cv_malloc0_returns_null=no])]) +MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null fi AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) @@ -11372,18 +11376,18 @@ fi found="no" m4_foreach([flag], m4_cdr($@), [ if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_]CACHE_PREFIX[_unknown_warning_option" = "xyes" ; then PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_]CACHE_PREFIX[_unused_command_line_argument" = "xyes" ; then PREFIX[FLAGS]="$PREFIX[FLAGS] -Werror=unused-command-line-argument" fi PREFIX[FLAGS]="$PREFIX[FLAGS] ]flag[" dnl Some hackery here since AC_CACHE_VAL can't handle a non-literal varname - AC_MSG_CHECKING([if ]COMPILER[ supports]flag[]) + AC_MSG_CHECKING([if ]COMPILER[ supports ]flag[]) cacheid=AS_TR_SH([xorg_cv_]CACHE_PREFIX[_flag_]flag[]) AC_CACHE_VAL($cacheid, [AC_LINK_IFELSE([AC_LANG_PROGRAM([int i;])], @@ -11450,7 +11454,7 @@ AC_LANG_CASE( XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast]) - XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition]) + XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement]) ] ) @@ -11459,16 +11463,17 @@ AC_LANG_CASE( XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow]) -XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute]) +# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls]) +XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op]) # These are currently disabled because they are noisy. They will be enabled # in the future once the codebase is sufficiently modernized to silence # them. For now, I don't want them to drown out the other warnings. -# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) +# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual]) # Turn some warnings into errors, so we don't accidently get successful builds # when there are problems that should be fixed. @@ -11642,7 +11647,7 @@ dnl # XORG_RELEASE_VERSION # -------------------- # Defines PACKAGE_VERSION_{MAJOR,MINOR,PATCHLEVEL} for modules to use. - + AC_DEFUN([XORG_RELEASE_VERSION],[ AC_DEFINE_UNQUOTED([PACKAGE_VERSION_MAJOR], [`echo $PACKAGE_VERSION | cut -d . -f 1`], @@ -11710,12 +11715,12 @@ AC_DEFUN([XTRANS_TCP_FLAGS],[ AC_SEARCH_LIBS(socket, [socket]) AC_SEARCH_LIBS(gethostbyname, [nsl]) if test "$ac_cv_search_socket$ac_cv_search_gethostbyname" = "nono"; then - AC_HAVE_LIBRARY([ws2_32]) + AC_CHECK_LIB([ws2_32],[main]) fi # Needs to come after above checks for libsocket & libnsl for SVR4 systems AC_ARG_ENABLE(ipv6, - AC_HELP_STRING([--enable-ipv6],[Enable IPv6 support]), + AS_HELP_STRING([--enable-ipv6],[Enable IPv6 support]), [IPV6CONN=$enableval], [AC_CHECK_FUNC(getaddrinfo,[IPV6CONN=yes],[IPV6CONN=no])]) AC_MSG_CHECKING([if IPv6 support should be built]) @@ -11738,6 +11743,41 @@ AC_DEFUN([XTRANS_TCP_FLAGS],[ AC_INCLUDES_DEFAULT #include ]) + # XPG4v2/UNIX95 added msg_control - check to see if we need to define + # _XOPEN_SOURCE to get it (such as on Solaris) + AC_CHECK_MEMBER([struct msghdr.msg_control], [], [], + [ +AC_INCLUDES_DEFAULT +#include + ]) + # First try for Solaris in C99 compliant mode, which requires XPG6/UNIX03 + if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then + unset ac_cv_member_struct_msghdr_msg_control + AC_MSG_NOTICE([trying again with _XOPEN_SOURCE=600]) + AC_CHECK_MEMBER([struct msghdr.msg_control], + [AC_DEFINE([_XOPEN_SOURCE], [600], + [Defined if needed to expose struct msghdr.msg_control]) + ], [], [ +#define _XOPEN_SOURCE 600 +AC_INCLUDES_DEFAULT +#include + ]) + fi + # If that didn't work, fall back to XPG5/UNIX98 with C89 + if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then + unset ac_cv_member_struct_msghdr_msg_control + AC_MSG_NOTICE([trying again with _XOPEN_SOURCE=500]) + AC_CHECK_MEMBER([struct msghdr.msg_control], + [AC_DEFINE([_XOPEN_SOURCE], [500], + [Defined if needed to expose struct msghdr.msg_control]) + ], [], [ +#define _XOPEN_SOURCE 500 +AC_INCLUDES_DEFAULT +#include + ]) + fi + + ]) # XTRANS_TCP_FLAGS # XTRANS_CONNECTION_FLAGS() @@ -11746,13 +11786,12 @@ AC_INCLUDES_DEFAULT # that use Xtrans functions AC_DEFUN([XTRANS_CONNECTION_FLAGS],[ AC_REQUIRE([AC_CANONICAL_HOST]) - AC_REQUIRE([AC_TYPE_SIGNAL]) [case $host_os in mingw*) unixdef="no" ;; *) unixdef="yes" ;; esac] AC_ARG_ENABLE(unix-transport, - AC_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]), + AS_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]), [UNIXCONN=$enableval], [UNIXCONN=$unixdef]) AC_MSG_CHECKING([if Xtrans should support UNIX socket connections]) if test "$UNIXCONN" = "yes"; then @@ -11760,7 +11799,7 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[ fi AC_MSG_RESULT($UNIXCONN) AC_ARG_ENABLE(tcp-transport, - AC_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]), + AS_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]), [TCPCONN=$enableval], [TCPCONN=yes]) AC_MSG_CHECKING([if Xtrans should support TCP socket connections]) AC_MSG_RESULT($TCPCONN) @@ -11773,7 +11812,7 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[ *) localdef="no" ;; esac] AC_ARG_ENABLE(local-transport, - AC_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]), + AS_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]), [LOCALCONN=$enableval], [LOCALCONN=$localdef]) AC_MSG_CHECKING([if Xtrans should support os-specific local connections]) AC_MSG_RESULT($LOCALCONN) @@ -11791,7 +11830,7 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[ AC_DEFUN([XTRANS_SECURE_RPC_FLAGS], [AC_REQUIRE([XTRANS_TCP_FLAGS]) AC_ARG_ENABLE(secure-rpc, - AC_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]), + AS_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]), [SECURE_RPC=$enableval], [SECURE_RPC="try"]) if test "x$SECURE_RPC" = "xyes" -o "x$SECURE_RPC" = "xtry" ; then diff --git a/lib/libICE/compile b/lib/libICE/compile new file mode 100644 index 000000000..531136b06 --- /dev/null +++ b/lib/libICE/compile @@ -0,0 +1,347 @@ +#! /bin/sh +# Wrapper for compilers which do not understand '-c -o'. + +scriptversion=2012-10-14.11; # UTC + +# Copyright (C) 1999-2013 Free Software Foundation, Inc. +# Written by Tom Tromey . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +nl=' +' + +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent tools from complaining about whitespace usage. +IFS=" "" $nl" + +file_conv= + +# func_file_conv build_file lazy +# Convert a $build file to $host form and store it in $file +# Currently only supports Windows hosts. If the determined conversion +# type is listed in (the comma separated) LAZY, no conversion will +# take place. +func_file_conv () +{ + file=$1 + case $file in + / | /[!/]*) # absolute file, and not a UNC file + if test -z "$file_conv"; then + # lazily determine how to convert abs files + case `uname -s` in + MINGW*) + file_conv=mingw + ;; + CYGWIN*) + file_conv=cygwin + ;; + *) + file_conv=wine + ;; + esac + fi + case $file_conv/,$2, in + *,$file_conv,*) + ;; + mingw/*) + file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` + ;; + cygwin/*) + file=`cygpath -m "$file" || echo "$file"` + ;; + wine/*) + file=`winepath -w "$file" || echo "$file"` + ;; + esac + ;; + esac +} + +# func_cl_dashL linkdir +# Make cl look for libraries in LINKDIR +func_cl_dashL () +{ + func_file_conv "$1" + if test -z "$lib_path"; then + lib_path=$file + else + lib_path="$lib_path;$file" + fi + linker_opts="$linker_opts -LIBPATH:$file" +} + +# func_cl_dashl library +# Do a library search-path lookup for cl +func_cl_dashl () +{ + lib=$1 + found=no + save_IFS=$IFS + IFS=';' + for dir in $lib_path $LIB + do + IFS=$save_IFS + if $shared && test -f "$dir/$lib.dll.lib"; then + found=yes + lib=$dir/$lib.dll.lib + break + fi + if test -f "$dir/$lib.lib"; then + found=yes + lib=$dir/$lib.lib + break + fi + if test -f "$dir/lib$lib.a"; then + found=yes + lib=$dir/lib$lib.a + break + fi + done + IFS=$save_IFS + + if test "$found" != yes; then + lib=$lib.lib + fi +} + +# func_cl_wrapper cl arg... +# Adjust compile command to suit cl +func_cl_wrapper () +{ + # Assume a capable shell + lib_path= + shared=: + linker_opts= + for arg + do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + eat=1 + case $2 in + *.o | *.[oO][bB][jJ]) + func_file_conv "$2" + set x "$@" -Fo"$file" + shift + ;; + *) + func_file_conv "$2" + set x "$@" -Fe"$file" + shift + ;; + esac + ;; + -I) + eat=1 + func_file_conv "$2" mingw + set x "$@" -I"$file" + shift + ;; + -I*) + func_file_conv "${1#-I}" mingw + set x "$@" -I"$file" + shift + ;; + -l) + eat=1 + func_cl_dashl "$2" + set x "$@" "$lib" + shift + ;; + -l*) + func_cl_dashl "${1#-l}" + set x "$@" "$lib" + shift + ;; + -L) + eat=1 + func_cl_dashL "$2" + ;; + -L*) + func_cl_dashL "${1#-L}" + ;; + -static) + shared=false + ;; + -Wl,*) + arg=${1#-Wl,} + save_ifs="$IFS"; IFS=',' + for flag in $arg; do + IFS="$save_ifs" + linker_opts="$linker_opts $flag" + done + IFS="$save_ifs" + ;; + -Xlinker) + eat=1 + linker_opts="$linker_opts $2" + ;; + -*) + set x "$@" "$1" + shift + ;; + *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) + func_file_conv "$1" + set x "$@" -Tp"$file" + shift + ;; + *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) + func_file_conv "$1" mingw + set x "$@" "$file" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift + done + if test -n "$linker_opts"; then + linker_opts="-link$linker_opts" + fi + exec "$@" $linker_opts + exit 1 +} + +eat= + +case $1 in + '') + echo "$0: No command. Try '$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: compile [--help] [--version] PROGRAM [ARGS] + +Wrapper for compilers which do not understand '-c -o'. +Remove '-o dest.o' from ARGS, run PROGRAM with the remaining +arguments, and rename the output as expected. + +If you are trying to build a whole package this is not the +right script to run: please start by reading the file 'INSTALL'. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "compile $scriptversion" + exit $? + ;; + cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) + func_cl_wrapper "$@" # Doesn't return... + ;; +esac + +ofile= +cfile= + +for arg +do + if test -n "$eat"; then + eat= + else + case $1 in + -o) + # configure might choose to run compile as 'compile cc -o foo foo.c'. + # So we strip '-o arg' only if arg is an object. + eat=1 + case $2 in + *.o | *.obj) + ofile=$2 + ;; + *) + set x "$@" -o "$2" + shift + ;; + esac + ;; + *.c) + cfile=$1 + set x "$@" "$1" + shift + ;; + *) + set x "$@" "$1" + shift + ;; + esac + fi + shift +done + +if test -z "$ofile" || test -z "$cfile"; then + # If no '-o' option was seen then we might have been invoked from a + # pattern rule where we don't need one. That is ok -- this is a + # normal compilation that the losing compiler can handle. If no + # '.c' file was seen then we are probably linking. That is also + # ok. + exec "$@" +fi + +# Name of file we expect compiler to create. +cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` + +# Create the lock directory. +# Note: use '[/\\:.-]' here to ensure that we don't use the same name +# that we are using for the .o file. Also, base the name on the expected +# object file name, since that is what matters with a parallel build. +lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d +while true; do + if mkdir "$lockdir" >/dev/null 2>&1; then + break + fi + sleep 1 +done +# FIXME: race condition here if user kills between mkdir and trap. +trap "rmdir '$lockdir'; exit 1" 1 2 15 + +# Run the compile. +"$@" +ret=$? + +if test -f "$cofile"; then + test "$cofile" = "$ofile" || mv "$cofile" "$ofile" +elif test -f "${cofile}bj"; then + test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" +fi + +rmdir "$lockdir" +exit $ret + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/lib/libICE/config.h.in b/lib/libICE/config.h.in index d8aeeaf32..52c85c94e 100644 --- a/lib/libICE/config.h.in +++ b/lib/libICE/config.h.in @@ -15,6 +15,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H +/* Define to 1 if you have the `bsd' library (-lbsd). */ +#undef HAVE_LIBBSD + /* Define to 1 if you have the `ws2_32' library (-lws2_32). */ #undef HAVE_LIBWS2_32 @@ -88,9 +91,6 @@ /* Patch version of this package */ #undef PACKAGE_VERSION_PATCHLEVEL -/* Define as the return type of signal handlers (`int' or `void'). */ -#undef RETSIGTYPE - /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS @@ -134,3 +134,6 @@ /* Define to 1 if you need to in order for `stat' and other things to work. */ #undef _POSIX_SOURCE + +/* Defined if needed to expose struct msghdr.msg_control */ +#undef _XOPEN_SOURCE diff --git a/lib/libICE/configure b/lib/libICE/configure index 00bc9a165..3a8fe68fa 100644 --- a/lib/libICE/configure +++ b/lib/libICE/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libICE 1.0.8. +# Generated by GNU Autoconf 2.69 for libICE 1.0.9. # # Report bugs to . # @@ -651,8 +651,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='libICE' PACKAGE_TARNAME='libICE' -PACKAGE_VERSION='1.0.8' -PACKAGE_STRING='libICE 1.0.8' +PACKAGE_VERSION='1.0.9' +PACKAGE_STRING='libICE 1.0.9' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' PACKAGE_URL='' @@ -779,9 +779,6 @@ build_vendor build_cpu build LIBTOOL -MAINT -MAINTAINER_MODE_FALSE -MAINTAINER_MODE_TRUE am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE @@ -867,7 +864,6 @@ ac_subst_files='' ac_user_opts=' enable_option_checking enable_dependency_tracking -enable_maintainer_mode enable_shared enable_static with_pic @@ -1449,7 +1445,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libICE 1.0.8 to adapt to many kinds of systems. +\`configure' configures libICE 1.0.9 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1519,7 +1515,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libICE 1.0.8:";; + short | recursive ) echo "Configuration of libICE 1.0.9:";; esac cat <<\_ACEOF @@ -1531,9 +1527,6 @@ Optional Features: do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build - --enable-maintainer-mode - enable make rules and dependencies not useful (and - sometimes confusing) to the casual installer --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] @@ -1660,7 +1653,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libICE configure 1.0.8 +libICE configure 1.0.9 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2186,7 +2179,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libICE $as_me 1.0.8, which was +It was created by libICE $as_me 1.0.9, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -4330,7 +4323,7 @@ fi # Define the identity of the package. PACKAGE='libICE' - VERSION='1.0.8' + VERSION='1.0.9' cat >>confdefs.h <<_ACEOF @@ -4505,29 +4498,6 @@ fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 -$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } - # Check whether --enable-maintainer-mode was given. -if test "${enable_maintainer_mode+set}" = set; then : - enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval -else - USE_MAINTAINER_MODE=no -fi - - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 -$as_echo "$USE_MAINTAINER_MODE" >&6; } - if test $USE_MAINTAINER_MODE = yes; then - MAINTAINER_MODE_TRUE= - MAINTAINER_MODE_FALSE='#' -else - MAINTAINER_MODE_TRUE='#' - MAINTAINER_MODE_FALSE= -fi - - MAINT=$MAINTAINER_MODE_TRUE - - - # Initialize libtool case `pwd` in *\ * | *\ *) @@ -12138,18 +12108,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wall" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wall" >&5 -$as_echo_n "checking if $CC supports-Wall... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wall" >&5 +$as_echo_n "checking if $CC supports -Wall... " >&6; } cacheid=xorg_cv_cc_flag__Wall if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -12256,18 +12226,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wpointer-arith" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wpointer-arith" >&5 -$as_echo_n "checking if $CC supports-Wpointer-arith... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wpointer-arith" >&5 +$as_echo_n "checking if $CC supports -Wpointer-arith... " >&6; } cacheid=xorg_cv_cc_flag__Wpointer_arith if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -12374,18 +12344,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-declarations" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wmissing-declarations" >&5 -$as_echo_n "checking if $CC supports-Wmissing-declarations... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-declarations" >&5 +$as_echo_n "checking if $CC supports -Wmissing-declarations... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_declarations if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -12492,18 +12462,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wformat=2" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wformat=2" >&5 -$as_echo_n "checking if $CC supports-Wformat=2... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wformat=2" >&5 +$as_echo_n "checking if $CC supports -Wformat=2... " >&6; } cacheid=xorg_cv_cc_flag__Wformat_2 if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -12541,18 +12511,18 @@ $as_echo "$supported" >&6; } fi if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wformat" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wformat" >&5 -$as_echo_n "checking if $CC supports-Wformat... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wformat" >&5 +$as_echo_n "checking if $CC supports -Wformat... " >&6; } cacheid=xorg_cv_cc_flag__Wformat if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -12661,18 +12631,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wstrict-prototypes" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wstrict-prototypes" >&5 -$as_echo_n "checking if $CC supports-Wstrict-prototypes... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wstrict-prototypes" >&5 +$as_echo_n "checking if $CC supports -Wstrict-prototypes... " >&6; } cacheid=xorg_cv_cc_flag__Wstrict_prototypes if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -12779,18 +12749,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-prototypes" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wmissing-prototypes" >&5 -$as_echo_n "checking if $CC supports-Wmissing-prototypes... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-prototypes" >&5 +$as_echo_n "checking if $CC supports -Wmissing-prototypes... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_prototypes if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -12897,18 +12867,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wnested-externs" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wnested-externs" >&5 -$as_echo_n "checking if $CC supports-Wnested-externs... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wnested-externs" >&5 +$as_echo_n "checking if $CC supports -Wnested-externs... " >&6; } cacheid=xorg_cv_cc_flag__Wnested_externs if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -13015,18 +12985,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wbad-function-cast" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wbad-function-cast" >&5 -$as_echo_n "checking if $CC supports-Wbad-function-cast... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wbad-function-cast" >&5 +$as_echo_n "checking if $CC supports -Wbad-function-cast... " >&6; } cacheid=xorg_cv_cc_flag__Wbad_function_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -13133,18 +13103,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wold-style-definition" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wold-style-definition" >&5 -$as_echo_n "checking if $CC supports-Wold-style-definition... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wold-style-definition" >&5 +$as_echo_n "checking if $CC supports -Wold-style-definition... " >&6; } cacheid=xorg_cv_cc_flag__Wold_style_definition if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -13181,6 +13151,55 @@ $as_echo "$supported" >&6; } fi fi + if test $found = "no" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + fi + + CFLAGS="$CFLAGS -fd" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -fd" >&5 +$as_echo_n "checking if $CC supports -fd... " >&6; } + cacheid=xorg_cv_cc_flag__fd + if eval \${$cacheid+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval $cacheid=yes +else + eval $cacheid=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 +$as_echo "$supported" >&6; } + if test "$supported" = "yes" ; then + BASE_CFLAGS="$BASE_CFLAGS -fd" + found="yes" + fi + fi + @@ -13251,18 +13270,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wdeclaration-after-statement" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wdeclaration-after-statement" >&5 -$as_echo_n "checking if $CC supports-Wdeclaration-after-statement... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wdeclaration-after-statement" >&5 +$as_echo_n "checking if $CC supports -Wdeclaration-after-statement... " >&6; } cacheid=xorg_cv_cc_flag__Wdeclaration_after_statement if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -13373,18 +13392,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wunused" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wunused" >&5 -$as_echo_n "checking if $CC supports-Wunused... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wunused" >&5 +$as_echo_n "checking if $CC supports -Wunused... " >&6; } cacheid=xorg_cv_cc_flag__Wunused if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -13491,18 +13510,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wuninitialized" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wuninitialized" >&5 -$as_echo_n "checking if $CC supports-Wuninitialized... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wuninitialized" >&5 +$as_echo_n "checking if $CC supports -Wuninitialized... " >&6; } cacheid=xorg_cv_cc_flag__Wuninitialized if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -13609,18 +13628,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wshadow" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wshadow" >&5 -$as_echo_n "checking if $CC supports-Wshadow... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wshadow" >&5 +$as_echo_n "checking if $CC supports -Wshadow... " >&6; } cacheid=xorg_cv_cc_flag__Wshadow if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -13727,136 +13746,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then - CFLAGS="$CFLAGS -Werror=unused-command-line-argument" - fi - - CFLAGS="$CFLAGS -Wcast-qual" - - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wcast-qual" >&5 -$as_echo_n "checking if $CC supports-Wcast-qual... " >&6; } - cacheid=xorg_cv_cc_flag__Wcast_qual - if eval \${$cacheid+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int i; -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - eval $cacheid=yes -else - eval $cacheid=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -fi - - - CFLAGS="$xorg_testset_save_CFLAGS" - - eval supported=\$$cacheid - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 -$as_echo "$supported" >&6; } - if test "$supported" = "yes" ; then - BASE_CFLAGS="$BASE_CFLAGS -Wcast-qual" - found="yes" - fi - fi - - - - - - - - - - - - - - - -xorg_testset_save_CFLAGS="$CFLAGS" - -if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then - CFLAGS="$CFLAGS -Werror=unknown-warning-option" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 -$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } -if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int i; -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - xorg_cv_cc_flag_unknown_warning_option=yes -else - xorg_cv_cc_flag_unknown_warning_option=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 -$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } - xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option - CFLAGS="$xorg_testset_save_CFLAGS" -fi - -if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then - if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then - CFLAGS="$CFLAGS -Werror=unknown-warning-option" - fi - CFLAGS="$CFLAGS -Werror=unused-command-line-argument" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 -$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } -if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -int i; -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - xorg_cv_cc_flag_unused_command_line_argument=yes -else - xorg_cv_cc_flag_unused_command_line_argument=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 -$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } - xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument - CFLAGS="$xorg_testset_save_CFLAGS" -fi - -found="no" - - if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then - CFLAGS="$CFLAGS -Werror=unknown-warning-option" - fi - - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-noreturn" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wmissing-noreturn" >&5 -$as_echo_n "checking if $CC supports-Wmissing-noreturn... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-noreturn" >&5 +$as_echo_n "checking if $CC supports -Wmissing-noreturn... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_noreturn if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -13963,18 +13864,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-format-attribute" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wmissing-format-attribute" >&5 -$as_echo_n "checking if $CC supports-Wmissing-format-attribute... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-format-attribute" >&5 +$as_echo_n "checking if $CC supports -Wmissing-format-attribute... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_format_attribute if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -14012,13 +13913,132 @@ $as_echo "$supported" >&6; } fi +# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls]) + + + + + + + + + + + + + +xorg_testset_save_CFLAGS="$CFLAGS" + +if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unknown-warning-option" >&5 +$as_echo_n "checking if $CC supports -Werror=unknown-warning-option... " >&6; } +if ${xorg_cv_cc_flag_unknown_warning_option+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int i; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + xorg_cv_cc_flag_unknown_warning_option=yes +else + xorg_cv_cc_flag_unknown_warning_option=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unknown_warning_option" >&5 +$as_echo "$xorg_cv_cc_flag_unknown_warning_option" >&6; } + xorg_testset_cc_unknown_warning_option=$xorg_cv_cc_flag_unknown_warning_option + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +if test "x$xorg_testset_cc_unused_command_line_argument" = "x" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=unused-command-line-argument" >&5 +$as_echo_n "checking if $CC supports -Werror=unused-command-line-argument... " >&6; } +if ${xorg_cv_cc_flag_unused_command_line_argument+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int i; +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + xorg_cv_cc_flag_unused_command_line_argument=yes +else + xorg_cv_cc_flag_unused_command_line_argument=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xorg_cv_cc_flag_unused_command_line_argument" >&5 +$as_echo "$xorg_cv_cc_flag_unused_command_line_argument" >&6; } + xorg_testset_cc_unused_command_line_argument=$xorg_cv_cc_flag_unused_command_line_argument + CFLAGS="$xorg_testset_save_CFLAGS" +fi + +found="no" + + if test $found = "no" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + fi + + CFLAGS="$CFLAGS -Wlogical-op" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wlogical-op" >&5 +$as_echo_n "checking if $CC supports -Wlogical-op... " >&6; } + cacheid=xorg_cv_cc_flag__Wlogical_op + if eval \${$cacheid+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval $cacheid=yes +else + eval $cacheid=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 +$as_echo "$supported" >&6; } + if test "$supported" = "yes" ; then + BASE_CFLAGS="$BASE_CFLAGS -Wlogical-op" + found="yes" + fi + fi + + # These are currently disabled because they are noisy. They will be enabled # in the future once the codebase is sufficiently modernized to silence # them. For now, I don't want them to drown out the other warnings. -# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) +# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual]) # Turn some warnings into errors, so we don't accidently get successful builds # when there are problems that should be fixed. @@ -14093,18 +14113,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=implicit" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=implicit" >&5 -$as_echo_n "checking if $CC supports-Werror=implicit... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=implicit" >&5 +$as_echo_n "checking if $CC supports -Werror=implicit... " >&6; } cacheid=xorg_cv_cc_flag__Werror_implicit if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -14142,18 +14162,18 @@ $as_echo "$supported" >&6; } fi if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED" >&5 -$as_echo_n "checking if $CC supports-errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED" >&5 +$as_echo_n "checking if $CC supports -errwarn=E_NO_EXPLICIT_TYPE_GIVEN -errwarn=E_NO_IMPLICIT_DECL_ALLOWED... " >&6; } cacheid=xorg_cv_cc_flag__errwarn_E_NO_EXPLICIT_TYPE_GIVEN__errwarn_E_NO_IMPLICIT_DECL_ALLOWED if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -14260,18 +14280,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=nonnull" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=nonnull" >&5 -$as_echo_n "checking if $CC supports-Werror=nonnull... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=nonnull" >&5 +$as_echo_n "checking if $CC supports -Werror=nonnull... " >&6; } cacheid=xorg_cv_cc_flag__Werror_nonnull if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -14378,18 +14398,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=init-self" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=init-self" >&5 -$as_echo_n "checking if $CC supports-Werror=init-self... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=init-self" >&5 +$as_echo_n "checking if $CC supports -Werror=init-self... " >&6; } cacheid=xorg_cv_cc_flag__Werror_init_self if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -14496,18 +14516,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=main" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=main" >&5 -$as_echo_n "checking if $CC supports-Werror=main... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=main" >&5 +$as_echo_n "checking if $CC supports -Werror=main... " >&6; } cacheid=xorg_cv_cc_flag__Werror_main if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -14614,18 +14634,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=missing-braces" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=missing-braces" >&5 -$as_echo_n "checking if $CC supports-Werror=missing-braces... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=missing-braces" >&5 +$as_echo_n "checking if $CC supports -Werror=missing-braces... " >&6; } cacheid=xorg_cv_cc_flag__Werror_missing_braces if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -14732,18 +14752,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=sequence-point" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=sequence-point" >&5 -$as_echo_n "checking if $CC supports-Werror=sequence-point... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=sequence-point" >&5 +$as_echo_n "checking if $CC supports -Werror=sequence-point... " >&6; } cacheid=xorg_cv_cc_flag__Werror_sequence_point if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -14850,18 +14870,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=return-type" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=return-type" >&5 -$as_echo_n "checking if $CC supports-Werror=return-type... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=return-type" >&5 +$as_echo_n "checking if $CC supports -Werror=return-type... " >&6; } cacheid=xorg_cv_cc_flag__Werror_return_type if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -14899,18 +14919,18 @@ $as_echo "$supported" >&6; } fi if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -errwarn=E_FUNC_HAS_NO_RETURN_STMT" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-errwarn=E_FUNC_HAS_NO_RETURN_STMT" >&5 -$as_echo_n "checking if $CC supports-errwarn=E_FUNC_HAS_NO_RETURN_STMT... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -errwarn=E_FUNC_HAS_NO_RETURN_STMT" >&5 +$as_echo_n "checking if $CC supports -errwarn=E_FUNC_HAS_NO_RETURN_STMT... " >&6; } cacheid=xorg_cv_cc_flag__errwarn_E_FUNC_HAS_NO_RETURN_STMT if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -15017,18 +15037,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=trigraphs" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=trigraphs" >&5 -$as_echo_n "checking if $CC supports-Werror=trigraphs... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=trigraphs" >&5 +$as_echo_n "checking if $CC supports -Werror=trigraphs... " >&6; } cacheid=xorg_cv_cc_flag__Werror_trigraphs if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -15135,18 +15155,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=array-bounds" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=array-bounds" >&5 -$as_echo_n "checking if $CC supports-Werror=array-bounds... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=array-bounds" >&5 +$as_echo_n "checking if $CC supports -Werror=array-bounds... " >&6; } cacheid=xorg_cv_cc_flag__Werror_array_bounds if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -15253,18 +15273,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=write-strings" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=write-strings" >&5 -$as_echo_n "checking if $CC supports-Werror=write-strings... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=write-strings" >&5 +$as_echo_n "checking if $CC supports -Werror=write-strings... " >&6; } cacheid=xorg_cv_cc_flag__Werror_write_strings if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -15371,18 +15391,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=address" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=address" >&5 -$as_echo_n "checking if $CC supports-Werror=address... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=address" >&5 +$as_echo_n "checking if $CC supports -Werror=address... " >&6; } cacheid=xorg_cv_cc_flag__Werror_address if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -15489,18 +15509,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=int-to-pointer-cast" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=int-to-pointer-cast" >&5 -$as_echo_n "checking if $CC supports-Werror=int-to-pointer-cast... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=int-to-pointer-cast" >&5 +$as_echo_n "checking if $CC supports -Werror=int-to-pointer-cast... " >&6; } cacheid=xorg_cv_cc_flag__Werror_int_to_pointer_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -15538,18 +15558,18 @@ $as_echo "$supported" >&6; } fi if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -errwarn=E_BAD_PTR_INT_COMBINATION" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-errwarn=E_BAD_PTR_INT_COMBINATION" >&5 -$as_echo_n "checking if $CC supports-errwarn=E_BAD_PTR_INT_COMBINATION... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -errwarn=E_BAD_PTR_INT_COMBINATION" >&5 +$as_echo_n "checking if $CC supports -errwarn=E_BAD_PTR_INT_COMBINATION... " >&6; } cacheid=xorg_cv_cc_flag__errwarn_E_BAD_PTR_INT_COMBINATION if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -15656,18 +15676,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=pointer-to-int-cast" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=pointer-to-int-cast" >&5 -$as_echo_n "checking if $CC supports-Werror=pointer-to-int-cast... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=pointer-to-int-cast" >&5 +$as_echo_n "checking if $CC supports -Werror=pointer-to-int-cast... " >&6; } cacheid=xorg_cv_cc_flag__Werror_pointer_to_int_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -15777,18 +15797,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wimplicit" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wimplicit" >&5 -$as_echo_n "checking if $CC supports-Wimplicit... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wimplicit" >&5 +$as_echo_n "checking if $CC supports -Wimplicit... " >&6; } cacheid=xorg_cv_cc_flag__Wimplicit if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -15895,18 +15915,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wnonnull" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wnonnull" >&5 -$as_echo_n "checking if $CC supports-Wnonnull... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wnonnull" >&5 +$as_echo_n "checking if $CC supports -Wnonnull... " >&6; } cacheid=xorg_cv_cc_flag__Wnonnull if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -16013,18 +16033,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Winit-self" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Winit-self" >&5 -$as_echo_n "checking if $CC supports-Winit-self... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Winit-self" >&5 +$as_echo_n "checking if $CC supports -Winit-self... " >&6; } cacheid=xorg_cv_cc_flag__Winit_self if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -16131,18 +16151,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmain" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wmain" >&5 -$as_echo_n "checking if $CC supports-Wmain... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmain" >&5 +$as_echo_n "checking if $CC supports -Wmain... " >&6; } cacheid=xorg_cv_cc_flag__Wmain if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -16249,18 +16269,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wmissing-braces" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wmissing-braces" >&5 -$as_echo_n "checking if $CC supports-Wmissing-braces... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-braces" >&5 +$as_echo_n "checking if $CC supports -Wmissing-braces... " >&6; } cacheid=xorg_cv_cc_flag__Wmissing_braces if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -16367,18 +16387,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wsequence-point" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wsequence-point" >&5 -$as_echo_n "checking if $CC supports-Wsequence-point... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wsequence-point" >&5 +$as_echo_n "checking if $CC supports -Wsequence-point... " >&6; } cacheid=xorg_cv_cc_flag__Wsequence_point if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -16485,18 +16505,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wreturn-type" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wreturn-type" >&5 -$as_echo_n "checking if $CC supports-Wreturn-type... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wreturn-type" >&5 +$as_echo_n "checking if $CC supports -Wreturn-type... " >&6; } cacheid=xorg_cv_cc_flag__Wreturn_type if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -16603,18 +16623,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wtrigraphs" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wtrigraphs" >&5 -$as_echo_n "checking if $CC supports-Wtrigraphs... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wtrigraphs" >&5 +$as_echo_n "checking if $CC supports -Wtrigraphs... " >&6; } cacheid=xorg_cv_cc_flag__Wtrigraphs if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -16721,18 +16741,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Warray-bounds" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Warray-bounds" >&5 -$as_echo_n "checking if $CC supports-Warray-bounds... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Warray-bounds" >&5 +$as_echo_n "checking if $CC supports -Warray-bounds... " >&6; } cacheid=xorg_cv_cc_flag__Warray_bounds if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -16839,18 +16859,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wwrite-strings" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wwrite-strings" >&5 -$as_echo_n "checking if $CC supports-Wwrite-strings... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wwrite-strings" >&5 +$as_echo_n "checking if $CC supports -Wwrite-strings... " >&6; } cacheid=xorg_cv_cc_flag__Wwrite_strings if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -16957,18 +16977,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Waddress" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Waddress" >&5 -$as_echo_n "checking if $CC supports-Waddress... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Waddress" >&5 +$as_echo_n "checking if $CC supports -Waddress... " >&6; } cacheid=xorg_cv_cc_flag__Waddress if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -17075,18 +17095,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wint-to-pointer-cast" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wint-to-pointer-cast" >&5 -$as_echo_n "checking if $CC supports-Wint-to-pointer-cast... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wint-to-pointer-cast" >&5 +$as_echo_n "checking if $CC supports -Wint-to-pointer-cast... " >&6; } cacheid=xorg_cv_cc_flag__Wint_to_pointer_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -17193,18 +17213,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Wpointer-to-int-cast" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Wpointer-to-int-cast" >&5 -$as_echo_n "checking if $CC supports-Wpointer-to-int-cast... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wpointer-to-int-cast" >&5 +$as_echo_n "checking if $CC supports -Wpointer-to-int-cast... " >&6; } cacheid=xorg_cv_cc_flag__Wpointer_to_int_cast if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -17344,18 +17364,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -pedantic" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-pedantic" >&5 -$as_echo_n "checking if $CC supports-pedantic... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -pedantic" >&5 +$as_echo_n "checking if $CC supports -pedantic... " >&6; } cacheid=xorg_cv_cc_flag__pedantic if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -17462,18 +17482,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror" >&5 -$as_echo_n "checking if $CC supports-Werror... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror" >&5 +$as_echo_n "checking if $CC supports -Werror... " >&6; } cacheid=xorg_cv_cc_flag__Werror if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -17511,18 +17531,18 @@ $as_echo "$supported" >&6; } fi if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -errwarn" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-errwarn" >&5 -$as_echo_n "checking if $CC supports-errwarn... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -errwarn" >&5 +$as_echo_n "checking if $CC supports -errwarn... " >&6; } cacheid=xorg_cv_cc_flag__errwarn if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -17632,18 +17652,18 @@ fi found="no" if test $found = "no" ; then - if test "x$xorg_testset_unknown_warning_option" = "xyes" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unknown-warning-option" fi - if test "x$xorg_testset_unused_command_line_argument" = "xyes" ; then + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi CFLAGS="$CFLAGS -Werror=attributes" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports-Werror=attributes" >&5 -$as_echo_n "checking if $CC supports-Werror=attributes... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Werror=attributes" >&5 +$as_echo_n "checking if $CC supports -Werror=attributes... " >&6; } cacheid=xorg_cv_cc_flag__Werror_attributes if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 @@ -18471,40 +18491,6 @@ $as_echo "yes" >&6; } fi # Transport selection macro from xtrans.m4 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 -$as_echo_n "checking return type of signal handlers... " >&6; } -if ${ac_cv_type_signal+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include - -int -main () -{ -return *(signal (0, 0)) (0) == 1; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_type_signal=int -else - ac_cv_type_signal=void -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 -$as_echo "$ac_cv_type_signal" >&6; } - -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal -_ACEOF - - - case $host_os in @@ -18695,7 +18681,6 @@ _ACEOF LIBS="-lws2_32 $LIBS" fi -ac_cv_lib_ws2_32=ac_cv_lib_ws2_32_main fi @@ -18752,6 +18737,57 @@ _ACEOF fi + # XPG4v2/UNIX95 added msg_control - check to see if we need to define + # _XOPEN_SOURCE to get it (such as on Solaris) + ac_fn_c_check_member "$LINENO" "struct msghdr" "msg_control" "ac_cv_member_struct_msghdr_msg_control" " +$ac_includes_default +#include + +" +if test "x$ac_cv_member_struct_msghdr_msg_control" = xyes; then : + +fi + + # First try for Solaris in C99 compliant mode, which requires XPG6/UNIX03 + if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then + unset ac_cv_member_struct_msghdr_msg_control + { $as_echo "$as_me:${as_lineno-$LINENO}: trying again with _XOPEN_SOURCE=600" >&5 +$as_echo "$as_me: trying again with _XOPEN_SOURCE=600" >&6;} + ac_fn_c_check_member "$LINENO" "struct msghdr" "msg_control" "ac_cv_member_struct_msghdr_msg_control" " +#define _XOPEN_SOURCE 600 +$ac_includes_default +#include + +" +if test "x$ac_cv_member_struct_msghdr_msg_control" = xyes; then : + +$as_echo "#define _XOPEN_SOURCE 600" >>confdefs.h + + +fi + + fi + # If that didn't work, fall back to XPG5/UNIX98 with C89 + if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then + unset ac_cv_member_struct_msghdr_msg_control + { $as_echo "$as_me:${as_lineno-$LINENO}: trying again with _XOPEN_SOURCE=500" >&5 +$as_echo "$as_me: trying again with _XOPEN_SOURCE=500" >&6;} + ac_fn_c_check_member "$LINENO" "struct msghdr" "msg_control" "ac_cv_member_struct_msghdr_msg_control" " +#define _XOPEN_SOURCE 500 +$ac_includes_default +#include + +" +if test "x$ac_cv_member_struct_msghdr_msg_control" = xyes; then : + +$as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h + + +fi + + fi + + fi case $host_os in @@ -18781,6 +18817,51 @@ $as_echo "#define ICE_t 1" >>confdefs.h # Checks for library functions. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for arc4random_buf in -lbsd" >&5 +$as_echo_n "checking for arc4random_buf in -lbsd... " >&6; } +if ${ac_cv_lib_bsd_arc4random_buf+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbsd $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char arc4random_buf (); +int +main () +{ +return arc4random_buf (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_bsd_arc4random_buf=yes +else + ac_cv_lib_bsd_arc4random_buf=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_bsd_arc4random_buf" >&5 +$as_echo "$ac_cv_lib_bsd_arc4random_buf" >&6; } +if test "x$ac_cv_lib_bsd_arc4random_buf" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBBSD 1 +_ACEOF + + LIBS="-lbsd $LIBS" + +fi + for ac_func in asprintf arc4random_buf do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` @@ -19063,10 +19144,6 @@ else am__EXEEXT_FALSE= fi -if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then - as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. -Usually this means the macro was only invoked conditionally." "$LINENO" 5 -fi if test -z "${ENABLE_DOCS_TRUE}" && test -z "${ENABLE_DOCS_FALSE}"; then as_fn_error $? "conditional \"ENABLE_DOCS\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -19500,7 +19577,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libICE $as_me 1.0.8, which was +This file was extended by libICE $as_me 1.0.9, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -19566,7 +19643,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libICE config.status 1.0.8 +libICE config.status 1.0.9 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/lib/libICE/configure.ac b/lib/libICE/configure.ac index 46b949a9e..458882a15 100644 --- a/lib/libICE/configure.ac +++ b/lib/libICE/configure.ac @@ -1,7 +1,7 @@ # Initialize Autoconf AC_PREREQ([2.60]) -AC_INIT([libICE], [1.0.8], +AC_INIT([libICE], [1.0.9], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libICE]) AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_HEADERS([config.h]) @@ -13,7 +13,6 @@ AC_USE_SYSTEM_EXTENSIONS # Initialize Automake AM_INIT_AUTOMAKE([foreign dist-bzip2]) -AM_MAINTAINER_MODE # Initialize libtool AC_PROG_LIBTOOL @@ -38,6 +37,7 @@ XTRANS_CONNECTION_FLAGS AC_DEFINE(ICE_t, 1, [Xtrans transport type]) # Checks for library functions. +AC_CHECK_LIB([bsd], [arc4random_buf]) AC_CHECK_FUNCS([asprintf arc4random_buf]) # Allow checking code with lint, sparse, etc. diff --git a/lib/libICE/doc/Makefile.in b/lib/libICE/doc/Makefile.in index da5e9e96a..cfa77e5c5 100644 --- a/lib/libICE/doc/Makefile.in +++ b/lib/libICE/doc/Makefile.in @@ -192,7 +192,6 @@ LINT_FLAGS = @LINT_FLAGS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -347,7 +346,7 @@ top_srcdir = @top_srcdir@ all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/docbook.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/docbook.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -373,9 +372,9 @@ $(top_srcdir)/docbook.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/lib/libICE/include/X11/ICE/ICEmsg.h b/lib/libICE/include/X11/ICE/ICEmsg.h index 8ca3e5f22..f6e712175 100644 --- a/lib/libICE/include/X11/ICE/ICEmsg.h +++ b/lib/libICE/include/X11/ICE/ICEmsg.h @@ -161,10 +161,10 @@ extern IcePaAuthStatus _IcePaMagicCookie1Proc ( IceGetHeader (_iceConn, _offendingMajorOpcode, ICE_Error, \ SIZEOF (iceErrorMsg), iceErrorMsg, _pMsg); \ _pMsg->length += (_dataLength); \ - _pMsg->offendingMinorOpcode = _offendingMinorOpcode; \ - _pMsg->severity = _severity; \ - _pMsg->offendingSequenceNum = _offendingSequenceNum; \ - _pMsg->errorClass = _errorClass; \ + _pMsg->offendingMinorOpcode = (CARD8) _offendingMinorOpcode; \ + _pMsg->severity = (CARD8) _severity; \ + _pMsg->offendingSequenceNum = (CARD32) _offendingSequenceNum; \ + _pMsg->errorClass = (CARD16) _errorClass; \ } @@ -186,20 +186,12 @@ extern IcePaAuthStatus _IcePaMagicCookie1Proc ( } \ } -#ifndef WORD64 - #define IceWriteData16(_iceConn, _bytes, _data) \ IceWriteData (_iceConn, _bytes, (char *) _data) #define IceWriteData32(_iceConn, _bytes, _data) \ IceWriteData (_iceConn, _bytes, (char *) _data) -#else /* WORD64 */ - -/* IceWriteData16 and IceWriteData32 defined in misc.c for WORD64 */ - -#endif /* WORD64 */ - /* * The IceSendData macro bypasses copying the data to the @@ -252,7 +244,7 @@ extern IcePaAuthStatus _IcePaMagicCookie1Proc ( } \ else \ { \ - _pData = (char *) malloc ((unsigned) _bytes); \ + _pData = malloc (_bytes); \ if (_pData) \ _IceRead (_iceConn, _bytes, _pData); \ else \ @@ -263,7 +255,7 @@ extern IcePaAuthStatus _IcePaMagicCookie1Proc ( #define IceDisposeCompleteMessage(_iceConn, _pData) \ if ((char *) _pData < _iceConn->inbuf || \ (char *) _pData >= _iceConn->inbufmax) \ - free ((char *) _pData); + free (_pData); #define IceReadSimpleMessage(_iceConn, _msgType, _pMsg) \ @@ -281,8 +273,6 @@ extern IcePaAuthStatus _IcePaMagicCookie1Proc ( #define IceReadData(_iceConn, _bytes, _pData) \ _IceRead (_iceConn, (unsigned long) (_bytes), (char *) _pData); \ -#ifndef WORD64 - #define IceReadData16(_iceConn, _swap, _bytes, _pData) \ { \ _IceRead (_iceConn, (unsigned long) (_bytes), (char *) _pData); \ @@ -293,12 +283,6 @@ extern IcePaAuthStatus _IcePaMagicCookie1Proc ( _IceRead (_iceConn, (unsigned long) (_bytes), (char *) _pData); \ } -#else /* WORD64 */ - -/* IceReadData16 and IceReadData32 defined in misc.c for WORD64 */ - -#endif /* WORD64 */ - /* * Read pad bytes (for 32 or 64 bit alignment). diff --git a/lib/libICE/include/X11/ICE/ICEutil.h b/lib/libICE/include/X11/ICE/ICEutil.h index 9c6b12f58..dbf14909f 100644 --- a/lib/libICE/include/X11/ICE/ICEutil.h +++ b/lib/libICE/include/X11/ICE/ICEutil.h @@ -81,14 +81,14 @@ extern char *IceAuthFileName ( ); extern int IceLockAuthFile ( - char * /* file_name */, + const char * /* file_name */, int /* retries */, int /* timeout */, long /* dead */ ); extern void IceUnlockAuthFile ( - char * /* file_name */ + const char * /* file_name */ ); extern IceAuthFileEntry *IceReadAuthFileEntry ( diff --git a/lib/libICE/specs/Makefile.in b/lib/libICE/specs/Makefile.in index a3b7cd183..4fffc16dd 100644 --- a/lib/libICE/specs/Makefile.in +++ b/lib/libICE/specs/Makefile.in @@ -192,7 +192,6 @@ LINT_FLAGS = @LINT_FLAGS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -347,7 +346,7 @@ top_srcdir = @top_srcdir@ all: all-am .SUFFIXES: -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/docbook.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(top_srcdir)/docbook.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -373,9 +372,9 @@ $(top_srcdir)/docbook.am: $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): diff --git a/lib/libICE/src/ICElibint.h b/lib/libICE/src/ICElibint.h index 0638fb033..86a5406bb 100644 --- a/lib/libICE/src/ICElibint.h +++ b/lib/libICE/src/ICElibint.h @@ -58,7 +58,7 @@ Author: Ralph Mor, X Consortium #define PAD64(_bytes) ((8 - ((unsigned int) (_bytes) % 8)) % 8) -#define PADDED_BYTES64(_bytes) (_bytes + PAD64 (_bytes)) +#define PADDED_BYTES64(_bytes) ((unsigned int) _bytes + PAD64 (_bytes)) /* @@ -67,7 +67,7 @@ Author: Ralph Mor, X Consortium #define PAD32(_bytes) ((4 - ((unsigned int) (_bytes) % 4)) % 4) -#define PADDED_BYTES32(_bytes) (_bytes + PAD32 (_bytes)) +#define PADDED_BYTES32(_bytes) ((unsigned int) _bytes + PAD32 (_bytes)) /* @@ -155,8 +155,6 @@ typedef struct { _pBuf += 1; \ } -#ifndef WORD64 - #define STORE_CARD16(_pBuf, _val) \ { \ *((CARD16 *) _pBuf) = _val; \ @@ -169,34 +167,10 @@ typedef struct { _pBuf += 4; \ } -#else /* WORD64 */ - -#define STORE_CARD16(_pBuf, _val) \ -{ \ - struct { \ - int value :16; \ - int pad :16; \ - } _d; \ - _d.value = _val; \ - memcpy (_pBuf, &_d, 2); \ - _pBuf += 2; \ -} - -#define STORE_CARD32(_pBuf, _val) \ -{ \ - struct { \ - int value :32; \ - } _d; \ - _d.value = _val; \ - memcpy (_pBuf, &_d, 4); \ - _pBuf += 4; \ -} - -#endif /* WORD64 */ #define STORE_STRING(_pBuf, _string) \ { \ - CARD16 _len = strlen (_string); \ + CARD16 _len = (CARD16) strlen (_string); \ STORE_CARD16 (_pBuf, _len); \ memcpy (_pBuf, _string, _len); \ _pBuf += _len; \ @@ -215,8 +189,6 @@ typedef struct { _pBuf += 1; \ } -#ifndef WORD64 - #define EXTRACT_CARD16(_pBuf, _swap, _val) \ { \ _val = *((CARD16 *) _pBuf); \ @@ -233,39 +205,12 @@ typedef struct { _val = lswapl (_val); \ } -#else /* WORD64 */ - -#define EXTRACT_CARD16(_pBuf, _swap, _val) \ -{ \ - _val = *(_pBuf + 0) & 0xff; /* 0xff incase _pBuf is signed */ \ - _val <<= 8; \ - _val |= *(_pBuf + 1) & 0xff;\ - _pBuf += 2; \ - if (_swap) \ - _val = lswaps (_val); \ -} - -#define EXTRACT_CARD32(_pBuf, _swap, _val) \ -{ \ - _val = *(_pBuf + 0) & 0xff; /* 0xff incase _pBuf is signed */ \ - _val <<= 8; \ - _val |= *(_pBuf + 1) & 0xff;\ - _val <<= 8; \ - _val |= *(_pBuf + 2) & 0xff;\ - _val <<= 8; \ - _val |= *(_pBuf + 3) & 0xff;\ - _pBuf += 4; \ - if (_swap) \ - _val = lswapl (_val); \ -} - -#endif /* WORD64 */ #define EXTRACT_STRING(_pBuf, _swap, _string) \ { \ CARD16 _len; \ EXTRACT_CARD16 (_pBuf, _swap, _len); \ - _string = (char *) malloc (_len + 1); \ + _string = malloc (_len + 1); \ memcpy (_string, _pBuf, _len); \ _pBuf += _len; \ _string[_len] = '\0'; \ diff --git a/lib/libICE/src/Makefile.in b/lib/libICE/src/Makefile.in index bce391aa9..72ebf5e5c 100644 --- a/lib/libICE/src/Makefile.in +++ b/lib/libICE/src/Makefile.in @@ -209,7 +209,6 @@ LINT_FLAGS = @LINT_FLAGS@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ -MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MAN_SUBSTS = @MAN_SUBSTS@ @@ -346,7 +345,7 @@ all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj -$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) +$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ @@ -371,9 +370,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) +$(top_srcdir)/configure: $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh -$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) +$(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-libLTLIBRARIES: $(lib_LTLIBRARIES) diff --git a/lib/libICE/src/accept.c b/lib/libICE/src/accept.c index 6bc40adc9..610e01b8b 100644 --- a/lib/libICE/src/accept.c +++ b/lib/libICE/src/accept.c @@ -70,7 +70,7 @@ IceAcceptConnection ( * Create an ICE object for this connection. */ - if ((iceConn = (IceConn) malloc (sizeof (struct _IceConn))) == NULL) + if ((iceConn = malloc (sizeof (struct _IceConn))) == NULL) { _IceTransClose (newconn); *statusRet = IceAcceptBadMalloc; @@ -95,7 +95,7 @@ IceAcceptConnection ( if (iceConn->connection_string == NULL) { _IceTransClose (newconn); - free ((char *) iceConn); + free (iceConn); *statusRet = IceAcceptBadMalloc; return (NULL); } @@ -103,29 +103,29 @@ IceAcceptConnection ( iceConn->vendor = NULL; iceConn->release = NULL; - if ((iceConn->inbuf = iceConn->inbufptr = - (char *) malloc (ICE_INBUFSIZE)) != NULL) + if ((iceConn->inbuf = iceConn->inbufptr = malloc (ICE_INBUFSIZE)) != NULL) { iceConn->inbufmax = iceConn->inbuf + ICE_INBUFSIZE; } else { _IceTransClose (newconn); - free ((char *) iceConn); + free (iceConn->connection_string); + free (iceConn); *statusRet = IceAcceptBadMalloc; return (NULL); } - if ((iceConn->outbuf = iceConn->outbufptr = - (char *) malloc (ICE_OUTBUFSIZE)) != NULL) + if ((iceConn->outbuf = iceConn->outbufptr = malloc (ICE_OUTBUFSIZE)) != NULL) { iceConn->outbufmax = iceConn->outbuf + ICE_OUTBUFSIZE; } else { _IceTransClose (newconn); + free (iceConn->connection_string); free (iceConn->inbuf); - free ((char *) iceConn); + free (iceConn); *statusRet = IceAcceptBadMalloc; return (NULL); } diff --git a/lib/libICE/src/authutil.c b/lib/libICE/src/authutil.c index 6c00482d2..04c07911d 100644 --- a/lib/libICE/src/authutil.c +++ b/lib/libICE/src/authutil.c @@ -35,13 +35,10 @@ Author: Ralph Mor, X Consortium #include #include #include +#include #include #define Time_t time_t -#ifdef __UNIXOS2__ -extern char* getenv(const char*); -#define link rename -#endif #ifndef X_NOT_POSIX #include #else @@ -56,8 +53,8 @@ static Status read_short (FILE *file, unsigned short *shortp); static Status read_string (FILE *file, char **stringp); static Status read_counted_string (FILE *file, unsigned short *countp, char **stringp); static Status write_short (FILE *file, unsigned short s); -static Status write_string (FILE *file, char *string); -static Status write_counted_string (FILE *file, unsigned short count, char *string); +static Status write_string (FILE *file, const char *string); +static Status write_counted_string (FILE *file, unsigned short count, const char *string); @@ -73,9 +70,9 @@ IceAuthFileName (void) static char slashDotICEauthority[] = "/.ICEauthority"; char *name; static char *buf; - static int bsize; - int size; -#if defined(WIN32) || defined(__UNIXOS2__) + static size_t bsize; + size_t size; +#ifdef WIN32 #ifndef PATH_MAX #define PATH_MAX 512 #endif @@ -102,15 +99,10 @@ IceAuthFileName (void) len2 = strlen (ptr2); } if ((len1 + len2 + 1) < PATH_MAX) { - sprintf (dir, "%s%s", ptr1, (ptr2) ? ptr2 : ""); + snprintf (dir, sizeof(dir), "%s%s", ptr1, (ptr2) ? ptr2 : ""); name = dir; } if (!name) -#endif -#ifdef __UNIXOS2__ - strcpy (dir,"c:"); - name = dir; - if (!name) #endif return (NULL); } @@ -121,14 +113,14 @@ IceAuthFileName (void) { if (buf) free (buf); - buf = malloc ((unsigned) size); + buf = malloc (size); if (!buf) return (NULL); bsize = size; } - strcpy (buf, name); - strcat (buf, slashDotICEauthority + (name[1] == '\0' ? 1 : 0)); + snprintf (buf, bsize, "%s%s", name, + slashDotICEauthority + (name[1] == '\0' ? 1 : 0)); return (buf); } @@ -137,7 +129,7 @@ IceAuthFileName (void) int IceLockAuthFile ( - char *file_name, + const char *file_name, int retries, int timeout, long dead @@ -151,10 +143,8 @@ IceLockAuthFile ( if ((int) strlen (file_name) > 1022) return (IceAuthLockError); - strcpy (creat_name, file_name); - strcat (creat_name, "-c"); - strcpy (link_name, file_name); - strcat (link_name, "-l"); + snprintf (creat_name, sizeof(creat_name), "%s-c", file_name); + snprintf (link_name, sizeof(link_name), "%s-l", file_name); if (stat (creat_name, &statb) != -1) { @@ -213,7 +203,7 @@ IceLockAuthFile ( void IceUnlockAuthFile ( - char *file_name + const char *file_name ) { #ifndef WIN32 @@ -225,15 +215,10 @@ IceUnlockAuthFile ( return; #ifndef WIN32 - strcpy (creat_name, file_name); - strcat (creat_name, "-c"); -#endif - strcpy (link_name, file_name); - strcat (link_name, "-l"); - -#ifndef WIN32 + snprintf (creat_name, sizeof(creat_name), "%s-c", file_name); unlink (creat_name); #endif + snprintf (link_name, sizeof(link_name), "%s-l", file_name); unlink (link_name); } @@ -270,7 +255,7 @@ IceReadAuthFileEntry ( &local.auth_data_length, &local.auth_data)) goto bad; - if (!(ret = (IceAuthFileEntry *) malloc (sizeof (IceAuthFileEntry)))) + if (!(ret = malloc (sizeof (IceAuthFileEntry)))) goto bad; *ret = local; @@ -302,7 +287,7 @@ IceFreeAuthFileEntry ( if (auth->network_id) free (auth->network_id); if (auth->auth_name) free (auth->auth_name); if (auth->auth_data) free (auth->auth_data); - free ((char *) auth); + free (auth); } } @@ -387,7 +372,7 @@ read_short (FILE *file, unsigned short *shortp) { unsigned char file_short[2]; - if (fread ((char *) file_short, (int) sizeof (file_short), 1, file) != 1) + if (fread (file_short, sizeof (file_short), 1, file) != 1) return (0); *shortp = file_short[0] * 256 + file_short[1]; @@ -412,7 +397,7 @@ read_string (FILE *file, char **stringp) if (len != 0) { - if (fread (data, (int) sizeof (char), (int) len, file) != len) + if (fread (data, sizeof (char), len, file) != len) { free (data); return (0); @@ -447,7 +432,7 @@ read_counted_string (FILE *file, unsigned short *countp, char **stringp) if (!data) return (0); - if (fread (data, (int) sizeof (char), (int) len, file) != len) + if (fread (data, sizeof (char), len, file) != len) { free (data); return (0); @@ -469,7 +454,7 @@ write_short (FILE *file, unsigned short s) file_short[0] = (s & (unsigned) 0xff00) >> 8; file_short[1] = s & 0xff; - if (fwrite ((char *) file_short, (int) sizeof (file_short), 1, file) != 1) + if (fwrite (file_short, sizeof (file_short), 1, file) != 1) return (0); return (1); @@ -477,27 +462,24 @@ write_short (FILE *file, unsigned short s) static Status -write_string (FILE *file, char *string) +write_string (FILE *file, const char *string) { - unsigned short count = strlen (string); + size_t count = strlen (string); - if (!write_short (file, count)) + if (count > USHRT_MAX) return (0); - if (fwrite (string, (int) sizeof (char), (int) count, file) != count) - return (0); - - return (1); + return write_counted_string (file, (unsigned short) count, string); } static Status -write_counted_string (FILE *file, unsigned short count, char *string) +write_counted_string (FILE *file, unsigned short count, const char *string) { if (!write_short (file, count)) return (0); - if (fwrite (string, (int) sizeof (char), (int) count, file) != count) + if (fwrite (string, sizeof (char), count, file) != count) return (0); return (1); diff --git a/lib/libICE/src/connect.c b/lib/libICE/src/connect.c index b59e94c10..276a356f5 100644 --- a/lib/libICE/src/connect.c +++ b/lib/libICE/src/connect.c @@ -144,7 +144,7 @@ IceOpenConnection ( } } - if ((iceConn = (IceConn) malloc (sizeof (struct _IceConn))) == NULL) + if ((iceConn = malloc (sizeof (struct _IceConn))) == NULL) { strncpy (errorStringRet, "Can't malloc", errorLength); return (NULL); @@ -158,7 +158,7 @@ IceOpenConnection ( if ((iceConn->trans_conn = ConnectToPeer (networkIdsList, &iceConn->connection_string)) == NULL) { - free ((char *) iceConn); + free (iceConn); strncpy (errorStringRet, "Could not open network socket", errorLength); return (NULL); } @@ -194,8 +194,7 @@ IceOpenConnection ( iceConn->connect_to_me = NULL; iceConn->protosetup_to_me = NULL; - if ((iceConn->inbuf = iceConn->inbufptr = - (char *) malloc (ICE_INBUFSIZE)) == NULL) + if ((iceConn->inbuf = iceConn->inbufptr = malloc (ICE_INBUFSIZE)) == NULL) { _IceFreeConnection (iceConn); strncpy (errorStringRet, "Can't malloc", errorLength); @@ -204,8 +203,7 @@ IceOpenConnection ( iceConn->inbufmax = iceConn->inbuf + ICE_INBUFSIZE; - if ((iceConn->outbuf = iceConn->outbufptr = - (char *) calloc (1, ICE_OUTBUFSIZE)) == NULL) + if ((iceConn->outbuf = iceConn->outbufptr = calloc (1, ICE_OUTBUFSIZE)) == NULL) { _IceFreeConnection (iceConn); strncpy (errorStringRet, "Can't malloc", errorLength); @@ -224,8 +222,7 @@ IceOpenConnection ( iceConn->saved_reply_waits = NULL; iceConn->ping_waits = NULL; - iceConn->connect_to_you = (_IceConnectToYouInfo *) malloc ( - sizeof (_IceConnectToYouInfo)); + iceConn->connect_to_you = malloc (sizeof (_IceConnectToYouInfo)); iceConn->connect_to_you->auth_active = 0; /* @@ -392,7 +389,7 @@ IceOpenConnection ( iceConn->connection_string; _IceConnectionCount++; - free ((char *) iceConn->connect_to_you); + free (iceConn->connect_to_you); iceConn->connect_to_you = NULL; iceConn->connection_status = IceConnectAccepted; @@ -451,9 +448,9 @@ ConnectToPeer (char *networkIdsList, char **actualConnectionRet) char* address; char *ptr, *endptr, *delim; int madeConnection = 0; - int len, retry; - int connect_stat; - int address_size; + size_t len; + int retry, connect_stat; + size_t address_size; XtransConnInfo trans_conn = NULL; *actualConnectionRet = NULL; diff --git a/lib/libICE/src/getauth.c b/lib/libICE/src/getauth.c index e127206c3..09e0e1c77 100644 --- a/lib/libICE/src/getauth.c +++ b/lib/libICE/src/getauth.c @@ -70,7 +70,7 @@ _IceGetPoAuthData ( { *authDataLenRet = entry->auth_data_length; - if ((*authDataRet = (char *) malloc (entry->auth_data_length)) != NULL) + if ((*authDataRet = malloc (entry->auth_data_length)) != NULL) memcpy (*authDataRet, entry->auth_data, entry->auth_data_length); } else @@ -111,7 +111,7 @@ _IceGetPaAuthData ( { *authDataLenRet = entry->auth_data_length; - if ((*authDataRet = (char *) malloc (entry->auth_data_length)) != NULL) + if ((*authDataRet = malloc (entry->auth_data_length)) != NULL) memcpy (*authDataRet, entry->auth_data, entry->auth_data_length); } else diff --git a/lib/libICE/src/globals.h b/lib/libICE/src/globals.h index 965386ff6..a8b9e35e9 100644 --- a/lib/libICE/src/globals.h +++ b/lib/libICE/src/globals.h @@ -26,15 +26,9 @@ in this Software without prior written authorization from The Open Group. Author: Ralph Mor, X Consortium ******************************************************************************/ -#ifndef __UNIXOS2__ IceConn _IceConnectionObjs[256]; char *_IceConnectionStrings[256]; _IceProtocol _IceProtocols[255]; -#else -IceConn _IceConnectionObjs[256] = {0}; -char *_IceConnectionStrings[256] = {0}; -_IceProtocol _IceProtocols[255] = {0}; -#endif int _IceConnectionCount = 0; int _IceLastMajorOpcode = 0; diff --git a/lib/libICE/src/iceauth.c b/lib/libICE/src/iceauth.c index e0527e896..ef6662676 100644 --- a/lib/libICE/src/iceauth.c +++ b/lib/libICE/src/iceauth.c @@ -36,6 +36,10 @@ Author: Ralph Mor, X Consortium #include #define Time_t time_t +#ifdef HAVE_LIBBSD +#include /* for arc4random_buf() */ +#endif + static int was_called_state; /* @@ -50,12 +54,14 @@ IceGenerateMagicCookie ( ) { char *auth; +#ifndef HAVE_ARC4RANDOM_BUF long ldata[2]; int seed; int value; int i; +#endif - if ((auth = (char *) malloc (len + 1)) == NULL) + if ((auth = malloc (len + 1)) == NULL) return (NULL); #ifdef HAVE_ARC4RANDOM_BUF @@ -70,9 +76,7 @@ IceGenerateMagicCookie ( } #else { -#ifndef __UNIXOS2__ long time (); -#endif ldata[0] = time ((long *) 0); ldata[1] = getpid (); } diff --git a/lib/libICE/src/listen.c b/lib/libICE/src/listen.c index 0348fecc7..9a449ae8c 100644 --- a/lib/libICE/src/listen.c +++ b/lib/libICE/src/listen.c @@ -62,12 +62,11 @@ IceListenForConnections ( return (0); } - if ((listenObjs = (struct _IceListenObj *) malloc ( - transCount * sizeof (struct _IceListenObj))) == NULL) + if ((listenObjs = malloc (transCount * sizeof (struct _IceListenObj))) == NULL) { for (i = 0; i < transCount; i++) _IceTransClose (transConns[i]); - free ((char *) transConns); + free (transConns); return (0); } @@ -99,8 +98,7 @@ IceListenForConnections ( } else { - *listenObjsRet = (IceListenObj *) malloc ( - *countRet * sizeof (IceListenObj)); + *listenObjsRet = malloc (*countRet * sizeof (IceListenObj)); if (*listenObjsRet == NULL) { @@ -112,17 +110,16 @@ IceListenForConnections ( { for (i = 0; i < *countRet; i++) { - (*listenObjsRet)[i] = (IceListenObj) malloc ( - sizeof (struct _IceListenObj)); + (*listenObjsRet)[i] = malloc (sizeof (struct _IceListenObj)); if ((*listenObjsRet)[i] == NULL) { strncpy (errorStringRet, "Malloc failed", errorLength); for (j = 0; j < i; j++) - free ((char *) (*listenObjsRet)[j]); + free ((*listenObjsRet)[j]); - free ((char *) *listenObjsRet); + free (*listenObjsRet); *listenObjsRet = NULL; status = 0; @@ -152,8 +149,8 @@ IceListenForConnections ( _IceTransClose (transConns[i]); } - free ((char *) listenObjs); - free ((char *) transConns); + free (listenObjs); + free (transConns); return (status); } @@ -196,7 +193,7 @@ IceComposeNetworkIdList ( for (i = 0; i < count; i++) len += (strlen (listenObjs[i]->network_id) + 1); - list = (char *) malloc (len); + list = malloc (len); if (list == NULL) return (NULL); @@ -249,10 +246,10 @@ IceFreeListenObjs ( { free (listenObjs[i]->network_id); _IceTransClose (listenObjs[i]->trans_conn); - free ((char *) listenObjs[i]); + free (listenObjs[i]); } - free ((char *) listenObjs); + free (listenObjs); } diff --git a/lib/libICE/src/listenwk.c b/lib/libICE/src/listenwk.c index 06b56a348..7517ea80c 100644 --- a/lib/libICE/src/listenwk.c +++ b/lib/libICE/src/listenwk.c @@ -64,12 +64,11 @@ IceListenForWellKnownConnections ( return (0); } - if ((listenObjs = (struct _IceListenObj *) malloc ( - transCount * sizeof (struct _IceListenObj))) == NULL) + if ((listenObjs = malloc (transCount * sizeof (struct _IceListenObj))) == NULL) { for (i = 0; i < transCount; i++) _IceTransClose (transConns[i]); - free ((char *) transConns); + free (transConns); return (0); } @@ -99,8 +98,7 @@ IceListenForWellKnownConnections ( } else { - *listenObjsRet = (IceListenObj *) malloc ( - *countRet * sizeof (IceListenObj)); + *listenObjsRet = malloc (*countRet * sizeof (IceListenObj)); if (*listenObjsRet == NULL) { @@ -112,17 +110,16 @@ IceListenForWellKnownConnections ( { for (i = 0; i < *countRet; i++) { - (*listenObjsRet)[i] = (IceListenObj) malloc ( - sizeof (struct _IceListenObj)); + (*listenObjsRet)[i] = malloc (sizeof (struct _IceListenObj)); if ((*listenObjsRet)[i] == NULL) { strncpy (errorStringRet, "Malloc failed", errorLength); for (j = 0; j < i; j++) - free ((char *) (*listenObjsRet)[j]); + free ((*listenObjsRet)[j]); - free ((char *) *listenObjsRet); + free (*listenObjsRet); *listenObjsRet = NULL; status = 0; @@ -152,8 +149,8 @@ IceListenForWellKnownConnections ( _IceTransClose (transConns[i]); } - free ((char *) listenObjs); - free ((char *) transConns); + free (listenObjs); + free (transConns); return (status); } diff --git a/lib/libICE/src/misc.c b/lib/libICE/src/misc.c index e201fdaa8..d2e9150e0 100644 --- a/lib/libICE/src/misc.c +++ b/lib/libICE/src/misc.c @@ -57,7 +57,7 @@ IceAllocScratch ( if (iceConn->scratch) free (iceConn->scratch); - iceConn->scratch = (char *) malloc ((unsigned) size); + iceConn->scratch = malloc (size); iceConn->scratch_size = size; } @@ -406,91 +406,6 @@ _IceWrite ( } } -#ifdef WORD64 - -IceWriteData16 ( - IceConn iceConn, - unsigned long nbytes, - short *data -) -{ - int numShorts = nbytes / 2; - int index = 0; - - while (index < numShorts) - { - int spaceLeft, count, i; - int shortsLeft = numShorts - index; - - spaceLeft = iceConn->outbufmax - iceConn->outbufptr - 1; - - if (spaceLeft < 2) - { - IceFlush (iceConn); - spaceLeft = iceConn->outbufmax - iceConn->outbufptr - 1; - } - - count = (shortsLeft < spaceLeft / 2) ? shortsLeft : spaceLeft / 2; - - for (i = 0; i < count; i++) - STORE_CARD16 (iceConn->outbufptr, data[index++]); - } -} - - -IceWriteData32 ( - IceConn iceConn, - unsigned long nbytes, - int *data -) -{ - int numLongs = nbytes / 4; - int index = 0; - - while (index < numLongs) - { - int spaceLeft, count, i; - int longsLeft = numLongs - index; - - spaceLeft = iceConn->outbufmax - iceConn->outbufptr - 1; - - if (spaceLeft < 4) - { - IceFlush (iceConn); - spaceLeft = iceConn->outbufmax - iceConn->outbufptr - 1; - } - - count = (longsLeft < spaceLeft / 4) ? longsLeft : spaceLeft / 4; - - for (i = 0; i < count; i++) - STORE_CARD32 (iceConn->outbufptr, data[index++]); - } -} - - -IceReadData16 ( - IceConn iceConn, - Bool swap, - unsigned long nbytes, - short *data -) -{ - /* NOT IMPLEMENTED YET */ -} - - -IceReadData32 ( - IceConn iceConn, - Bool swap, - unsigned long nbytes, - int *data -) -{ - /* NOT IMPLEMENTED YET */ -} - -#endif /* WORD64 */ - void @@ -506,8 +421,7 @@ _IceAddOpcodeMapping ( } else if (iceConn->process_msg_info == NULL) { - iceConn->process_msg_info = (_IceProcessMsgInfo *) malloc ( - sizeof (_IceProcessMsgInfo)); + iceConn->process_msg_info = malloc (sizeof (_IceProcessMsgInfo)); iceConn->his_min_opcode = iceConn->his_max_opcode = hisOpcode; } else if (hisOpcode < iceConn->his_min_opcode) @@ -517,14 +431,14 @@ _IceAddOpcodeMapping ( int newsize = iceConn->his_max_opcode - hisOpcode + 1; int i; - iceConn->process_msg_info = (_IceProcessMsgInfo *) malloc ( + iceConn->process_msg_info = malloc ( newsize * sizeof (_IceProcessMsgInfo)); memcpy (&iceConn->process_msg_info[ iceConn->his_min_opcode - hisOpcode], oldVec, oldsize * sizeof (_IceProcessMsgInfo)); - free ((char *) oldVec); + free (oldVec); for (i = hisOpcode + 1; i < iceConn->his_min_opcode; i++) { @@ -544,13 +458,13 @@ _IceAddOpcodeMapping ( int newsize = hisOpcode - iceConn->his_min_opcode + 1; int i; - iceConn->process_msg_info = (_IceProcessMsgInfo *) malloc ( + iceConn->process_msg_info = malloc ( newsize * sizeof (_IceProcessMsgInfo)); memcpy (iceConn->process_msg_info, oldVec, oldsize * sizeof (_IceProcessMsgInfo)); - free ((char *) oldVec); + free (oldVec); for (i = iceConn->his_max_opcode + 1; i < hisOpcode; i++) { diff --git a/lib/libICE/src/ping.c b/lib/libICE/src/ping.c index 93d82de61..9cb539463 100644 --- a/lib/libICE/src/ping.c +++ b/lib/libICE/src/ping.c @@ -39,7 +39,7 @@ IcePing ( IcePointer clientData ) { - _IcePingWait *newping = (_IcePingWait *) malloc (sizeof (_IcePingWait)); + _IcePingWait *newping = malloc (sizeof (_IcePingWait)); _IcePingWait *ptr = iceConn->ping_waits; if (newping == NULL) diff --git a/lib/libICE/src/process.c b/lib/libICE/src/process.c index 2708ee8e4..f0c3369c9 100644 --- a/lib/libICE/src/process.c +++ b/lib/libICE/src/process.c @@ -921,7 +921,7 @@ ProcessConnectionSetup ( if ((hisAuthCount = message->authCount) > 0) { - hisAuthNames = (char **) malloc (hisAuthCount * sizeof (char *)); + hisAuthNames = malloc (hisAuthCount * sizeof (char *)); EXTRACT_LISTOF_STRING (pData, swap, hisAuthCount, hisAuthNames); } @@ -960,7 +960,7 @@ ProcessConnectionSetup ( for (i = 0; i < hisAuthCount; i++) free (hisAuthNames[i]); - free ((char *) hisAuthNames); + free (hisAuthNames); } IceDisposeCompleteMessage (iceConn, pStart); @@ -1056,7 +1056,7 @@ ProcessConnectionSetup ( AuthRequired (iceConn, hisAuthIndex, authDataLen, authData); - iceConn->connect_to_me = setupInfo = (_IceConnectToMeInfo *) + iceConn->connect_to_me = setupInfo = malloc (sizeof (_IceConnectToMeInfo)); setupInfo->my_version_index = myVersionIndex; @@ -1078,7 +1078,7 @@ ProcessConnectionSetup ( } if (authData && authDataLen > 0) - free ((char *) authData); + free (authData); if (errorString) free (errorString); @@ -1098,7 +1098,7 @@ ProcessConnectionSetup ( for (i = 0; i < hisAuthCount; i++) free (hisAuthNames[i]); - free ((char *) hisAuthNames); + free (hisAuthNames); } IceDisposeCompleteMessage (iceConn, pStart); @@ -1292,7 +1292,7 @@ ProcessAuthRequired ( } if (replyData && replyDataLen > 0) - free ((char *) replyData); + free (replyData); IceDisposeCompleteMessage (iceConn, authData); @@ -1377,7 +1377,7 @@ ProcessAuthReply ( { free (iceConn->connect_to_me->his_vendor); free (iceConn->connect_to_me->his_release); - free ((char *) iceConn->connect_to_me); + free (iceConn->connect_to_me); iceConn->connect_to_me = NULL; iceConn->connection_status = IceConnectRejected; @@ -1405,7 +1405,7 @@ ProcessAuthReply ( iceConn->my_ice_version_index = iceConn->connect_to_me->my_version_index; - free ((char *) iceConn->connect_to_me); + free (iceConn->connect_to_me); iceConn->connect_to_me = NULL; } } @@ -1571,7 +1571,7 @@ ProcessAuthReply ( free (iceConn->protosetup_to_me->his_vendor); if (iceConn->protosetup_to_me->his_release) free (iceConn->protosetup_to_me->his_release); - free ((char *) iceConn->protosetup_to_me); + free (iceConn->protosetup_to_me); iceConn->protosetup_to_me = NULL; } } @@ -1585,7 +1585,7 @@ ProcessAuthReply ( } if (authData && authDataLen > 0) - free ((char *) authData); + free (authData); if (errorString) free (errorString); @@ -1719,7 +1719,7 @@ ProcessAuthNextPhase ( } if (replyData && replyDataLen > 0) - free ((char *) replyData); + free (replyData); IceDisposeCompleteMessage (iceConn, authData); @@ -1967,7 +1967,7 @@ ProcessProtocolSetup ( if ((hisAuthCount = message->authCount) > 0) { - hisAuthNames = (char **) malloc (hisAuthCount * sizeof (char *)); + hisAuthNames = malloc (hisAuthCount * sizeof (char *)); EXTRACT_LISTOF_STRING (pData, swap, hisAuthCount, hisAuthNames); } @@ -2005,7 +2005,7 @@ ProcessProtocolSetup ( for (i = 0; i < hisAuthCount; i++) free (hisAuthNames[i]); - free ((char *) hisAuthNames); + free (hisAuthNames); } IceDisposeCompleteMessage (iceConn, pStart); @@ -2097,8 +2097,7 @@ ProcessProtocolSetup ( AuthRequired (iceConn, hisAuthIndex, authDataLen, authData); iceConn->protosetup_to_me = setupInfo = - (_IceProtoSetupToMeInfo *) malloc ( - sizeof (_IceProtoSetupToMeInfo)); + malloc (sizeof (_IceProtoSetupToMeInfo)); setupInfo->his_opcode = hisOpcode; setupInfo->my_opcode = myOpcode; @@ -2117,7 +2116,7 @@ ProcessProtocolSetup ( } if (authData && authDataLen > 0) - free ((char *) authData); + free (authData); if (errorString) free (errorString); @@ -2219,7 +2218,7 @@ ProcessProtocolSetup ( for (i = 0; i < hisAuthCount; i++) free (hisAuthNames[i]); - free ((char *) hisAuthNames); + free (hisAuthNames); } IceDisposeCompleteMessage (iceConn, pStart); @@ -2364,7 +2363,7 @@ ProcessPingReply ( (*iceConn->ping_waits->ping_reply_proc) (iceConn, iceConn->ping_waits->client_data); - free ((char *) iceConn->ping_waits); + free (iceConn->ping_waits); iceConn->ping_waits = next; } else diff --git a/lib/libICE/src/protosetup.c b/lib/libICE/src/protosetup.c index 255b9120e..fc6010a31 100644 --- a/lib/libICE/src/protosetup.c +++ b/lib/libICE/src/protosetup.c @@ -112,7 +112,7 @@ IceProtocolSetup ( if (myProtocol->orig_client->auth_count > 0) { - authIndices = (int *) malloc ( + authIndices = malloc ( myProtocol->orig_client->auth_count * sizeof (int)); _IceGetPoValidAuthIndices (myProtocol->protocol_name, @@ -181,8 +181,7 @@ IceProtocolSetup ( replyWait.minor_opcode_of_request = ICE_ProtocolSetup; replyWait.reply = (IcePointer) &reply; - iceConn->protosetup_to_you = (_IceProtoSetupToYouInfo *) malloc ( - sizeof (_IceProtoSetupToYouInfo)); + iceConn->protosetup_to_you = malloc (sizeof (_IceProtoSetupToYouInfo)); iceConn->protosetup_to_you->my_opcode = myOpcode; iceConn->protosetup_to_you->my_auth_count = authCount; iceConn->protosetup_to_you->auth_active = 0; @@ -237,8 +236,8 @@ IceProtocolSetup ( } if (iceConn->protosetup_to_you->my_auth_indices) - free ((char *) iceConn->protosetup_to_you->my_auth_indices); - free ((char *) iceConn->protosetup_to_you); + free (iceConn->protosetup_to_you->my_auth_indices); + free (iceConn->protosetup_to_you); iceConn->protosetup_to_you = NULL; } } diff --git a/lib/libICE/src/register.c b/lib/libICE/src/register.c index 20a6ad0e7..833714b0b 100644 --- a/lib/libICE/src/register.c +++ b/lib/libICE/src/register.c @@ -67,8 +67,7 @@ IceRegisterForProtocolSetup ( if (i <= _IceLastMajorOpcode) { - p = _IceProtocols[i - 1].orig_client = - (_IcePoProtocol *) malloc (sizeof (_IcePoProtocol)); + p = _IceProtocols[i - 1].orig_client = malloc (sizeof(_IcePoProtocol)); opcodeRet = i; } else if (_IceLastMajorOpcode == 255 || @@ -79,13 +78,11 @@ IceRegisterForProtocolSetup ( } else { - char *name; - - _IceProtocols[_IceLastMajorOpcode].protocol_name = name = + _IceProtocols[_IceLastMajorOpcode].protocol_name = strdup(protocolName); p = _IceProtocols[_IceLastMajorOpcode].orig_client = - (_IcePoProtocol *) malloc (sizeof (_IcePoProtocol)); + malloc (sizeof (_IcePoProtocol)); _IceProtocols[_IceLastMajorOpcode].accept_client = NULL; @@ -97,18 +94,15 @@ IceRegisterForProtocolSetup ( p->version_count = versionCount; - p->version_recs = (IcePoVersionRec *) malloc ( - versionCount * sizeof (IcePoVersionRec)); + p->version_recs = malloc (versionCount * sizeof (IcePoVersionRec)); memcpy (p->version_recs, versionRecs, versionCount * sizeof (IcePoVersionRec)); if ((p->auth_count = authCount) > 0) { - p->auth_names = (char **) malloc ( - authCount * sizeof (char *)); + p->auth_names = malloc (authCount * sizeof (char *)); - p->auth_procs = (IcePoAuthProc *) malloc ( - authCount * sizeof (IcePoAuthProc)); + p->auth_procs = malloc (authCount * sizeof (IcePoAuthProc)); for (i = 0; i < authCount; i++) { @@ -169,7 +163,7 @@ IceRegisterForProtocolReply ( if (i <= _IceLastMajorOpcode) { p = _IceProtocols[i - 1].accept_client = - (_IcePaProtocol *) malloc (sizeof (_IcePaProtocol)); + malloc (sizeof (_IcePaProtocol)); opcodeRet = i; } else if (_IceLastMajorOpcode == 255 || @@ -180,15 +174,13 @@ IceRegisterForProtocolReply ( } else { - char *name; - - _IceProtocols[_IceLastMajorOpcode].protocol_name = name = + _IceProtocols[_IceLastMajorOpcode].protocol_name = strdup(protocolName); _IceProtocols[_IceLastMajorOpcode].orig_client = NULL; p = _IceProtocols[_IceLastMajorOpcode].accept_client = - (_IcePaProtocol *) malloc (sizeof (_IcePaProtocol)); + malloc (sizeof (_IcePaProtocol)); opcodeRet = ++_IceLastMajorOpcode; } @@ -198,8 +190,7 @@ IceRegisterForProtocolReply ( p->version_count = versionCount; - p->version_recs = (IcePaVersionRec *) malloc ( - versionCount * sizeof (IcePaVersionRec)); + p->version_recs = malloc (versionCount * sizeof (IcePaVersionRec)); memcpy (p->version_recs, versionRecs, versionCount * sizeof (IcePaVersionRec)); @@ -208,11 +199,9 @@ IceRegisterForProtocolReply ( if ((p->auth_count = authCount) > 0) { - p->auth_names = (char **) malloc ( - authCount * sizeof (char *)); + p->auth_names = malloc (authCount * sizeof (char *)); - p->auth_procs = (IcePaAuthProc *) malloc ( - authCount * sizeof (IcePaAuthProc)); + p->auth_procs = malloc (authCount * sizeof (IcePaAuthProc)); for (i = 0; i < authCount; i++) { diff --git a/lib/libICE/src/replywait.c b/lib/libICE/src/replywait.c index eb3a8143c..b25c35171 100644 --- a/lib/libICE/src/replywait.c +++ b/lib/libICE/src/replywait.c @@ -59,8 +59,7 @@ _IceAddReplyWait ( last = last->next; } - savedReplyWait = (_IceSavedReplyWait *) malloc ( - sizeof (_IceSavedReplyWait)); + savedReplyWait = malloc (sizeof (_IceSavedReplyWait)); savedReplyWait->reply_wait = replyWait; savedReplyWait->reply_ready = False; @@ -149,7 +148,7 @@ _IceCheckReplyReady ( else prev->next = savedReplyWait->next; - free ((char *) savedReplyWait); + free (savedReplyWait); } return (ready); diff --git a/lib/libICE/src/setauth.c b/lib/libICE/src/setauth.c index d190de598..1017b02f8 100644 --- a/lib/libICE/src/setauth.c +++ b/lib/libICE/src/setauth.c @@ -50,11 +50,7 @@ Author: Ralph Mor, X Consortium */ int _IcePaAuthDataEntryCount = 0; -#ifndef __UNIXOS2__ IceAuthDataEntry _IcePaAuthDataEntries[ICE_MAX_AUTH_DATA_ENTRIES]; -#else -IceAuthDataEntry _IcePaAuthDataEntries[ICE_MAX_AUTH_DATA_ENTRIES] = {0}; -#endif void @@ -104,7 +100,7 @@ IceSetPaAuthData ( _IcePaAuthDataEntries[j].auth_data_length = entries[i].auth_data_length; - _IcePaAuthDataEntries[j].auth_data = (char *) malloc ( + _IcePaAuthDataEntries[j].auth_data = malloc ( entries[i].auth_data_length); memcpy (_IcePaAuthDataEntries[j].auth_data, entries[i].auth_data, entries[i].auth_data_length); diff --git a/lib/libICE/src/shutdown.c b/lib/libICE/src/shutdown.c index 14874a061..5def0b438 100644 --- a/lib/libICE/src/shutdown.c +++ b/lib/libICE/src/shutdown.c @@ -301,21 +301,21 @@ _IceFreeConnection ( free (iceConn->scratch); if (iceConn->process_msg_info) - free ((char *) iceConn->process_msg_info); + free (iceConn->process_msg_info); if (iceConn->connect_to_you) - free ((char *) iceConn->connect_to_you); + free (iceConn->connect_to_you); if (iceConn->protosetup_to_you) - free ((char *) iceConn->protosetup_to_you); + free (iceConn->protosetup_to_you); if (iceConn->connect_to_me) - free ((char *) iceConn->connect_to_me); + free (iceConn->connect_to_me); if (iceConn->protosetup_to_me) - free ((char *) iceConn->protosetup_to_me); + free (iceConn->protosetup_to_me); - free ((char *) iceConn); + free (iceConn); } diff --git a/lib/libICE/src/watch.c b/lib/libICE/src/watch.c index e414e19fe..abbc265b3 100644 --- a/lib/libICE/src/watch.c +++ b/lib/libICE/src/watch.c @@ -48,8 +48,7 @@ IceAddConnectionWatch ( _IceWatchProc *newWatchProc; int i; - if ((newWatchProc = (_IceWatchProc *) malloc ( - sizeof (_IceWatchProc))) == NULL) + if ((newWatchProc = malloc (sizeof (_IceWatchProc))) == NULL) { return (0); } @@ -74,7 +73,7 @@ IceAddConnectionWatch ( for (i = 0; i < _IceConnectionCount; i++) { - _IceWatchedConnection *newWatchedConn = (_IceWatchedConnection *) + _IceWatchedConnection *newWatchedConn = malloc (sizeof (_IceWatchedConnection)); newWatchedConn->iceConn = _IceConnectionObjs[i]; @@ -116,7 +115,7 @@ IceRemoveConnectionWatch ( while (watchedConn) { _IceWatchedConnection *nextWatchedConn = watchedConn->next; - free ((char *) watchedConn); + free (watchedConn); watchedConn = nextWatchedConn; } @@ -125,7 +124,7 @@ IceRemoveConnectionWatch ( else prevWatchProc->next = nextWatchProc; - free ((char *) currWatchProc); + free (currWatchProc); } } @@ -140,7 +139,7 @@ _IceConnectionOpened ( while (watchProc) { - _IceWatchedConnection *newWatchedConn = (_IceWatchedConnection *) + _IceWatchedConnection *newWatchedConn = malloc (sizeof (_IceWatchedConnection)); _IceWatchedConnection *watchedConn; @@ -193,7 +192,7 @@ _IceConnectionClosed ( else prev->next = watchedConn->next; - free ((char *) watchedConn); + free (watchedConn); } watchProc = watchProc->next;