diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2009-01-13 16:26:42 -0200 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2009-01-13 16:26:42 -0200 |
commit | 82d76c4efcae92709aa07ec9e653f73076f43ebf (patch) | |
tree | f2e47733c95115ff34c0d0adf82b80c6d6f93316 | |
parent | 48663cb8af72ea5e0528a341a7dc8865aa84fad2 (diff) |
Ansification and compile warning fixes.
This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, corrects
make distcheck and all gcc 4.3 and sparse warnings.
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | Clock.c | 22 | ||||
-rw-r--r-- | Makefile.am | 18 | ||||
-rw-r--r-- | app-defaults/XClock (renamed from app-defaults/XClock.ad) | 0 | ||||
-rw-r--r-- | app-defaults/XClock-color (renamed from app-defaults/XClock-color.ad) | 0 | ||||
-rw-r--r-- | configure.ac | 15 |
6 files changed, 33 insertions, 26 deletions
@@ -20,3 +20,7 @@ stamp-h1 xclock xclock.1 *~ +*.o +xclock-*.tar.* +ChangeLog +tags @@ -325,7 +325,7 @@ static void CvtStringToPixmap( #endif #ifdef XRENDER -XtConvertArgRec xftColorConvertArgs[] = { +static XtConvertArgRec xftColorConvertArgs[] = { {XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.screen), sizeof(Screen *)}, {XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.colormap), @@ -489,7 +489,7 @@ XmuCvtStringToXftFont(Display *dpy, return False; } -XtConvertArgRec xftFontConvertArgs[] = { +static XtConvertArgRec xftFontConvertArgs[] = { {XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.screen), sizeof(Screen *)}, }; @@ -752,7 +752,7 @@ Initialize (Widget request, Widget new, ArgList args, Cardinal *num_args) w->clock.can_polygon = False; } w->clock.pixmap = 0; - w->clock.draw = 0; + w->clock.draw = NULL; w->clock.damage.x = 0; w->clock.damage.y = 0; w->clock.damage.height = 0; @@ -798,8 +798,8 @@ RenderClip (ClockWidget w) { Region r; Drawable d; - - RenderPrepare (w, 0); + + RenderPrepare (w, NULL); if (w->clock.buffer) d = w->clock.pixmap; else @@ -1225,7 +1225,7 @@ Resize(Widget gw) if (w->clock.draw) { XftDrawDestroy (w->clock.draw); - w->clock.draw = 0; + w->clock.draw = NULL; } w->clock.picture = 0; } @@ -1436,22 +1436,22 @@ clock_tic(XtPointer client_data, XtIntervalId *id) #endif RenderTextBounds (w, w->clock.prev_time_string, i, prev_len, - &old_tail, 0, 0); + &old_tail, NULL, NULL); RenderUpdateRectBounds (&old_tail, &w->clock.damage); RenderTextBounds (w, time_ptr, i, len, - &new_tail, 0, 0); + &new_tail, NULL, NULL); RenderUpdateRectBounds (&new_tail, &w->clock.damage); while (i) { - RenderTextBounds (w, time_ptr, 0, i, &head, 0, 0); + RenderTextBounds (w, time_ptr, 0, i, &head, NULL, NULL); if (!RenderRectIn (&head, &w->clock.damage)) break; i--; } RenderTextBounds (w, time_ptr, i, len, &new_tail, &x, &y); RenderClip (w); - RenderPrepare (w, 0); + RenderPrepare (w, NULL); #ifndef NO_I18N if (w->clock.utf8) { XftDrawStringUtf8 (w->clock.draw, @@ -2207,7 +2207,7 @@ SetValues(Widget gcurrent, Widget grequest, Widget gnew, if (new->clock.draw) { XftDrawDestroy (new->clock.draw); - new->clock.draw = 0; + new->clock.draw = NULL; } new->clock.picture = 0; } diff --git a/Makefile.am b/Makefile.am index 67faa6e..21c3685 100644 --- a/Makefile.am +++ b/Makefile.am @@ -35,24 +35,16 @@ appman_PRE = \ # App default files (*.ad) -appdefaultdir = @appdefaultdir@ +DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults +appdefaultdir = @appdefaultdir@ -APPDEFAULTFILES = \ +dist_appdefault_DATA = \ app-defaults/XClock-color \ app-defaults/XClock -SUFFIXES = .ad - -.ad: - [ -d app-defaults ] || mkdir app-defaults - cp $< $@ - -appdefault_DATA = $(APPDEFAULTFILES) - EXTRA_DIST = \ ChangeLog \ - $(APPDEFAULTFILES:%=%.ad) \ clmask.bit \ clock.bit @@ -70,7 +62,7 @@ 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 @@ -93,7 +85,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) < $< > $@ diff --git a/app-defaults/XClock.ad b/app-defaults/XClock index 971ae2d..971ae2d 100644 --- a/app-defaults/XClock.ad +++ b/app-defaults/XClock diff --git a/app-defaults/XClock-color.ad b/app-defaults/XClock-color index ec857f6..ec857f6 100644 --- a/app-defaults/XClock-color.ad +++ b/app-defaults/XClock-color diff --git a/configure.ac b/configure.ac index 17e9c8e..4b6d07b 100644 --- a/configure.ac +++ b/configure.ac @@ -26,11 +26,17 @@ AC_INIT(xclock,[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) AC_PROG_CC AC_PROG_INSTALL +XORG_CWARNFLAGS + AC_CHECK_FUNCS([strlcpy getpid]) AC_SEARCH_LIBS([iconv], [iconv], @@ -39,7 +45,7 @@ AC_SEARCH_LIBS([iconv], [iconv], dnl Required dependencies PKG_CHECK_MODULES(XCLOCK_X11, x11) PKG_CHECK_MODULES(XAW, xaw7) -XCLOCK_CFLAGS="$XCLOCK_X11_CFLAGS $XAW_CFLAGS" +XCLOCK_CFLAGS="$CWARNFLAGS $XCLOCK_X11_CFLAGS $XAW_CFLAGS" XCLOCK_LIBS="$XCLOCK_X11_LIBS $XAW_LIBS" dnl Optional dependencies @@ -65,10 +71,15 @@ AC_SUBST(XCLOCK_CFLAGS) AC_SUBST(XCLOCK_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=<pathname>], + [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]) |