summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--Makefile.am3
-rw-r--r--configure.ac15
-rw-r--r--grid.c18
-rw-r--r--xfd.c6
5 files changed, 31 insertions, 15 deletions
diff --git a/.gitignore b/.gitignore
index e3a73ac..66786e5 100644
--- a/.gitignore
+++ b/.gitignore
@@ -19,3 +19,7 @@ stamp-h1
xfd
xfd.1
*~
+*.o
+xfd-*.tar.*
+ChangeLog
+tags
diff --git a/Makefile.am b/Makefile.am
index dbfbeb9..370e31f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -34,6 +34,7 @@ appman_PRE = \
xfd.man
# App default files
+DISTCHECK_CONFIGURE_FLAGS = --with-appdefaultdir=\$${datadir}/X11/app-defaults
appdefaultdir = @appdefaultdir@
@@ -79,6 +80,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 e80b51f..4b9936f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,12 +26,18 @@ AC_INIT(xfd,[1.0.1], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],x
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
AM_PROG_CC_C_O
AC_PROG_INSTALL
+XORG_CWARNFLAGS
+
# Checks for pkg-config packages
PKG_CHECK_MODULES(XAW, xaw7)
@@ -39,16 +45,21 @@ PKG_CHECK_MODULES(ADDITIONAL, freetype2 fontconfig xft)
XFD_CFLAGS="$XAW_CFLAGS $ADDITIONAL_CFLAGS"
XFD_LIBS="$XAW_LIBS $ADDITIONAL_LIBS"
-
+XFD_CFLAGS="$CWARNFLAGS $XFD_CFLAGS"
AC_SUBST(XFD_CFLAGS)
AC_SUBST(XFD_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])
diff --git a/grid.c b/grid.c
index f4632f2..4976221 100644
--- a/grid.c
+++ b/grid.c
@@ -101,7 +101,7 @@ static XtResource resources[] = {
{XtNforeground, XtCForeground, XtRXftColor, sizeof(XftColor),
Offset(fg_color), XtRString, XtDefaultForeground},
{XtNface, XtCFace, XtRXftFont, sizeof (XftFont *),
- Offset (text_face), XtRString, 0},
+ Offset (text_face), XtRString, NULL},
#endif
};
@@ -249,7 +249,7 @@ GridLastChar (Widget w)
#define CI_GET_CHAR_INFO_1D(fs,col,cs) \
{ \
- cs = 0; \
+ cs = NULL; \
if (col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \
if (fs->per_char == NULL) { \
cs = &fs->min_bounds; \
@@ -257,7 +257,7 @@ GridLastChar (Widget w)
cs = &fs->per_char[(col - fs->min_char_or_byte2)]; \
} \
if (CI_NONEXISTCHAR(cs)) \
- cs = 0; \
+ cs = NULL; \
} \
}
@@ -267,7 +267,7 @@ GridLastChar (Widget w)
*/
#define CI_GET_CHAR_INFO_2D(fs,row,col,cs) \
{ \
- cs = 0; \
+ cs = NULL; \
if (row >= fs->min_byte1 && row <= fs->max_byte1 && \
col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \
if (fs->per_char == NULL) { \
@@ -279,7 +279,7 @@ GridLastChar (Widget w)
(col - fs->min_char_or_byte2)]; \
} \
if (CI_NONEXISTCHAR(cs)) \
- cs = 0; \
+ cs = NULL; \
} \
}
@@ -311,7 +311,7 @@ GridHasChar (Widget w, long ch)
unsigned int c = (ch & 0xff);
CI_GET_CHAR_INFO_2D (fs, r, c, cs);
}
- return cs != 0;
+ return cs != NULL;
}
}
@@ -382,7 +382,7 @@ get_gc(FontGridWidget fgw, Pixel fore)
#ifdef XRENDER
-XtConvertArgRec xftColorConvertArgs[] = {
+static XtConvertArgRec xftColorConvertArgs[] = {
{XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.screen),
sizeof(Screen *)},
{XtWidgetBaseOffset, (XtPointer)XtOffsetOf(WidgetRec, core.colormap),
@@ -534,8 +534,8 @@ XmuCvtStringToXftFont(Display *dpy,
screen = *((Screen **) args[0].addr);
name = (char *) fromVal->addr;
-
- font = 0;
+
+ font = NULL;
if (name)
{
font = XftFontOpenName (dpy,
diff --git a/xfd.c b/xfd.c
index 6183eed..ea36b08 100644
--- a/xfd.c
+++ b/xfd.c
@@ -46,7 +46,7 @@ in this Software without prior written authorization from The Open Group.
#include <X11/extensions/Xrender.h>
#endif
-char *ProgramName;
+static char *ProgramName;
static XrmOptionDescRec xfd_options[] = {
{"-fn", "*grid.font", XrmoptionSepArg, (caddr_t) NULL },
@@ -90,7 +90,7 @@ static XtActionsRec xfd_actions[] = {
static Atom wm_delete_window;
-Widget quitButton, prev16Button, prevButton, nextButton, next16Button;
+static Widget quitButton, prev16Button, prevButton, nextButton, next16Button;
#define DEF_SELECT_FORMAT "character 0x%04x%02x (%u,%u) (%#o,%#o)"
@@ -256,7 +256,7 @@ main(int argc, char *argv[])
FcPatternGetString (xft->pattern, FC_STYLE, 0, &style);
size = 0;
FcPatternGetDouble (xft->pattern, FC_SIZE, 0, &size);
- p = FcPatternBuild (0,
+ p = FcPatternBuild (NULL,
FC_FAMILY, FcTypeString, family,
FC_STYLE, FcTypeString, style,
FC_SIZE, FcTypeDouble, size,