diff options
author | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2009-01-28 17:27:31 -0200 |
---|---|---|
committer | Paulo Cesar Pereira de Andrade <pcpa@mandriva.com.br> | 2009-01-28 17:27:31 -0200 |
commit | c9ad299b2b772a4e156a3530ff6d8e8312898c2f (patch) | |
tree | f0f832343c3b457f38cbf6cf8339dae5708eb206 | |
parent | 1b0f683f6ddb8423dcc671f8d633650504a23a2d (diff) |
Janitor: ansification, make distcheck, compiler warnings.
-rw-r--r-- | .gitignore | 10 | ||||
-rw-r--r-- | Makefile.am | 4 | ||||
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | src/.gitignore | 8 | ||||
-rw-r--r-- | src/Makefile.am | 4 | ||||
-rw-r--r-- | src/image/epackbits.c | 3 | ||||
-rw-r--r-- | src/image/mkg3states.c | 35 | ||||
-rw-r--r-- | src/lbx_zlib/lbx_zlib.c | 14 | ||||
-rw-r--r-- | src/lbx_zlib/lbx_zlib_io.c | 38 | ||||
-rw-r--r-- | src/lbx_zlib/reqstats.c | 2 |
10 files changed, 55 insertions, 69 deletions
@@ -1,3 +1,5 @@ +.deps +.libs aclocal.m4 autom4te.cache config.guess @@ -19,3 +21,11 @@ missing mkinstalldirs stamp-h1 *~ +*.o +*.la +*.lo +liblbxutil-*.tar.* +ChangeLog +tags +g3states.h +mkg3states diff --git a/Makefile.am b/Makefile.am index 4912124..9300155 100644 --- a/Makefile.am +++ b/Makefile.am @@ -26,7 +26,7 @@ SUBDIRS = src pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = lbxutil.pc -EXTRA_DIST = lbxutil.pc.in autogen.sh +EXTRA_DIST = lbxutil.pc.in EXTRA_DIST += ChangeLog MAINTAINERCLEANFILES = ChangeLog @@ -34,6 +34,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 619ca39..a4ece27 100644 --- a/configure.ac +++ b/configure.ac @@ -27,11 +27,15 @@ AC_INIT(lbxutil, 1.0.1, [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) # Check for progs AC_PROG_CC AC_PROG_LIBTOOL +XORG_CWARNFLAGS # Check for X PKG_CHECK_MODULES(LBXUTIL, xextproto xproto) @@ -39,6 +43,7 @@ PKG_CHECK_MODULES(LBXUTIL, xextproto xproto) AC_CHECK_LIB(z,deflate,[LBXUTIL_LIBS="${LBXUTIL_LIBS} -lz"], AC_MSG_ERROR([zlib is required to build liblbxutil])) +LBXUTIL_CFLAGS="$CWARNFLAGS $LBXUTIL_CFLAGS" AC_SUBST(LBXUTIL_CFLAGS) AC_SUBST(LBXUTIL_LIBS) @@ -46,6 +51,7 @@ AC_SUBST(LBXUTIL_LIBS) # find the required protocol version XORG_RELEASE_VERSION +XORG_CHANGELOG AC_OUTPUT([Makefile src/Makefile diff --git a/src/.gitignore b/src/.gitignore deleted file mode 100644 index f1fd55d..0000000 --- a/src/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -.deps -g3states.h -liblbxutil.la -.libs -*.lo -Makefile -Makefile.in -mkg3states diff --git a/src/Makefile.am b/src/Makefile.am index f2f52a5..2b480c0 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,5 +1,7 @@ lib_LTLIBRARIES = liblbxutil.la +AM_CFLAGS = @LBXUTIL_CFLAGS@ + noinst_PROGRAMS = mkg3states mkg3states_SOURCES = \ @@ -24,8 +26,6 @@ nodist_liblbxutil_la_SOURCES = g3states.h liblbxutil_la_LIBADD = @LBXUTIL_LIBS@ -INCLUDES = @LBXUTIL_CFLAGS@ - $(srcdir)/image/dfaxg42d.c: g3states.h g3states.h: mkg3states diff --git a/src/image/epackbits.c b/src/image/epackbits.c index 816fee5..5696857 100644 --- a/src/image/epackbits.c +++ b/src/image/epackbits.c @@ -25,6 +25,7 @@ #include <X11/Xfuncproto.h> #include <X11/extensions/lbximage.h> +#include <stdio.h> /* NULL */ /* * ------------------------------------------------------------------------- @@ -57,7 +58,7 @@ EncodePackBits (char *inbuf, enum { BASE, LITERAL, RUN, LITERAL_RUN } state; state = BASE; - lastliteral = 0; + lastliteral = NULL; while (pixelsLeft > 0) { diff --git a/src/image/mkg3states.c b/src/image/mkg3states.c index 0e8fe36..a2dbb52 100644 --- a/src/image/mkg3states.c +++ b/src/image/mkg3states.c @@ -168,11 +168,11 @@ typedef unsigned char NullModeTable[MAX_NULLPREFIX][256]; typedef unsigned char HorizModeTable[MAX_HORIZPREFIX][256]; /* the bit string corresponding to this row of the decoding table */ -long null_mode_prefix[MAX_NULLPREFIX]; -NullModeTable null_mode; /* MODE_*, indexed by bit and byte */ -NullModeTable null_mode_next_state; /* next row of decoding tables to use */ +static long null_mode_prefix[MAX_NULLPREFIX]; +static NullModeTable null_mode; /* MODE_*, indexed by bit and byte */ +static NullModeTable null_mode_next_state; /* next row of decoding tables to use */ /* number of prefixes or rows in the G4 decoding tables */ -short null_mode_prefix_count = 0; +static short null_mode_prefix_count = 0; void write_null_mode_table ( FILE *fd, NullModeTable table, char *name ); void write_horiz_mode_table ( FILE *fd, HorizModeTable table, char *name ); @@ -204,10 +204,10 @@ void write_horiz_mode_table ( FILE *fd, HorizModeTable table, char *name ); /* invalid code encountered */ #define UNCOMP_INVALID 14 -long uncomp_mode_prefix[MAX_NULLPREFIX]; -NullModeTable uncomp_mode; -NullModeTable uncomp_mode_next_state; -short uncomp_mode_prefix_count = 0; +static long uncomp_mode_prefix[MAX_NULLPREFIX]; +static NullModeTable uncomp_mode; +static NullModeTable uncomp_mode_next_state; +static short uncomp_mode_prefix_count = 0; /* * Decoding action values for horiz_mode. @@ -219,7 +219,7 @@ short uncomp_mode_prefix_count = 0; #define ACT_BRUNT 106 /* terminating black run code */ #define ACT_BRUN 169 /* non-terminating black run code */ #define ACT_EOL 210 /* end-of-line code */ -HorizModeTable horiz_mode; +static HorizModeTable horiz_mode; short horiz_mode_code_black (short runlen) { @@ -237,19 +237,19 @@ short horiz_mode_code_white (short runlen) * otherwise, it is the bit number with which to continue * decoding the next codeword. */ -HorizModeTable horiz_mode_next_state; +static HorizModeTable horiz_mode_next_state; /* prefixes corresponding to the rows of the decoding table */ -long horiz_mode_prefix[MAX_HORIZPREFIX]; +static long horiz_mode_prefix[MAX_HORIZPREFIX]; /* color of next run, BLACK or WHITE */ -char horiz_mode_color[MAX_HORIZPREFIX]; -short horiz_mode_prefix_count = 0; +static char horiz_mode_color[MAX_HORIZPREFIX]; +static short horiz_mode_prefix_count = 0; static unsigned char bit_mask[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 }; -int verbose = FALSE; -char *storage_class = ""; +static int verbose = FALSE; +static char *storage_class = ""; int main (int argc, char *argv[]) @@ -283,10 +283,7 @@ main (int argc, char *argv[]) exit(0); } -void write_null_mode_table (fd, table, name) -FILE *fd; -NullModeTable table; -char *name; +void write_null_mode_table (FILE *fd, NullModeTable table, char *name) { int i, j; char* outersep; diff --git a/src/lbx_zlib/lbx_zlib.c b/src/lbx_zlib/lbx_zlib.c index a306278..ed7e74a 100644 --- a/src/lbx_zlib/lbx_zlib.c +++ b/src/lbx_zlib/lbx_zlib.c @@ -68,12 +68,12 @@ from The Open Group. #include "lbx_zlib.h" #include <X11/extensions/lbxzlib.h> -unsigned long stream_out_compressed = 0; -unsigned long stream_out_uncompressed = 0; -unsigned long stream_out_plain = 0; -unsigned long stream_in_compressed = 0; -unsigned long stream_in_uncompressed = 0; -unsigned long stream_in_plain=0; +static unsigned long stream_out_compressed = 0; +static unsigned long stream_out_uncompressed = 0; +static unsigned long stream_out_plain = 0; +static unsigned long stream_in_compressed = 0; +static unsigned long stream_in_uncompressed = 0; +static unsigned long stream_in_plain=0; #ifdef LBXREQSTATS unsigned long stream_in_packet_header_bytes = 0; extern int LbxWhoAmI; @@ -326,7 +326,7 @@ ZlibFree(struct ZlibInfo *comp) { if (!comp) return; - per_fd[comp->fd] = 0; + per_fd[comp->fd] = NULL; FreeZlibBuffer(&comp->inbuf); FreeZlibBuffer(&comp->outbuf); diff --git a/src/lbx_zlib/lbx_zlib_io.c b/src/lbx_zlib/lbx_zlib_io.c index 12b29a3..09186b1 100644 --- a/src/lbx_zlib/lbx_zlib_io.c +++ b/src/lbx_zlib/lbx_zlib_io.c @@ -70,9 +70,7 @@ writev(int fildes, const struct iovec *iov, int iovcnt) #endif int -InitZlibBuffer(b, size) - ZlibBufferPtr b; - int size; +InitZlibBuffer(ZlibBufferPtr b, int size) { if ((b->bufbase = (char *)Xalloc(size)) == NULL) return -1; @@ -83,8 +81,7 @@ InitZlibBuffer(b, size) } void -FreeZlibBuffer(b) - ZlibBufferPtr b; +FreeZlibBuffer(ZlibBufferPtr b) { if (b->bufbase) { Xfree(b->bufbase); @@ -99,11 +96,7 @@ FreeZlibBuffer(b) * -1 if error */ int -GetInputPtr(fd, inbuf, reqlen, ppkt) - int fd; - ZlibBufferPtr inbuf; - int reqlen; - unsigned char **ppkt; +GetInputPtr(int fd, ZlibBufferPtr inbuf, int reqlen, unsigned char **ppkt) { int readbytes; int gotbytes; @@ -142,10 +135,7 @@ GetInputPtr(fd, inbuf, reqlen, ppkt) */ int -StuffInput(inbuf, pkt, reqlen) - ZlibBufferPtr inbuf; - unsigned char *pkt; - int reqlen; +StuffInput(ZlibBufferPtr inbuf, unsigned char *pkt, int reqlen) { int readbytes; char *last; @@ -164,9 +154,7 @@ StuffInput(inbuf, pkt, reqlen) } void -FreeInput(inbuf, len) - ZlibBufferPtr inbuf; - int len; +FreeInput(ZlibBufferPtr inbuf, int len) { inbuf->bufptr += len; if ((inbuf->bufcnt -= len) == 0) @@ -177,9 +165,7 @@ FreeInput(inbuf, len) * Reserve outlen bytes in the output buffer. */ char * -ReserveOutBuf(outbuf, outlen) - ZlibBufferPtr outbuf; - int outlen; +ReserveOutBuf(ZlibBufferPtr outbuf, int outlen) { int left; @@ -194,9 +180,7 @@ ReserveOutBuf(outbuf, outlen) * Commit previously reserved space as real output */ void -CommitOutBuf(outbuf, outlen) - ZlibBufferPtr outbuf; - int outlen; +CommitOutBuf(ZlibBufferPtr outbuf, int outlen) { outbuf->bufcnt += outlen; } @@ -207,9 +191,7 @@ CommitOutBuf(outbuf, outlen) * < 0 - write error */ int -FlushOutBuf(fd, outbuf) - int fd; - ZlibBufferPtr outbuf; +FlushOutBuf(int fd, ZlibBufferPtr outbuf) { int bytes; @@ -236,9 +218,7 @@ FlushOutBuf(fd, outbuf) * < 0 - write error */ int -FlushIovBuf(fd, iovbuf) - int fd; - struct iovec *iovbuf; +FlushIovBuf(int fd, struct iovec *iovbuf) { int bytes; int niov = 2; diff --git a/src/lbx_zlib/reqstats.c b/src/lbx_zlib/reqstats.c index 50545b8..c9acc92 100644 --- a/src/lbx_zlib/reqstats.c +++ b/src/lbx_zlib/reqstats.c @@ -497,7 +497,7 @@ do_decompress_with_stats (struct compress_private *priv) #else void -InitLbxReqStats() +InitLbxReqStats(void) {} #endif /* LBXREQSTATS */ |