From e0c50fd64a739a53da72efe03f0a5e6aedf9d0da Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Tue, 13 Jan 2009 20:24:16 -0200 Subject: Ansification and compile warning fixes. This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, and corrects make distcheck. Only remaining sparse warning(s) are in the format: xtrapout.c:268:35: warning: incorrect type in argument 3 (different argument counts) xtrapout.c:268:35: expected void ( *[usertype] func )( ... ) xtrapout.c:268:35: got void ( static [toplevel] * )( ... ) and so on. And these warnings are correct, as the callback prototypes in X11/extensions/xtraplibp.h have a different prototype (apparently code in xtrapout.c was never update for library changes...). --- .gitignore | 4 ++++ Makefile.am | 2 +- configure.ac | 7 +++++++ xtrapchar.c | 42 +++++++++++++++++------------------------- xtrapin.c | 6 +++--- xtrapinfo.c | 2 +- xtrapout.c | 8 ++++---- xtrapproto.c | 2 +- xtrapreset.c | 2 +- xtrapstats.c | 2 +- 10 files changed, 40 insertions(+), 37 deletions(-) diff --git a/.gitignore b/.gitignore index dc558e7..35e6505 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,7 @@ xtrapreset.1 xtrapstats xtrapstats.1 *~ +*.o +xtrap-*.tar.* +ChangeLog +tags diff --git a/Makefile.am b/Makefile.am index e10e853..d5794fd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -164,6 +164,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 ddf96fa..605f434 100644 --- a/configure.ac +++ b/configure.ac @@ -26,17 +26,24 @@ AC_INIT(xtrap,[1.0.2], [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(XTRAP_APP, x11 xtrap) +XTRAP_APP_CFLAGS="$CWARNFLAGS $XTRAP_APP_CFLAGS" AC_SUBST(XTRAP_APP_CFLAGS) AC_SUBST(XTRAP_APP_LIBS) XORG_MANPAGE_SECTIONS XORG_RELEASE_VERSION +XORG_CHANGELOG AC_OUTPUT([Makefile]) diff --git a/xtrapchar.c b/xtrapchar.c index 06b9400..a707623 100644 --- a/xtrapchar.c +++ b/xtrapchar.c @@ -134,9 +134,9 @@ static BOOL passive_ctrl; /* Control key assumed? */ static BOOL shift; /* Cap's on? */ static BOOL ctrl; /* Control key? */ static BOOL alt; /* Alt key? */ -KeyCode alt_code; -KeyCode ctrl_code; -KeyCode shift_code; +static KeyCode alt_code; +static KeyCode ctrl_code; +static KeyCode shift_code; @@ -236,7 +236,7 @@ main(int argc, char *argv[]) { printf("Display: %s \n", DisplayString(dpy)); } - if ((tc = XECreateTC(dpy,0L, NULL)) == False) + if ((tc = XECreateTC(dpy,0L, NULL)) == NULL) { fprintf(stderr,"%s: could not initialize XTrap extension\n", ProgName); exit (1L); @@ -368,12 +368,10 @@ main(int argc, char *argv[]) exit(0L); } -static int get_csi_key(tc, private, param, nparam, inter, ninter, final) - XETC *tc; - int private; - int param[], nparam; - int inter[], ninter; - int final; +static int get_csi_key(XETC *tc, int private, + int param[], int nparam, + int inter[], int ninter, + int final) { KeySym keysym = 0; switch(param[1]) @@ -445,12 +443,10 @@ static int get_csi_key(tc, private, param, nparam, inter, ninter, final) * pointer position) * */ -static void send_special(tc, private, param, nparam, inter, ninter, final) - XETC *tc; - int private; - int param[], nparam; - int inter[], ninter; - int final; +static void send_special(XETC *tc, int private, + int param[], int nparam, + int inter[], int ninter, + int final) { switch(private) { @@ -619,12 +615,10 @@ static void send_special(tc, private, param, nparam, inter, ninter, final) } } -static int get_ss3_key(tc, private, param, nparam, inter, ninter, final) - XETC *tc; - int private; - int param[], nparam; - int inter[], ninter; - int final; +static int get_ss3_key(XETC *tc, int private, + int param[], int nparam, + int inter[], int ninter, + int final) { KeySym keysym = 0; switch(param[1]) @@ -665,9 +659,7 @@ static int get_ss3_key(tc, private, param, nparam, inter, ninter, final) return(get_keycode(tc, keysym)); } -static KeyCode get_typical_char(tc, keysym) - XETC *tc; - CARD32 keysym; +static KeyCode get_typical_char(XETC *tc, CARD32 keysym) { if (iscntrl(keysym)) { diff --git a/xtrapin.c b/xtrapin.c index face0c4..67b59d6 100644 --- a/xtrapin.c +++ b/xtrapin.c @@ -102,8 +102,8 @@ extern int opterr; static Boolean grabFlag = False; -FILE *ifp; -XrmOptionDescRec optionTable [] = +static FILE *ifp; +static XrmOptionDescRec optionTable [] = { {"-f", "*script", XrmoptionSepArg, (caddr_t) NULL}, {"-g", "*grabServer",XrmoptionSkipArg, (caddr_t) NULL}, @@ -181,7 +181,7 @@ main(int argc, char *argv[]) #endif printf("Display: %s \n", DisplayString(dpy)); - if ((tc = XECreateTC(dpy,0L, NULL)) == False) + if ((tc = XECreateTC(dpy,0L, NULL)) == NULL) { fprintf(stderr,"%s: could not initialize XTrap extension\n", ProgName); exit (1L); diff --git a/xtrapinfo.c b/xtrapinfo.c index fa96389..129d104 100644 --- a/xtrapinfo.c +++ b/xtrapinfo.c @@ -74,7 +74,7 @@ main(int argc, char *argv[]) XSynchronize(dpy, True); #endif printf("Display: %s \n", DisplayString(dpy)); - if ((tc = XECreateTC(dpy,0L, NULL)) == False) + if ((tc = XECreateTC(dpy,0L, NULL)) == NULL) { fprintf(stderr,"%s: could not initialize extension\n",argv[0]); exit(1L); diff --git a/xtrapout.c b/xtrapout.c index 35c70f7..7c7755b 100644 --- a/xtrapout.c +++ b/xtrapout.c @@ -116,9 +116,9 @@ static void print_evt_callback (XETC *tc , XETrapDatum *data , char *my_buf ); -FILE *ofp; -Bool GlobalDone = False; -XrmOptionDescRec optionTable [] = +static FILE *ofp; +static Bool GlobalDone = False; +static XrmOptionDescRec optionTable [] = { {"-f", "*script", XrmoptionSepArg, (caddr_t) NULL}, {"-e", "*eventFlag", XrmoptionSkipArg, (caddr_t) NULL}, @@ -231,7 +231,7 @@ main(int argc, char *argv[]) XSynchronize(dpy, True); #endif fprintf(stderr,"Display: %s \n", DisplayString(dpy)); - if ((tc = XECreateTC(dpy,0L, NULL)) == False) + if ((tc = XECreateTC(dpy,0L, NULL)) == NULL) { fprintf(stderr,"%s: could not initialize XTrap extension\n",ProgName); exit (1L); diff --git a/xtrapproto.c b/xtrapproto.c index d322afa..54f8e10 100644 --- a/xtrapproto.c +++ b/xtrapproto.c @@ -75,7 +75,7 @@ main(int argc, char *argv[]) (Cardinal)NULL); dpy = XtDisplay(appW); printf("Display: %s \n", DisplayString(dpy)); - if ((tc = XECreateTC(dpy,0L, NULL)) == False) + if ((tc = XECreateTC(dpy,0L, NULL)) == NULL) { fprintf(stderr,"%s: could not initialize extension\n",argv[0]); exit(1L); diff --git a/xtrapreset.c b/xtrapreset.c index 11a919a..7e4803e 100644 --- a/xtrapreset.c +++ b/xtrapreset.c @@ -74,7 +74,7 @@ main(int argc, char *argv[]) #endif printf("Resetting Display: %s \n", DisplayString(dpy)); - if ((tc = XECreateTC(dpy,0L, NULL)) == False) + if ((tc = XECreateTC(dpy,0L, NULL)) == NULL) { fprintf(stderr,"%s: could not initialize extension\n",argv[0]); exit (1L); diff --git a/xtrapstats.c b/xtrapstats.c index 171c9ac..90efbb6 100644 --- a/xtrapstats.c +++ b/xtrapstats.c @@ -81,7 +81,7 @@ main(int argc, char *argv[]) XSynchronize(dpy, True); #endif printf("Display: %s \n", DisplayString(dpy)); - if ((tc = XECreateTC(dpy,0L, NULL)) == False) + if ((tc = XECreateTC(dpy,0L, NULL)) == NULL) { fprintf(stderr,"%s: could not initialize extension\n",argv[0]); exit(1L); -- cgit v1.2.3