Update to xmodmap 1.0.9

This commit is contained in:
matthieu 2015-05-10 10:22:11 +00:00
parent d9f6904757
commit 142218db6d
13 changed files with 478 additions and 282 deletions

View File

@ -1,3 +1,73 @@
commit 1e0d98566d01fb5da9836e1fc402fb28f8d8b499
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Fri Apr 17 00:06:59 2015 -0700
xmodmap 1.0.9
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit d50db4361a57062f9c0c0a1c6c18d296e11dd4bf
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Fri Aug 1 23:20:34 2014 -0700
Remove unneeded casts on malloc, realloc, and free calls
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 02f145f175894399fed33992e4e7e5a87d7e7a2a
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Fri Aug 1 23:15:29 2014 -0700
Avoid null pointer use if malloc() fails
Error: Null pointer dereference (CWE 476)
Read from null pointer str
at line 282 of handle.c in function 'parse_number'.
Function copy_to_scratch may return constant 'NULL' at line 98,
called at line 875 in function 'do_pointer'.
Constant 'NULL' passed into function parse_number, argument str,
from call at line 876.
Null pointer introduced at line 98 in function 'copy_to_scratch'.
[ This bug was found by the Parfait 1.4.0 bug checking tool.
http://labs.oracle.com/pls/apex/f?p=labs:49:::::P49_PROJECT_ID:13 ]
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit e320555a2281ff6b5ad9409480a62c976a289dc1
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Jun 1 00:13:58 2014 -0700
Print which option was in error along with usage message
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 82f549d1c8780538fb115ee2768d2f4024d302b2
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat May 31 23:49:27 2014 -0700
Add -version option to print program version
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit 156921246c26f5e12790d52b8b9f395a56f61c87
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat May 31 23:41:50 2014 -0700
autogen.sh: Honor NOCONFIGURE=1
See http://people.gnome.org/~walters/docs/build-api.txt
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit c624c9c29ed4af8f941108368786ddb5f0d55ba6
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sat May 31 23:41:50 2014 -0700
configure: Drop AM_MAINTAINER_MODE
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
commit e09a9195be80bd29c59f56e641dda52789d837b5 commit e09a9195be80bd29c59f56e641dda52789d837b5
Author: Alan Coopersmith <alan.coopersmith@oracle.com> Author: Alan Coopersmith <alan.coopersmith@oracle.com>
Date: Sun Sep 8 10:05:00 2013 -0700 Date: Sun Sep 8 10:05:00 2013 -0700

View File

@ -1,11 +1,13 @@
Installation Instructions Installation Instructions
************************* *************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, Copyright (C) 1994-1996, 1999-2002, 2004-2011 Free Software Foundation,
2006, 2007, 2008 Free Software Foundation, Inc. Inc.
This file is free documentation; the Free Software Foundation gives Copying and distribution of this file, with or without modification,
unlimited permission to copy, distribute and modify it. 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 Basic Installation
================== ==================
@ -13,7 +15,11 @@ Basic Installation
Briefly, the shell commands `./configure; make; make install' should Briefly, the shell commands `./configure; make; make install' should
configure, build, and install this package. The following configure, build, and install this package. The following
more-detailed instructions are generic; see the `README' file for 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 The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses 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 you want to change it or regenerate `configure' using a newer version
of `autoconf'. 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 1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. `./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. 2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with 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 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 source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is 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 all sorts of other programs in order to regenerate files that came
with the distribution. with the distribution.
6. Often, you can also type `make uninstall' to remove the installed 7. Often, you can also type `make uninstall' to remove the installed
files again. 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 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 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 directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the 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 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 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 By default, `make install' installs the package's commands under
`/usr/local/bin', include files under `/usr/local/include', etc. You `/usr/local/bin', include files under `/usr/local/include', etc. You
can specify an installation prefix other than `/usr/local' by giving 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 You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you 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 In addition, if you use an unusual directory layout you can give
options like `--bindir=DIR' to specify different values for particular options like `--bindir=DIR' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories 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 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 with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package. `configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where 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 you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations. `--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 Particular systems
================== ==================
@ -159,10 +222,15 @@ Particular systems
CC is not installed, it is recommended to use the following options in CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler: 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. 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 On OSF/1 a.k.a. Tru64, some versions of the default C compiler cannot
parse its `<wchar.h>' header file. The option `-nodtk' can be used as parse its `<wchar.h>' header file. The option `-nodtk' can be used as
a workaround. If GNU CC is not installed, it is therefore recommended 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" ./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 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: 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 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 `config.sub' isn't included in this package, then this package doesn't
@ -277,7 +356,7 @@ operates.
`configure' can determine that directory automatically. `configure' can determine that directory automatically.
`--prefix=DIR' `--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 for more details, including other options available for fine-tuning
the installation locations. the installation locations.

View File

@ -233,7 +233,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LINT = @LINT@ LINT = @LINT@
LINT_FLAGS = @LINT_FLAGS@ LINT_FLAGS = @LINT_FLAGS@
LTLIBOBJS = @LTLIBOBJS@ LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
MAN_SUBSTS = @MAN_SUBSTS@ MAN_SUBSTS = @MAN_SUBSTS@
MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_DIR = @MISC_MAN_DIR@
@ -336,7 +335,7 @@ all: config.h
.SUFFIXES: .c .o .obj .SUFFIXES: .c .o .obj
am--refresh: Makefile 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 \ @for dep in $?; do \
case '$(am__configure_deps)' in \ case '$(am__configure_deps)' in \
*$$dep*) \ *$$dep*) \
@ -363,9 +362,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck $(SHELL) ./config.status --recheck
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(top_srcdir)/configure: $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF) $(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__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps): $(am__aclocal_m4_deps):
@ -376,7 +375,7 @@ config.h: stamp-h1
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1 @rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h 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)) ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1 rm -f stamp-h1
touch $@ touch $@

View File

@ -799,44 +799,6 @@ fi
rmdir .tst 2>/dev/null rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])]) 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 -*- # Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001-2012 Free Software Foundation, Inc. # Copyright (C) 2001-2012 Free Software Foundation, Inc.
@ -1279,7 +1241,7 @@ dnl DEALINGS IN THE SOFTWARE.
# 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. # version you require.
m4_defun([XORG_MACROS_VERSION],[ m4_defun([XORG_MACROS_VERSION],[
m4_define([vers_have], [1.17.1]) m4_define([vers_have], [1.19.0])
m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) 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_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.])))
m4_if(m4_cmp(maj_have, maj_needed), 0,, m4_if(m4_cmp(maj_have, maj_needed), 0,,
@ -1329,6 +1291,7 @@ if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
AC_MSG_RESULT([no]) AC_MSG_RESULT([no])
else else
if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
TRADITIONALCPPFLAGS="-traditional"
RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
AC_MSG_RESULT([yes]) AC_MSG_RESULT([yes])
else else
@ -1337,6 +1300,7 @@ else
fi fi
rm -f conftest.$ac_ext rm -f conftest.$ac_ext
AC_SUBST(RAWCPPFLAGS) AC_SUBST(RAWCPPFLAGS)
AC_SUBST(TRADITIONALCPPFLAGS)
]) # XORG_PROG_RAWCPP ]) # XORG_PROG_RAWCPP
# XORG_MANPAGE_SECTIONS() # XORG_MANPAGE_SECTIONS()
@ -1861,9 +1825,10 @@ AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
]) # XORG_WITH_ASCIIDOC ]) # XORG_WITH_ASCIIDOC
# XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT]) # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT])
# -------------------------------- # -------------------------------------------
# Minimum version: 1.5.0 # Minimum version: 1.5.0
# Minimum version for optional DEFAULT argument: 1.11.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 # 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 # not at the appropriate level. This macro enables a module to test for the
@ -1883,6 +1848,7 @@ AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes])
# #
AC_DEFUN([XORG_WITH_DOXYGEN],[ AC_DEFUN([XORG_WITH_DOXYGEN],[
AC_ARG_VAR([DOXYGEN], [Path to doxygen command]) 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])) m4_define([_defopt], m4_default([$2], [auto]))
AC_ARG_WITH(doxygen, AC_ARG_WITH(doxygen,
AS_HELP_STRING([--with-doxygen], AS_HELP_STRING([--with-doxygen],
@ -1926,6 +1892,20 @@ m4_ifval([$1],
AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed])
fi]) fi])
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]) AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes])
]) # XORG_WITH_DOXYGEN ]) # XORG_WITH_DOXYGEN
@ -2108,6 +2088,29 @@ fi])
AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes])
]) # XORG_WITH_FOP ]) # 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]) # XORG_WITH_PS2PDF([DEFAULT])
# ---------------- # ----------------
# Minimum version: 1.6.0 # Minimum version: 1.6.0
@ -2562,7 +2565,8 @@ AC_ARG_ENABLE(malloc0returnsnull,
AC_MSG_CHECKING([whether malloc(0) returns NULL]) AC_MSG_CHECKING([whether malloc(0) returns NULL])
if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then 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 <stdlib.h> #include <stdlib.h>
],[ ],[
char *m0, *r0, *c0, *p; char *m0, *r0, *c0, *p;
@ -2572,9 +2576,9 @@ if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
c0 = calloc(0,10); c0 = calloc(0,10);
exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1); exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1);
])], ])],
[MALLOC_ZERO_RETURNS_NULL=yes], [xorg_cv_malloc0_returns_null=yes],
[MALLOC_ZERO_RETURNS_NULL=no], [xorg_cv_malloc0_returns_null=no])])
[MALLOC_ZERO_RETURNS_NULL=yes]) MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null
fi fi
AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
@ -2863,7 +2867,7 @@ AC_LANG_CASE(
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast]) 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]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement])
] ]
) )
@ -2872,16 +2876,17 @@ AC_LANG_CASE(
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow]) 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-noreturn])
XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute]) 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 # These are currently disabled because they are noisy. They will be enabled
# in the future once the codebase is sufficiently modernized to silence # 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. # 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]], [-Wparentheses])
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) # 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 # Turn some warnings into errors, so we don't accidently get successful builds
# when there are problems that should be fixed. # when there are problems that should be fixed.

View File

@ -9,5 +9,6 @@ cd $srcdir
autoreconf -v --install || exit 1 autoreconf -v --install || exit 1
cd $ORIGDIR || exit $? cd $ORIGDIR || exit $?
$srcdir/configure --enable-maintainer-mode "$@" if test -z "$NOCONFIGURE"; then
$srcdir/configure "$@"
fi

View File

@ -3,7 +3,7 @@
scriptversion=2012-10-14.11; # UTC scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc. # Copyright (C) 1999-2014 Free Software Foundation, Inc.
# Written by Tom Tromey <tromey@cygnus.com>. # Written by Tom Tromey <tromey@cygnus.com>.
# #
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify

360
app/xmodmap/configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# Guess values for system-dependent variables and create Makefiles. # Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for xmodmap 1.0.8. # Generated by GNU Autoconf 2.69 for xmodmap 1.0.9.
# #
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>. # Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>.
# #
@ -581,8 +581,8 @@ MAKEFLAGS=
# Identity of this package. # Identity of this package.
PACKAGE_NAME='xmodmap' PACKAGE_NAME='xmodmap'
PACKAGE_TARNAME='xmodmap' PACKAGE_TARNAME='xmodmap'
PACKAGE_VERSION='1.0.8' PACKAGE_VERSION='1.0.9'
PACKAGE_STRING='xmodmap 1.0.8' PACKAGE_STRING='xmodmap 1.0.9'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg'
PACKAGE_URL='' PACKAGE_URL=''
@ -668,9 +668,6 @@ CHANGELOG_CMD
STRICT_CFLAGS STRICT_CFLAGS
CWARNFLAGS CWARNFLAGS
BASE_CFLAGS BASE_CFLAGS
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
am__fastdepCC_FALSE am__fastdepCC_FALSE
am__fastdepCC_TRUE am__fastdepCC_TRUE
CCDEPMODE CCDEPMODE
@ -756,7 +753,6 @@ ac_subst_files=''
ac_user_opts=' ac_user_opts='
enable_option_checking enable_option_checking
enable_dependency_tracking enable_dependency_tracking
enable_maintainer_mode
enable_selective_werror enable_selective_werror
enable_strict_compilation enable_strict_compilation
enable_silent_rules enable_silent_rules
@ -1318,7 +1314,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing. # 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. # This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF cat <<_ACEOF
\`configure' configures xmodmap 1.0.8 to adapt to many kinds of systems. \`configure' configures xmodmap 1.0.9 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]... Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1388,7 +1384,7 @@ fi
if test -n "$ac_init_help"; then if test -n "$ac_init_help"; then
case $ac_init_help in case $ac_init_help in
short | recursive ) echo "Configuration of xmodmap 1.0.8:";; short | recursive ) echo "Configuration of xmodmap 1.0.9:";;
esac esac
cat <<\_ACEOF cat <<\_ACEOF
@ -1400,9 +1396,6 @@ Optional Features:
do not reject slow dependency extractors do not reject slow dependency extractors
--disable-dependency-tracking --disable-dependency-tracking
speeds up one-time build speeds up one-time build
--enable-maintainer-mode
enable make rules and dependencies not useful (and
sometimes confusing) to the casual installer
--disable-selective-werror --disable-selective-werror
Turn off selective compiler errors. (default: Turn off selective compiler errors. (default:
enabled) enabled)
@ -1505,7 +1498,7 @@ fi
test -n "$ac_init_help" && exit $ac_status test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then if $ac_init_version; then
cat <<\_ACEOF cat <<\_ACEOF
xmodmap configure 1.0.8 xmodmap configure 1.0.9
generated by GNU Autoconf 2.69 generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc. Copyright (C) 2012 Free Software Foundation, Inc.
@ -1920,7 +1913,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake. running configure, to aid debugging if configure makes a mistake.
It was created by xmodmap $as_me 1.0.8, which was It was created by xmodmap $as_me 1.0.9, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@ $ $0 $@
@ -4061,7 +4054,7 @@ fi
# Define the identity of the package. # Define the identity of the package.
PACKAGE='xmodmap' PACKAGE='xmodmap'
VERSION='1.0.8' VERSION='1.0.9'
cat >>confdefs.h <<_ACEOF cat >>confdefs.h <<_ACEOF
@ -4236,29 +4229,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
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS # Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
@ -5870,6 +5840,55 @@ $as_echo "$supported" >&6; }
fi fi
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
@ -6360,124 +6379,6 @@ $as_echo "$supported" >&6; }
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 -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" xorg_testset_save_CFLAGS="$CFLAGS"
if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then if test "x$xorg_testset_cc_unknown_warning_option" = "x" ; then
@ -6701,13 +6602,132 @@ $as_echo "$supported" >&6; }
fi 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 # These are currently disabled because they are noisy. They will be enabled
# in the future once the codebase is sufficiently modernized to silence # 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. # 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]], [-Wparentheses])
# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) # 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 # Turn some warnings into errors, so we don't accidently get successful builds
# when there are problems that should be fixed. # when there are problems that should be fixed.
@ -10574,12 +10594,12 @@ if test -n "$XMODMAP_CFLAGS"; then
pkg_cv_XMODMAP_CFLAGS="$XMODMAP_CFLAGS" pkg_cv_XMODMAP_CFLAGS="$XMODMAP_CFLAGS"
elif test -n "$PKG_CONFIG"; then elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \ if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xproto >= 7.0.17\""; } >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xproto >= 7.0.25\""; } >&5
($PKG_CONFIG --exists --print-errors "x11 xproto >= 7.0.17") 2>&5 ($PKG_CONFIG --exists --print-errors "x11 xproto >= 7.0.25") 2>&5
ac_status=$? ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then test $ac_status = 0; }; then
pkg_cv_XMODMAP_CFLAGS=`$PKG_CONFIG --cflags "x11 xproto >= 7.0.17" 2>/dev/null` pkg_cv_XMODMAP_CFLAGS=`$PKG_CONFIG --cflags "x11 xproto >= 7.0.25" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes test "x$?" != "x0" && pkg_failed=yes
else else
pkg_failed=yes pkg_failed=yes
@ -10591,12 +10611,12 @@ if test -n "$XMODMAP_LIBS"; then
pkg_cv_XMODMAP_LIBS="$XMODMAP_LIBS" pkg_cv_XMODMAP_LIBS="$XMODMAP_LIBS"
elif test -n "$PKG_CONFIG"; then elif test -n "$PKG_CONFIG"; then
if test -n "$PKG_CONFIG" && \ if test -n "$PKG_CONFIG" && \
{ { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xproto >= 7.0.17\""; } >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"x11 xproto >= 7.0.25\""; } >&5
($PKG_CONFIG --exists --print-errors "x11 xproto >= 7.0.17") 2>&5 ($PKG_CONFIG --exists --print-errors "x11 xproto >= 7.0.25") 2>&5
ac_status=$? ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then test $ac_status = 0; }; then
pkg_cv_XMODMAP_LIBS=`$PKG_CONFIG --libs "x11 xproto >= 7.0.17" 2>/dev/null` pkg_cv_XMODMAP_LIBS=`$PKG_CONFIG --libs "x11 xproto >= 7.0.25" 2>/dev/null`
test "x$?" != "x0" && pkg_failed=yes test "x$?" != "x0" && pkg_failed=yes
else else
pkg_failed=yes pkg_failed=yes
@ -10617,14 +10637,14 @@ else
_pkg_short_errors_supported=no _pkg_short_errors_supported=no
fi fi
if test $_pkg_short_errors_supported = yes; then if test $_pkg_short_errors_supported = yes; then
XMODMAP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11 xproto >= 7.0.17" 2>&1` XMODMAP_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "x11 xproto >= 7.0.25" 2>&1`
else else
XMODMAP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11 xproto >= 7.0.17" 2>&1` XMODMAP_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "x11 xproto >= 7.0.25" 2>&1`
fi fi
# Put the nasty error message in config.log where it belongs # Put the nasty error message in config.log where it belongs
echo "$XMODMAP_PKG_ERRORS" >&5 echo "$XMODMAP_PKG_ERRORS" >&5
as_fn_error $? "Package requirements (x11 xproto >= 7.0.17) were not met: as_fn_error $? "Package requirements (x11 xproto >= 7.0.25) were not met:
$XMODMAP_PKG_ERRORS $XMODMAP_PKG_ERRORS
@ -10894,10 +10914,6 @@ else
am__EXEEXT_FALSE= am__EXEEXT_FALSE=
fi 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 "${LINT_TRUE}" && test -z "${LINT_FALSE}"; then if test -z "${LINT_TRUE}" && test -z "${LINT_FALSE}"; then
as_fn_error $? "conditional \"LINT\" was never defined. as_fn_error $? "conditional \"LINT\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@ -11299,7 +11315,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their # report actual input values of CONFIG_FILES etc. instead of their
# values after options handling. # values after options handling.
ac_log=" ac_log="
This file was extended by xmodmap $as_me 1.0.8, which was This file was extended by xmodmap $as_me 1.0.9, which was
generated by GNU Autoconf 2.69. Invocation command line was generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES CONFIG_FILES = $CONFIG_FILES
@ -11365,7 +11381,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\ ac_cs_version="\\
xmodmap config.status 1.0.8 xmodmap config.status 1.0.9
configured by $0, generated by GNU Autoconf 2.69, configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\" with options \\"\$ac_cs_config\\"

View File

@ -24,7 +24,7 @@ dnl Process this file with autoconf to create configure.
# Initialize Autoconf # Initialize Autoconf
AC_PREREQ([2.60]) AC_PREREQ([2.60])
AC_INIT([xmodmap], AC_INIT([xmodmap],
[1.0.8], [1.0.9],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[xmodmap]) [xmodmap])
AC_CONFIG_SRCDIR([Makefile.am]) AC_CONFIG_SRCDIR([Makefile.am])
@ -34,7 +34,6 @@ AC_USE_SYSTEM_EXTENSIONS
# Initialize Automake # Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2]) AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_MAINTAINER_MODE
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS # Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
m4_ifndef([XORG_MACROS_VERSION], m4_ifndef([XORG_MACROS_VERSION],
@ -45,7 +44,7 @@ XORG_DEFAULT_OPTIONS
AC_CHECK_FUNCS([strncasecmp asprintf]) AC_CHECK_FUNCS([strncasecmp asprintf])
# Checks for pkg-config packages # Checks for pkg-config packages
PKG_CHECK_MODULES(XMODMAP, x11 xproto >= 7.0.17) PKG_CHECK_MODULES(XMODMAP, [x11 xproto >= 7.0.25])
dnl Allow checking code with lint, sparse, etc. dnl Allow checking code with lint, sparse, etc.
XORG_WITH_LINT XORG_WITH_LINT

View File

@ -67,10 +67,9 @@ KeysymToKeycodes(Display *dpy, KeySym keysym, int *pnum_kcs)
for (j = 0; j < 8; j++) { for (j = 0; j < 8; j++) {
if (XKeycodeToKeysym(dpy, (KeyCode) i, j) == keysym) { if (XKeycodeToKeysym(dpy, (KeyCode) i, j) == keysym) {
if (!kcs) if (!kcs)
kcs = (KeyCode *)malloc(sizeof(KeyCode)); kcs = malloc(sizeof(KeyCode));
else else
kcs = (KeyCode *)realloc((char *)kcs, kcs = realloc(kcs, sizeof(KeyCode) * (*pnum_kcs + 1));
sizeof(KeyCode) * (*pnum_kcs + 1));
kcs[*pnum_kcs] = i; kcs[*pnum_kcs] = i;
*pnum_kcs += 1; *pnum_kcs += 1;
break; break;
@ -92,7 +91,7 @@ copy_to_scratch(const char *s, int len)
if (len >= buflen) { if (len >= buflen) {
if (buf) free (buf); if (buf) free (buf);
buflen = (len < 40) ? 80 : (len * 2); buflen = (len < 40) ? 80 : (len * 2);
buf = (char *) malloc (buflen+1); buf = malloc (buflen+1);
if (!buf) { if (!buf) {
fprintf (stderr, "attempt to allocate %d byte scratch buffer\n", buflen + 1); fprintf (stderr, "attempt to allocate %d byte scratch buffer\n", buflen + 1);
return NULL; return NULL;
@ -582,10 +581,10 @@ make_add(int modifier, KeySym keysym)
opam->type = doAddModifier; opam->type = doAddModifier;
opam->modifier = modifier; opam->modifier = modifier;
opam->count = 1; opam->count = 1;
opam->keysyms = (KeySym *) malloc (sizeof (KeySym)); opam->keysyms = malloc (sizeof (KeySym));
if (!opam->keysyms) { if (!opam->keysyms) {
badmsg ("attempt to allocate %ld byte KeySym", (long) sizeof (KeySym)); badmsg ("attempt to allocate %ld byte KeySym", (long) sizeof (KeySym));
free ((char *) opam); free (opam);
return; return;
} }
opam->keysyms[0] = keysym; opam->keysyms[0] = keysym;
@ -657,11 +656,11 @@ do_remove(char *line, int len)
* unlike the add command, we have to now evaluate the keysyms * unlike the add command, we have to now evaluate the keysyms
*/ */
kclist = (KeyCode *) malloc (n * sizeof (KeyCode)); kclist = malloc (n * sizeof (KeyCode));
if (!kclist) { if (!kclist) {
badmsg ("attempt to allocate %ld byte keycode list", badmsg ("attempt to allocate %ld byte keycode list",
(long) (n * sizeof (KeyCode))); (long) (n * sizeof (KeyCode)));
free ((char *) kslist); free (kslist);
return; return;
} }
@ -688,11 +687,11 @@ do_remove(char *line, int len)
} }
if (nc + num_kcs > tot) { if (nc + num_kcs > tot) {
tot = nc + num_kcs; tot = nc + num_kcs;
kclist = (KeyCode *)realloc((char *)kclist, tot * sizeof(KeyCode)); kclist = realloc(kclist, tot * sizeof(KeyCode));
if (!kclist) { if (!kclist) {
badmsg ("attempt to allocate %ld byte keycode list", badmsg ("attempt to allocate %ld byte keycode list",
(long) (tot * sizeof (KeyCode))); (long) (tot * sizeof (KeyCode)));
free ((char *) kslist); free (kslist);
return; return;
} }
} }
@ -700,7 +699,7 @@ do_remove(char *line, int len)
kclist[nc++] = *kcs++; /* okay, add it to list */ kclist[nc++] = *kcs++; /* okay, add it to list */
} }
free ((char *) kslist); /* all done with it */ free (kslist); /* all done with it */
uop = AllocStruct (union op); uop = AllocStruct (union op);
if (!uop) { if (!uop) {
@ -739,11 +738,11 @@ make_remove(int modifier, KeyCode keycode)
oprm->type = doRemoveModifier; oprm->type = doRemoveModifier;
oprm->modifier = modifier; oprm->modifier = modifier;
oprm->count = 1; oprm->count = 1;
oprm->keycodes = (KeyCode *) malloc (sizeof (KeyCode)); oprm->keycodes = malloc (sizeof (KeyCode));
if (!oprm->keycodes) { if (!oprm->keycodes) {
badmsg ("attempt to allocate %ld byte KeyCode", badmsg ("attempt to allocate %ld byte KeyCode",
(long) sizeof (KeyCode)); (long) sizeof (KeyCode));
free ((char *) oprm); free (oprm);
return; return;
} }
oprm->keycodes[0] = keycode; oprm->keycodes[0] = keycode;
@ -873,6 +872,9 @@ do_pointer(char *line, int len)
return; return;
} }
strval = copy_to_scratch(line, n); strval = copy_to_scratch(line, n);
if (strval == NULL)
/* copy_to_scratch already printed error message */
return;
ok = parse_number (strval, &val); ok = parse_number (strval, &val);
if (!ok || val >= MAXBUTTONCODES) { if (!ok || val >= MAXBUTTONCODES) {
badmsg ("value %s given for buttons list", strval); badmsg ("value %s given for buttons list", strval);
@ -931,7 +933,7 @@ get_keysym_list(const char *line, int len, int *np, KeySym **kslistp)
havesofar = 0; havesofar = 0;
maxcanhave = 4; /* most lists are small */ maxcanhave = 4; /* most lists are small */
keysymlist = (KeySym *) malloc (maxcanhave * sizeof (KeySym)); keysymlist = malloc (maxcanhave * sizeof (KeySym));
if (!keysymlist) { if (!keysymlist) {
badmsg ("attempt to allocate %ld byte initial keysymlist", badmsg ("attempt to allocate %ld byte initial keysymlist",
(long) (maxcanhave * sizeof (KeySym))); (long) (maxcanhave * sizeof (KeySym)));
@ -971,8 +973,7 @@ get_keysym_list(const char *line, int len, int *np, KeySym **kslistp)
if (havesofar >= maxcanhave) { if (havesofar >= maxcanhave) {
KeySym *origkeysymlist = keysymlist; KeySym *origkeysymlist = keysymlist;
maxcanhave *= 2; maxcanhave *= 2;
keysymlist = (KeySym *) realloc (keysymlist, keysymlist = realloc (keysymlist, maxcanhave * sizeof (KeySym));
maxcanhave * sizeof (KeySym));
if (!keysymlist) { if (!keysymlist) {
badmsg ("attempt to grow keysym list to %ld bytes", badmsg ("attempt to grow keysym list to %ld bytes",
(long) (maxcanhave * sizeof (KeySym))); (long) (maxcanhave * sizeof (KeySym)));

View File

@ -178,7 +178,6 @@ LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
LINT = @LINT@ LINT = @LINT@
LINT_FLAGS = @LINT_FLAGS@ LINT_FLAGS = @LINT_FLAGS@
LTLIBOBJS = @LTLIBOBJS@ LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@ MAKEINFO = @MAKEINFO@
MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__X11datadir__|$(X11_DATADIR)|g' MAN_SUBSTS = @MAN_SUBSTS@ -e 's|__X11datadir__|$(X11_DATADIR)|g'
MISC_MAN_DIR = @MISC_MAN_DIR@ MISC_MAN_DIR = @MISC_MAN_DIR@
@ -269,7 +268,7 @@ all: all-am
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .$(APP_MAN_SUFFIX) .man .SUFFIXES: .$(APP_MAN_SUFFIX) .man
$(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 \ @for dep in $?; do \
case '$(am__configure_deps)' in \ case '$(am__configure_deps)' in \
*$$dep*) \ *$$dep*) \
@ -294,9 +293,9 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh 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 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 cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps): $(am__aclocal_m4_deps):
install-appmanDATA: $(appman_DATA) install-appmanDATA: $(appman_DATA)

View File

@ -86,6 +86,11 @@ unhandled argument is given to
This option indicates that a help message describing the expression grammar This option indicates that a help message describing the expression grammar
used in files and with \-e expressions should be printed on the standard error. used in files and with \-e expressions should be printed on the standard error.
.TP 8 .TP 8
.B \-version
This option indicates that
.I xmodmap
should print its version information and exit.
.TP 8
.B \-verbose .B \-verbose
This option indicates that This option indicates that
.I xmodmap .I xmodmap

View File

@ -140,7 +140,7 @@ extern struct modtab {
int value; int value;
} modifier_table[]; } modifier_table[];
#define AllocStruct(s) ((s *) malloc (sizeof (s))) #define AllocStruct(s) (malloc (sizeof (s)))
#define MAXKEYSYMNAMESIZE 80 /* absurdly large */ #define MAXKEYSYMNAMESIZE 80 /* absurdly large */

View File

@ -116,12 +116,13 @@ static const char help_message[] =
" -pp print pointer map\n" " -pp print pointer map\n"
" -help print this usage message\n" " -help print this usage message\n"
" -grammar print out short help on allowable input\n" " -grammar print out short help on allowable input\n"
" -version print program version\n"
" - read standard input\n" " - read standard input\n"
"\n"; "\n";
static void static void
_X_NORETURN _X_NORETURN _X_COLD
usage(int exitcode) usage(int exitcode)
{ {
fprintf (stderr, "usage: %s [-options ...] [filename]\n", ProgramName); fprintf (stderr, "usage: %s [-options ...] [filename]\n", ProgramName);
@ -129,6 +130,22 @@ usage(int exitcode)
Exit (exitcode); Exit (exitcode);
} }
static void
_X_NORETURN _X_COLD
missing_arg(const char *arg)
{
fprintf (stderr, "%s: %s requires an argument\n\n", ProgramName, arg);
usage(1);
}
static void
_X_NORETURN _X_COLD
unknown_arg(const char *arg)
{
fprintf (stderr, "%s: unrecognized argument %s\n\n", ProgramName, arg);
usage(1);
}
static const char grammar_message[] = static const char grammar_message[] =
" pointer = default reset pointer buttons to default\n" " pointer = default reset pointer buttons to default\n"
" pointer = NUMBER ... set pointer button codes\n" " pointer = NUMBER ... set pointer button codes\n"
@ -186,7 +203,7 @@ main(int argc, char *argv[])
if (arg[0] == '-') { if (arg[0] == '-') {
switch (arg[1]) { switch (arg[1]) {
case 'd': /* -display host:dpy */ case 'd': /* -display host:dpy */
if (++i >= argc) usage (1); if (++i >= argc) missing_arg(arg);
displayname = argv[i]; displayname = argv[i];
break; break;
case 'g': /* -grammar */ case 'g': /* -grammar */
@ -195,6 +212,11 @@ main(int argc, char *argv[])
case 'h': /* -help */ case 'h': /* -help */
case '?': case '?':
usage(0); usage(0);
case 'v':
if (strcmp(arg, "-version") == 0) {
puts(PACKAGE_STRING);
exit(0);
}
} }
} }
} }
@ -234,7 +256,7 @@ main(int argc, char *argv[])
continue; continue;
case 'e': /* -e expression */ case 'e': /* -e expression */
didAnything = True; didAnything = True;
if (++i >= argc) usage (1); if (++i >= argc) missing_arg(arg);
process_line (argv[i]); process_line (argv[i]);
continue; continue;
case 'p': /* -p... */ case 'p': /* -p... */
@ -252,14 +274,14 @@ main(int argc, char *argv[])
printKeyTableExprs = True; printKeyTableExprs = True;
break; break;
default: default:
usage (1); unknown_arg(arg);
} }
break; break;
case 'p': /* -pp */ case 'p': /* -pp */
printPointerMap = True; printPointerMap = True;
break; break;
default: default:
usage (1); unknown_arg(arg);
/* NOTREACHED */ /* NOTREACHED */
} }
didAnything = True; didAnything = True;
@ -302,7 +324,7 @@ main(int argc, char *argv[])
case 'c': { case 'c': {
char *cmd; char *cmd;
didAnything = True; didAnything = True;
if (++i >= argc) usage (1); if (++i >= argc) missing_arg(arg);
if (asprintf (&cmd, "remove %s = %s", if (asprintf (&cmd, "remove %s = %s",
((arg[1] == 's') ? "shift" : ((arg[1] == 's') ? "shift" :
((arg[1] == 'l') ? "lock" : ((arg[1] == 'l') ? "lock" :
@ -312,7 +334,7 @@ main(int argc, char *argv[])
continue; continue;
} }
default: default:
usage (1); unknown_arg(arg);
/*NOTREACHED*/ /*NOTREACHED*/
} }
} else if (arg[0] == '+') { /* old xmodmap args */ } else if (arg[0] == '+') { /* old xmodmap args */
@ -324,7 +346,7 @@ main(int argc, char *argv[])
case '5': { case '5': {
char *cmd; char *cmd;
didAnything = True; didAnything = True;
if (++i >= argc) usage (1); if (++i >= argc) missing_arg(arg);
if (asprintf (&cmd, "add mod%c = %s", arg[1], argv[i]) == -1) if (asprintf (&cmd, "add mod%c = %s", arg[1], argv[i]) == -1)
FatalError("Could not allocate memory for add cmd"); FatalError("Could not allocate memory for add cmd");
process_line (cmd); process_line (cmd);
@ -340,7 +362,7 @@ main(int argc, char *argv[])
case 'c': { case 'c': {
char *cmd; char *cmd;
didAnything = True; didAnything = True;
if (++i >= argc) usage (1); if (++i >= argc) missing_arg(arg);
if (asprintf (&cmd, "add %s = %s", if (asprintf (&cmd, "add %s = %s",
((arg[1] == 's') ? "shift" : ((arg[1] == 's') ? "shift" :
((arg[1] == 'l') ? "lock" : ((arg[1] == 'l') ? "lock" :
@ -350,7 +372,7 @@ main(int argc, char *argv[])
continue; continue;
} }
default: default:
usage (1); unknown_arg(arg);
} }
} else { } else {
didAnything = True; didAnything = True;