From b5921d7ad244da5f603e82b559f74496ea87144e Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Thu, 22 Jan 2009 15:24:07 -0200 Subject: Correct make distcheck and sparse warnings. --- .gitignore | 4 ++++ Makefile.am | 2 +- configure.ac | 8 ++++++++ xkill.c | 9 ++++----- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 41d58cd..5a9c8a9 100644 --- a/.gitignore +++ b/.gitignore @@ -18,3 +18,7 @@ stamp-h1 xkill xkill.1 *~ +*.o +xkill-*.tar.* +ChangeLog +tags diff --git a/Makefile.am b/Makefile.am index 4c80c2b..7dd3392 100644 --- a/Makefile.am +++ b/Makefile.am @@ -68,6 +68,6 @@ MAINTAINERCLEANFILES = ChangeLog .PHONY: ChangeLog ChangeLog: - (GIT_DIR=$(top_srcdir)/.git git-log > .changelog.tmp && mv .changelog.tmp ChangeLog; rm -f .changelog.tmp) || (touch ChangeLog; echo 'git directory not found: installing possibly empty changelog.' >&2) + $(CHANGELOG_CMD) dist-hook: ChangeLog diff --git a/configure.ac b/configure.ac index 66a55a7..7eb8fec 100644 --- a/configure.ac +++ b/configure.ac @@ -26,17 +26,25 @@ AC_INIT(xkill,[1.0.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg] AM_INIT_AUTOMAKE([dist-bzip2]) AM_MAINTAINER_MODE +# Require xorg-macros: XORG_CWARNFLAGS, XORG_CHANGELOG +m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.2 or later before running autoconf/autogen])]) +XORG_MACROS_VERSION(1.2) + AM_CONFIG_HEADER(config.h) AC_PROG_CC AC_PROG_INSTALL +XORG_CWARNFLAGS + # Checks for pkg-config packages PKG_CHECK_MODULES(XKILL, x11 xmuu) +XKILL_CFLAGS="$CWARNFLAGS $XKILL_CFLAGS" AC_SUBST(XKILL_CFLAGS) AC_SUBST(XKILL_LIBS) XORG_MANPAGE_SECTIONS XORG_RELEASE_VERSION +XORG_CHANGELOG AC_OUTPUT([Makefile]) diff --git a/xkill.c b/xkill.c index 9e3bd6d..2362479 100644 --- a/xkill.c +++ b/xkill.c @@ -48,8 +48,8 @@ from The Open Group. #include -Display *dpy = NULL; -char *ProgramName; +static Display *dpy = NULL; +static char *ProgramName; #define SelectButtonAny (-1) #define SelectButtonFirst (-2) @@ -107,6 +107,7 @@ main(int argc, char *argv[]) Bool top = False; ProgramName = argv[0]; + button = SelectButtonFirst; for (i = 1; i < argc; i++) { char *arg = argv[i]; @@ -161,9 +162,7 @@ main(int argc, char *argv[]) if (!button_name) button_name = XGetDefault (dpy, ProgramName, "Button"); - if (!button_name) - button = SelectButtonFirst; - else if (!parse_button (button_name, &button)) { + if (button_name && !parse_button (button_name, &button)) { fprintf (stderr, "%s: invalid button specification \"%s\"\n", ProgramName, button_name); Exit (1); -- cgit v1.2.3