diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2009-01-16 20:01:11 -0200 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2009-01-16 20:01:11 -0200 |
commit | 638f4ac8e233973dc3c89d87cd9f6ac05489fef4 (patch) | |
tree | 22c0e69fe8d9540ff8c746a70c5e249921d86808 | |
parent | 51eae7b3a07faab716ea7ef3186cee658f393d04 (diff) |
Ansification and compile warning fixes.
This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, corrects
make distcheck and most gcc 4.3 and sparse warnings.
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | charset.c | 16 | ||||
-rw-r--r-- | configure.ac | 9 | ||||
-rw-r--r-- | iso2022.c | 4 | ||||
-rw-r--r-- | luit.c | 10 |
6 files changed, 29 insertions, 16 deletions
@@ -18,3 +18,7 @@ luit.1 missing stamp-h1 *~ +*.o +luit-*.tar.* +ChangeLog +tags diff --git a/Makefile.am b/Makefile.am index 6299f16..01b86a8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -59,7 +59,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 @@ -75,13 +75,13 @@ NullReverse(unsigned int n, CharsetPtr self) return -1; } -CharsetRec Unknown94Charset = +static CharsetRec Unknown94Charset = { "Unknown (94)", T_94, 0, IdentityRecode, NullReverse, NULL, NULL}; -CharsetRec Unknown96Charset = +static CharsetRec Unknown96Charset = { "Unknown (96)", T_96, 0, IdentityRecode, NullReverse, NULL, NULL}; -CharsetRec Unknown9494Charset = +static CharsetRec Unknown9494Charset = { "Unknown (94x94)", T_9494, 0, IdentityRecode, NullReverse, NULL, NULL}; -CharsetRec Unknown9696Charset = +static CharsetRec Unknown9696Charset = { "Unknown (96x96)", T_9696, 0, IdentityRecode, NullReverse, NULL, NULL}; typedef struct _FontencCharset { @@ -94,7 +94,7 @@ typedef struct _FontencCharset { FontMapReversePtr reverse; } FontencCharsetRec, *FontencCharsetPtr; -FontencCharsetRec fontencCharsets[] = { +static FontencCharsetRec fontencCharsets[] = { {"ISO 646 (1973)", T_94, '@', "iso646.1973-0", 0x00, NULL, NULL}, {"ASCII", T_94, 'B', "iso8859-1", 0x00, NULL, NULL}, {"JIS X 0201:GL", T_94, 'J', "jisx0201.1976-0", 0x00, NULL, NULL}, @@ -154,7 +154,7 @@ typedef struct _OtherCharset { int (*stack)(unsigned char, OtherStatePtr); } OtherCharsetRec, *OtherCharsetPtr; -OtherCharsetRec otherCharsets[] = { +static OtherCharsetRec otherCharsets[] = { {"GBK", init_gbk, mapping_gbk, reverse_gbk, stack_gbk}, {"UTF-8", init_utf8, mapping_utf8, reverse_utf8, stack_utf8}, {"SJIS", init_sjis, mapping_sjis, reverse_sjis, stack_sjis}, @@ -393,7 +393,7 @@ getCharsetByName(const char *name) return getUnknownCharset(T_94); } -const LocaleCharsetRec localeCharsets[] = { +static const LocaleCharsetRec localeCharsets[] = { { "C", 0, 2, "ASCII", NULL, "ISO 8859-1", NULL, NULL}, { "POSIX", 0, 2, "ASCII", NULL, "ISO 8859-1", NULL, NULL}, { "ISO8859-1", 0, 2, "ASCII", NULL, "ISO 8859-1", NULL, NULL}, @@ -481,7 +481,7 @@ getLocaleState(const char *locale, char *charset, } if(p->name == NULL) { - if (resolved != 0) + if (resolved != NULL) free(resolved); return -1; } diff --git a/configure.ac b/configure.ac index 2fb4fdd..0b3bc27 100644 --- a/configure.ac +++ b/configure.ac @@ -26,12 +26,18 @@ AC_INIT(luit,[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 AC_CANONICAL_HOST +XORG_CWARNFLAGS + AC_CHECK_LIB(z, gzopen,, AC_MSG_ERROR([zlib not found])) AC_ARG_WITH(localealiasfile, @@ -53,11 +59,12 @@ case $host_os in ;; esac -LUIT_CFLAGS="$LUIT_CFLAGS $OS_CFLAGS" +LUIT_CFLAGS="$CWARNFLAGS $LUIT_CFLAGS $OS_CFLAGS" AC_SUBST(LUIT_CFLAGS) AC_SUBST(LUIT_LIBS) XORG_MANPAGE_SECTIONS XORG_RELEASE_VERSION +XORG_CHANGELOG AC_OUTPUT([Makefile]) @@ -37,8 +37,8 @@ THE SOFTWARE. #include "iso2022.h" #define BUFFERED_INPUT_SIZE 4 -unsigned char buffered_input[BUFFERED_INPUT_SIZE]; -int buffered_input_count = 0; +static unsigned char buffered_input[BUFFERED_INPUT_SIZE]; +static int buffered_input_count = 0; static void FatalError(char *f, ...) @@ -52,11 +52,11 @@ static char *locale_name = NULL; int ilog = -1; int olog = -1; int verbose = 0; -int converter = 0; -int exitOnChild = 0; +static int converter = 0; +static int exitOnChild = 0; -volatile int sigwinch_queued = 0; -volatile int sigchld_queued = 0; +static volatile int sigwinch_queued = 0; +static volatile int sigchld_queued = 0; static int convert(int, int); static int condom(int, char**); @@ -452,6 +452,8 @@ condom(int argc, char **argv) int rc; int val; + path = NULL; + child_argv = NULL; rc = parseArgs(argc, argv, child_argv0, &path, &child_argv); if(rc < 0) |