summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2009-01-15 18:30:21 -0200
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2009-01-15 18:30:21 -0200
commit014ec6084387c77f211832ee7c0c95ad56fbb1af (patch)
treed5ddfd1fc32ffacd3e208354ccc1312f2e1f567b
parent449643fa6811de4539c498d43f3af777a0a7c037 (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--.gitignore4
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac8
-rw-r--r--fslsfonts.c22
4 files changed, 24 insertions, 12 deletions
diff --git a/.gitignore b/.gitignore
index 928d42b..391a3bd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,3 +18,7 @@ install-sh
missing
stamp-h1
*~
+*.o
+fslsfonts-*.tar.*
+ChangeLog
+tags
diff --git a/Makefile.am b/Makefile.am
index bbb98a2..244222b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -68,6 +68,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 bc2200c..0353d53 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,17 +26,25 @@ AC_INIT(fslsfonts,[1.0.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=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
AC_PROG_INSTALL
+XORG_CWARNFLAGS
+
# Checks for pkg-config packages
PKG_CHECK_MODULES(FSLSFONTS, x11 libfs)
+FSLSFONTS_CFLAGS="$CWARNFLAGS $FSLSFONTS_CFLAGS"
AC_SUBST(FSLSFONTS_CFLAGS)
AC_SUBST(FSLSFONTS_LIBS)
XORG_MANPAGE_SECTIONS
XORG_RELEASE_VERSION
+XORG_CHANGELOG
AC_OUTPUT([Makefile])
diff --git a/fslsfonts.c b/fslsfonts.c
index 9760db2..b6cb6cb 100644
--- a/fslsfonts.c
+++ b/fslsfonts.c
@@ -54,20 +54,20 @@ in this Software without prior written authorization from The Open Group.
#define N_START 1000 /* Maximum # of fonts to start with */
#endif
-int max_output_line_width = 79;
-int output_line_padding = 3;
-int columns = 0;
+static int max_output_line_width = 79;
+static int output_line_padding = 3;
+static int columns = 0;
#define L_SHORT 0
#define L_MEDIUM 1
#define L_LONG 2
#define L_VERYLONG 3
-Bool sort_output = True;
-int long_list = L_SHORT;
-int nnames = N_START;
-int font_cnt;
-int min_max;
+static Bool sort_output = True;
+static int long_list = L_SHORT;
+static int nnames = N_START;
+static int font_cnt;
+static int min_max;
typedef struct {
char *name;
FSXFontInfoHeader *info;
@@ -75,11 +75,11 @@ typedef struct {
FSPropOffset *po;
unsigned char *pd;
} FontList;
-FontList *font_list;
+static FontList *font_list;
-FSServer *svr;
+static FSServer *svr;
-char *program_name;
+static char *program_name;
static void usage ( void );
static void get_list ( char *pattern );