From 6648b49e4fb8461975eff8002e4c84f04b698a5e Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Tue, 13 Jan 2009 20:01:33 -0200 Subject: Ansification and compile warning fixes. This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, and corrects make distcheck. --- .gitignore | 4 ++++ Makefile.am | 27 +++++++++------------------ app-defaults/Beforelight | 1 + app-defaults/Beforelight.ad | 1 - b4light.c | 14 +++++++------- configure.ac | 14 +++++++++++++- 6 files changed, 34 insertions(+), 27 deletions(-) create mode 100644 app-defaults/Beforelight delete mode 100644 app-defaults/Beforelight.ad diff --git a/.gitignore b/.gitignore index 0c741b1..5454bd1 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,7 @@ install-sh missing stamp-h1 *~ +*.o +beforelight-*.tar.* +ChangeLog +tags diff --git a/Makefile.am b/Makefile.am index b642131..477bdc3 100644 --- a/Makefile.am +++ b/Makefile.am @@ -31,30 +31,21 @@ beforelight_SOURCES = \ appman_PRE = \ beforelight.man -# App default files (*.ad) +# App default files -EXTRA_DIST = \ - app-defaults/Beforelight.ad +DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults -APPDEFAULTFILES = \ - app-defaults/Beforelight - -SUFFIXES = .ad - -.ad: - $(mkdir_p) app-defaults - cp $< $@ +appdefaultdir = @appdefaultdir@ -appdefault_DATA = $(APPDEFAULTFILES) - -CLEANFILES = $(APPDEFAULTFILES) +dist_appdefault_DATA = \ + app-defaults/Beforelight appmandir = $(APP_MAN_DIR) appman_DATA = $(appman_PRE:man=@APP_MAN_SUFFIX@) -EXTRA_DIST += $(appman_PRE) -CLEANFILES += $(appman_DATA) +EXTRA_DIST = $(appman_PRE) +CLEANFILES = $(appman_DATA) SED = sed @@ -75,7 +66,7 @@ MAN_SUBSTS = \ -e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \ -e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g' -SUFFIXES += .$(APP_MAN_SUFFIX) .man +SUFFIXES = .$(APP_MAN_SUFFIX) .man .man.$(APP_MAN_SUFFIX): sed $(MAN_SUBSTS) < $< > $@ @@ -86,6 +77,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/app-defaults/Beforelight b/app-defaults/Beforelight new file mode 100644 index 0000000..64677a0 --- /dev/null +++ b/app-defaults/Beforelight @@ -0,0 +1 @@ +*label.label: Before Light - Keith's hack... diff --git a/app-defaults/Beforelight.ad b/app-defaults/Beforelight.ad deleted file mode 100644 index 64677a0..0000000 --- a/app-defaults/Beforelight.ad +++ /dev/null @@ -1 +0,0 @@ -*label.label: Before Light - Keith's hack... diff --git a/b4light.c b/b4light.c index 9a125f9..791f5f5 100644 --- a/b4light.c +++ b/b4light.c @@ -289,7 +289,7 @@ main(int argc, char *argv[]) XID kill_id; Atom kill_type; int i; - int (*oldHandler)(); + int (*oldHandler)(Display*, XErrorEvent*); Window r; int x, y; unsigned int w, h, b, d; @@ -348,9 +348,9 @@ main(int argc, char *argv[]) AllocateColors(); blank_pix = XCreatePixmap (display, root, 1, 1, 1); XScreenSaverRegister (display, screen, (XID) blank_pix, XA_PIXMAP); - bit_0_gc = XCreateGC (display, blank_pix, 0, 0); + bit_0_gc = XCreateGC (display, blank_pix, 0, NULL); XSetForeground (display, bit_0_gc, 0); - bit_1_gc = XCreateGC (display, blank_pix, 0, 0); + bit_1_gc = XCreateGC (display, blank_pix, 0, NULL); XSetForeground (display, bit_1_gc, ~0); XFillRectangle (display, blank_pix, bit_0_gc, 0, 0, 1, 1); info = XScreenSaverAllocInfo (); @@ -364,14 +364,14 @@ main(int argc, char *argv[]) mask |= CWCursor; XScreenSaverSetAttributes (display, root, 0, 0, DisplayWidth (display, screen), DisplayHeight(display, screen), 0, - CopyFromParent, CopyFromParent, CopyFromParent, mask, &attr); + CopyFromParent, CopyFromParent, (Visual *)CopyFromParent, mask, &attr); XSync (display, False); - gc = XCreateGC (display, root, 0, 0); - black_gc = XCreateGC (display, root, 0, 0); + gc = XCreateGC (display, root, 0, NULL); + black_gc = XCreateGC (display, root, 0, NULL); XSetForeground (display, black_gc, black_pixel); if (filled) { - erase_gc = XCreateGC (display, root, 0, 0); + erase_gc = XCreateGC (display, root, 0, NULL); XSetBackground (display, erase_gc, 0); XSetFunction (display, erase_gc, GXxor); XSetGraphicsExposures (display, erase_gc, False); diff --git a/configure.ac b/configure.ac index 87c327c..5b4ecea 100644 --- a/configure.ac +++ b/configure.ac @@ -26,21 +26,33 @@ AC_INIT(beforelight,[1.0.3], [https://bugs.freedesktop.org/enter_bug.cgi?product 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(BEFORELIGHT, x11 xscrnsaver xt xaw7) +BEFORELIGHT_CFLAGS="$CWARNFLAGS $BEFORELIGHT_CFLAGS" AC_SUBST(BEFORELIGHT_CFLAGS) AC_SUBST(BEFORELIGHT_LIBS) PKG_CHECK_MODULES(APPDEFS, xt) -appdefaultdir=$(pkg-config --variable=appdefaultdir xt) +xt_appdefaultdir=$(pkg-config --variable=appdefaultdir xt) +AC_ARG_WITH(appdefaultdir, + AC_HELP_STRING([--with-appdefaultdir=], + [specify directory for app-defaults files (default is autodetected)]), + [appdefaultdir="$withval"], [appdefaultdir="${xt_appdefaultdir}"]) AC_SUBST(appdefaultdir) XORG_MANPAGE_SECTIONS XORG_RELEASE_VERSION +XORG_CHANGELOG AC_OUTPUT([Makefile]) -- cgit v1.2.3