diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2009-01-30 20:41:31 -0200 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2009-01-30 20:41:31 -0200 |
commit | 3237cc5b45a41ffe93ebde10b1090a7f2db6f88e (patch) | |
tree | cf72fc42b228c96d517d5e5ba3abea3b4641122a | |
parent | 48544103324d1816139dfafe5873a11c88ee05b6 (diff) |
Janitor: ansification, make distcheck, compiler warnings.
Manual page generation, and xmlto handling, shamelessly cut&paste'd
from libXi/man/Makefile.am, so that make distcheck will work.
-rw-r--r-- | .gitignore | 11 | ||||
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | configure.ac | 11 | ||||
-rw-r--r-- | man/.gitignore | 7 | ||||
-rw-r--r-- | man/Makefile.am | 71 | ||||
-rw-r--r-- | src/.gitignore | 6 | ||||
-rw-r--r-- | src/XRecord.c | 74 | ||||
-rw-r--r-- | src/XTest.c | 100 |
8 files changed, 107 insertions, 177 deletions
@@ -1,3 +1,5 @@ +.deps +.libs aclocal.m4 autom4te.cache compile @@ -19,4 +21,13 @@ missing mkinstalldirs stamp-h1 xtst.pc +x.stamp *~ +*.3 +*.la +*.lo +*.man +*.o +libXtst-*.tar.* +ChangeLog +tags diff --git a/Makefile.am b/Makefile.am index 49b5ec3..7e9ac81 100644 --- a/Makefile.am +++ b/Makefile.am @@ -24,13 +24,13 @@ SUBDIRS = src man pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = xtst.pc -EXTRA_DIST = xtst.pc.in autogen.sh ChangeLog +EXTRA_DIST = xtst.pc.in ChangeLog 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 b310518..61d4bc3 100644 --- a/configure.ac +++ b/configure.ac @@ -27,11 +27,15 @@ AC_INIT(libXtst, 1.0.3, [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) # Check for progs AC_PROG_CC AC_PROG_LIBTOOL +XORG_CWARNFLAGS # Check for xmlto for man page conversion # (only needed by people building tarballs) @@ -41,17 +45,18 @@ AM_CONDITIONAL([HAVE_XMLTO], [test "x$XMLTO" != "x"]) # Check for dependencies PKG_CHECK_MODULES(XTST, x11 xext xi recordproto xextproto inputproto) +XTST_CFLAGS="$CWARNFLAGS $XTST_CFLAGS" +AC_SUBST(XTST_CFLAGS) +AC_SUBST(XTST_LIBS) dnl Allow checking code with lint, sparse, etc. XORG_WITH_LINT XORG_LINT_LIBRARY([Xtst]) LINT_FLAGS="${LINT_FLAGS} ${XTST_CFLAGS}" -AC_SUBST(XTST_CFLAGS) -AC_SUBST(XTST_LIBS) - XORG_MANPAGE_SECTIONS XORG_RELEASE_VERSION +XORG_CHANGELOG AC_OUTPUT([Makefile man/Makefile diff --git a/man/.gitignore b/man/.gitignore deleted file mode 100644 index 74c6b15..0000000 --- a/man/.gitignore +++ /dev/null @@ -1,7 +0,0 @@ -shadows.DONE -*.3 -*~ -*.man -*.__libmansuffix__ -Makefile -Makefile.in diff --git a/man/Makefile.am b/man/Makefile.am index 6a5291a..17553a4 100644 --- a/man/Makefile.am +++ b/man/Makefile.am @@ -28,30 +28,30 @@ libmandir = $(LIB_MAN_DIR) LIB_MAN_DIR_SUFFIX = $(LIB_MAN_DIR:@mandir@/man%=%) -libman_xml = $(srcdir)/XTest.xml - -XTest_manpages = \ - XTestQueryExtension \ - XTestCompareCursorWithWindow \ - XTestCompareCurrentCursorWithWindow \ - XTestFakeKeyEvent \ - XTestFakeButtonEvent \ - XTestFakeMotionEvent \ - XTestFakeRelativeMotionEvent \ - XTestGrabControl \ - XTestSetGContextOfGC \ - XTestSetVisualIDOfVisual \ - XTestDiscard - -libman_PRE = $(XTest_manpages:%=%.man) - -EXTRA_DIST = $(libman_PRE) $(libman_xml) +libman_xml = XTest.xml + +libman_PRE = \ + XTestQueryExtension.man \ + XTestCompareCursorWithWindow.man \ + XTestCompareCurrentCursorWithWindow.man \ + XTestFakeKeyEvent.man \ + XTestFakeButtonEvent.man \ + XTestFakeMotionEvent.man \ + XTestFakeRelativeMotionEvent.man \ + XTestGrabControl.man \ + XTestSetGContextOfGC.man \ + XTestSetVisualIDOfVisual.man \ + XTestDiscard.man + +EXTRA_DIST = $(libman_PRE) $(libman_xml) x.stamp CLEANFILES = $(libman_DATA) $(BUILT_SOURCES) MAINTAINERCLEANFILES = $(libman_PRE) +if HAVE_XMLTO libman_DATA = $(libman_PRE:man=@LIB_MAN_SUFFIX@) +endif SED = sed @@ -72,20 +72,25 @@ SUFFIXES = .$(LIB_MAN_SUFFIX) .man .man.$(LIB_MAN_SUFFIX): sed $(MAN_SUBSTS) < $< > $@ -# Generate nroff sources from DocBook/xml - -dist-hook: $(libman_PRE) - +# This is ugly, but handling of tools with multiple outputs in make is a +# huge PITA. The commands below are taken from the automake manual: +# http://www.gnu.org/software/automake/manual/automake.html#Multiple-Outputs if HAVE_XMLTO -# The .PHONY intermediate target exists to make parallel builds work. -.PHONY: do_xmlto_stage - -$(libman_PRE): do_xmlto_stage - -do_xmlto_stage: $(libman_xml) - $(XMLTO) man $(libman_xml) - for m in $(XTest_manpages); do \ - mv -f $$m.__libmansuffix__ $$m.man ; \ +x.stamp: $(libman_xml) + @rm -f x.tmp + @touch x.tmp + $(XMLTO) man $^ + @for man in $(libman_PRE); do \ + out=`echo $$man | sed 's/\.man/.__libmansuffix__/'`; \ + echo mv -f $$out $$man; \ + mv -f $$out $$man || exit 1; \ done - -endif HAVE_XMLTO + @mv -f x.tmp $@ +$(libman_PRE): x.stamp + @if test -f $@; then :; else \ + rm -f $<; \ + $(MAKE) $(AM_MAKEFLAGS) $<; \ + fi +CLEANFILES += x.tmp +MAINTAINERCLEANFILES += x.stamp +endif # HAVE_XMLTO diff --git a/src/.gitignore b/src/.gitignore deleted file mode 100644 index 4fcb96e..0000000 --- a/src/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -.deps -.libs -libXtst.la -*.lo -Makefile -Makefile.in diff --git a/src/XRecord.c b/src/XRecord.c index 5d2623e..9c6fe87 100644 --- a/src/XRecord.c +++ b/src/XRecord.c @@ -251,16 +251,13 @@ SendRange( **************************************************************************/ XID -XRecordIdBaseMask(dpy) - Display *dpy; +XRecordIdBaseMask(Display *dpy) { return 0x1fffffff & ~dpy->resource_mask; } Status -XRecordQueryVersion (dpy, cmajor_return, cminor_return) - Display *dpy; - int *cmajor_return, *cminor_return; +XRecordQueryVersion(Display *dpy, int *cmajor_return, int *cminor_return) { XExtDisplayInfo *info = find_display (dpy); register xRecordQueryVersionReq *req; @@ -288,13 +285,9 @@ XRecordQueryVersion (dpy, cmajor_return, cminor_return) } XRecordContext -XRecordCreateContext(dpy, datum_flags, clients, nclients, ranges, nranges) - Display *dpy; - int datum_flags; - XRecordClientSpec *clients; - int nclients; - XRecordRange **ranges; - int nranges; +XRecordCreateContext(Display *dpy, int datum_flags, + XRecordClientSpec *clients, int nclients, + XRecordRange **ranges, int nranges) { XExtDisplayInfo *info = find_display (dpy); register xRecordCreateContextReq *req; @@ -322,20 +315,15 @@ XRecordCreateContext(dpy, datum_flags, clients, nclients, ranges, nranges) } XRecordRange * -XRecordAllocRange() +XRecordAllocRange(void) { return (XRecordRange*)Xcalloc(1, sizeof(XRecordRange)); } Status -XRecordRegisterClients(dpy, context, datum_flags, clients, nclients, ranges, nranges) - Display *dpy; - XRecordContext context; - int datum_flags; - XRecordClientSpec *clients; - int nclients; - XRecordRange **ranges; - int nranges; +XRecordRegisterClients(Display *dpy, XRecordContext context, int datum_flags, + XRecordClientSpec *clients, int nclients, + XRecordRange **ranges, int nranges) { XExtDisplayInfo *info = find_display (dpy); register xRecordRegisterClientsReq *req; @@ -363,11 +351,8 @@ XRecordRegisterClients(dpy, context, datum_flags, clients, nclients, ranges, nra } Status -XRecordUnregisterClients(dpy, context, clients, nclients) - Display *dpy; - XRecordContext context; - XRecordClientSpec *clients; - int nclients; +XRecordUnregisterClients(Display *dpy, XRecordContext context, + XRecordClientSpec *clients, int nclients) { XExtDisplayInfo *info = find_display (dpy); register xRecordUnregisterClientsReq *req; @@ -418,10 +403,8 @@ WireToLibRange( } Status -XRecordGetContext(dpy, context, state_return) - Display *dpy; - XRecordContext context; - XRecordState **state_return; +XRecordGetContext(Display *dpy, XRecordContext context, + XRecordState **state_return) { XExtDisplayInfo *info = find_display (dpy); register xRecordGetContextReq *req; @@ -519,8 +502,7 @@ XRecordGetContext(dpy, context, state_return) } void -XRecordFreeState(state) - XRecordState *state; +XRecordFreeState(XRecordState *state) { int i; @@ -608,8 +590,7 @@ static XRecordInterceptData *alloc_inter_data(XExtDisplayInfo *info) } void -XRecordFreeData(data) - XRecordInterceptData *data; +XRecordFreeData(XRecordInterceptData *data) { /* we can do this cast because that is what we really allocated */ struct intercept_queue *iq = (struct intercept_queue *)data; @@ -849,11 +830,8 @@ parse_reply_call_callback( } Status -XRecordEnableContext(dpy, context, callback, closure) - Display *dpy; - XRecordContext context; - XRecordInterceptProc callback; - XPointer closure; +XRecordEnableContext(Display *dpy, XRecordContext context, + XRecordInterceptProc callback, XPointer closure) { XExtDisplayInfo *info = find_display (dpy); register xRecordEnableContextReq *req; @@ -986,11 +964,8 @@ record_async_handler( * to get the rest. */ Status -XRecordEnableContextAsync(dpy, context, callback, closure) - Display *dpy; - XRecordContext context; - XRecordInterceptProc callback; - XPointer closure; +XRecordEnableContextAsync(Display *dpy, XRecordContext context, + XRecordInterceptProc callback, XPointer closure) { XExtDisplayInfo *info = find_display (dpy); register xRecordEnableContextReq *req; @@ -1059,16 +1034,13 @@ XRecordEnableContextAsync(dpy, context, callback, closure) } void -XRecordProcessReplies(dpy) - Display *dpy; +XRecordProcessReplies(Display *dpy) { (void) XPending(dpy); } Status -XRecordDisableContext(dpy, context) - Display *dpy; - XRecordContext context; +XRecordDisableContext(Display *dpy, XRecordContext context) { XExtDisplayInfo *info = find_display (dpy); register xRecordDisableContextReq *req; @@ -1086,9 +1058,7 @@ XRecordDisableContext(dpy, context) } Status -XRecordFreeContext(dpy, context) - Display *dpy; - XRecordContext context; +XRecordFreeContext(Display *dpy, XRecordContext context) { XExtDisplayInfo *info = find_display (dpy); register xRecordFreeContextReq *req; diff --git a/src/XTest.c b/src/XTest.c index 82ad52a..45f593e 100644 --- a/src/XTest.c +++ b/src/XTest.c @@ -97,11 +97,9 @@ static XEXT_GENERATE_CLOSE_DISPLAY (close_display, xtest_info) *****************************************************************************/ Bool -XTestQueryExtension (dpy, event_base_return, error_base_return, - major_return, minor_return) - Display *dpy; - int *event_base_return, *error_base_return; - int *major_return, *minor_return; +XTestQueryExtension (Display *dpy, + int *event_base_return, int *error_base_return, + int *major_return, int *minor_return) { XExtDisplayInfo *info = find_display (dpy); register xXTestGetVersionReq *req; @@ -132,10 +130,7 @@ XTestQueryExtension (dpy, event_base_return, error_base_return, } Bool -XTestCompareCursorWithWindow(dpy, window, cursor) - Display *dpy; - Window window; - Cursor cursor; +XTestCompareCursorWithWindow(Display *dpy, Window window, Cursor cursor) { XExtDisplayInfo *info = find_display (dpy); register xXTestCompareCursorReq *req; @@ -160,19 +155,14 @@ XTestCompareCursorWithWindow(dpy, window, cursor) } Bool -XTestCompareCurrentCursorWithWindow(dpy, window) - Display *dpy; - Window window; +XTestCompareCurrentCursorWithWindow(Display *dpy, Window window) { return XTestCompareCursorWithWindow(dpy, window, XTestCurrentCursor); } int -XTestFakeKeyEvent(dpy, keycode, is_press, delay) - Display *dpy; - unsigned int keycode; - Bool is_press; - unsigned long delay; +XTestFakeKeyEvent(Display *dpy, unsigned int keycode, + Bool is_press, unsigned long delay) { XExtDisplayInfo *info = find_display (dpy); register xXTestFakeInputReq *req; @@ -192,11 +182,8 @@ XTestFakeKeyEvent(dpy, keycode, is_press, delay) } int -XTestFakeButtonEvent(dpy, button, is_press, delay) - Display *dpy; - unsigned int button; - Bool is_press; - unsigned long delay; +XTestFakeButtonEvent(Display *dpy, unsigned int button, + Bool is_press, unsigned long delay) { XExtDisplayInfo *info = find_display (dpy); register xXTestFakeInputReq *req; @@ -216,11 +203,7 @@ XTestFakeButtonEvent(dpy, button, is_press, delay) } int -XTestFakeMotionEvent(dpy, screen, x, y, delay) - Display *dpy; - int screen; - int x, y; - unsigned long delay; +XTestFakeMotionEvent(Display *dpy, int screen, int x, int y, unsigned long delay) { XExtDisplayInfo *info = find_display (dpy); register xXTestFakeInputReq *req; @@ -246,10 +229,7 @@ XTestFakeMotionEvent(dpy, screen, x, y, delay) } int -XTestFakeRelativeMotionEvent(dpy, dx, dy, delay) - Display *dpy; - int dx, dy; - unsigned long delay; +XTestFakeRelativeMotionEvent(Display *dpy, int dx, int dy, unsigned long delay) { XExtDisplayInfo *info = find_display (dpy); register xXTestFakeInputReq *req; @@ -316,14 +296,9 @@ send_axes( } int -XTestFakeDeviceKeyEvent(dpy, dev, keycode, is_press, axes, n_axes, delay) - Display *dpy; - XDevice *dev; - unsigned int keycode; - Bool is_press; - int *axes; - int n_axes; - unsigned long delay; +XTestFakeDeviceKeyEvent(Display *dpy, XDevice *dev, + unsigned int keycode, Bool is_press, + int *axes, int n_axes, unsigned long delay) { XExtDisplayInfo *info = find_display (dpy); register xXTestFakeInputReq *req; @@ -347,14 +322,9 @@ XTestFakeDeviceKeyEvent(dpy, dev, keycode, is_press, axes, n_axes, delay) } int -XTestFakeDeviceButtonEvent(dpy, dev, button, is_press, axes, n_axes, delay) - Display *dpy; - XDevice *dev; - unsigned int button; - Bool is_press; - int *axes; - int n_axes; - unsigned long delay; +XTestFakeDeviceButtonEvent(Display *dpy, XDevice *dev, + unsigned int button, Bool is_press, + int *axes, int n_axes, unsigned long delay) { XExtDisplayInfo *info = find_display (dpy); register xXTestFakeInputReq *req; @@ -378,13 +348,8 @@ XTestFakeDeviceButtonEvent(dpy, dev, button, is_press, axes, n_axes, delay) } int -XTestFakeProximityEvent(dpy, dev, in_prox, axes, n_axes, delay) - Display *dpy; - XDevice *dev; - Bool in_prox; - int *axes; - int n_axes; - unsigned long delay; +XTestFakeProximityEvent(Display *dpy, XDevice *dev, Bool in_prox, + int *axes, int n_axes, unsigned long delay) { XExtDisplayInfo *info = find_display (dpy); register xXTestFakeInputReq *req; @@ -407,15 +372,9 @@ XTestFakeProximityEvent(dpy, dev, in_prox, axes, n_axes, delay) } int -XTestFakeDeviceMotionEvent(dpy, dev, is_relative, - first_axis, axes, n_axes, delay) - Display *dpy; - XDevice *dev; - Bool is_relative; - int first_axis; - int *axes; - int n_axes; - unsigned long delay; +XTestFakeDeviceMotionEvent(Display *dpy, XDevice *dev, + Bool is_relative, int first_axis, + int *axes, int n_axes, unsigned long delay) { XExtDisplayInfo *info = find_display (dpy); register xXTestFakeInputReq *req; @@ -437,9 +396,7 @@ XTestFakeDeviceMotionEvent(dpy, dev, is_relative, } int -XTestGrabControl(dpy, impervious) - Display *dpy; - Bool impervious; +XTestGrabControl(Display *dpy, Bool impervious) { XExtDisplayInfo *info = find_display (dpy); register xXTestGrabControlReq *req; @@ -457,17 +414,13 @@ XTestGrabControl(dpy, impervious) } void -XTestSetGContextOfGC(gc, gid) - GC gc; - GContext gid; +XTestSetGContextOfGC(GC gc, GContext gid) { gc->gid = gid; } void -XTestSetVisualIDOfVisual(visual, visualid) - Visual *visual; - VisualID visualid; +XTestSetVisualIDOfVisual(Visual *visual, VisualID visualid) { visual->visualid = visualid; } @@ -477,8 +430,7 @@ static xReq _dummy_request = { }; Status -XTestDiscard(dpy) - Display *dpy; +XTestDiscard(Display *dpy) { Bool something; register char *ptr; |