summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2009-01-12 18:20:06 -0200
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2009-01-12 18:20:06 -0200
commit874f71ca6bb7134d1b9172a28bda6146dd2c608e (patch)
treefee09f75c004881d231fc4f82bc4080658e55aff
parentc0227e77a62a422332edda6c8d8113fb4980ac7d (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. Note that "ico" appears to be broken, and only work with the -r option, that causes it to not use XThreads, and only draw in the root screen (with "-threads 1" option, the default, it still use XThreads).
-rw-r--r--.gitignore4
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac8
-rw-r--r--ico.c62
4 files changed, 43 insertions, 33 deletions
diff --git a/.gitignore b/.gitignore
index b26ff65..620164a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -18,3 +18,7 @@ install-sh
missing
stamp-h1
*~
+*.o
+ico-*.tar.*
+ChangeLog
+tags
diff --git a/Makefile.am b/Makefile.am
index a03cffd..b04fb36 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -50,7 +50,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
diff --git a/configure.ac b/configure.ac
index e8a433f..3d5818d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,13 +26,20 @@ AC_INIT(ico,[1.0.2], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],i
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(ICO, x11 >= 0.99.1)
+ICO_CFLAGS="$CWARNFLAGS $ICOCFLAGS"
AC_SUBST(ICO_CFLAGS)
AC_SUBST(ICO_LIBS)
XTHREADLIB=`$PKG_CONFIG --variable=xthreadlib x11`
@@ -40,5 +47,6 @@ AC_SUBST(XTHREADLIB)
XORG_MANPAGE_SECTIONS
XORG_RELEASE_VERSION
+XORG_CHANGELOG
AC_OUTPUT([Makefile])
diff --git a/ico.c b/ico.c
index 0c75962..e88edd1 100644
--- a/ico.c
+++ b/ico.c
@@ -108,7 +108,7 @@ SOFTWARE.
#include "polyinfo.h" /* define format of one polyhedron */
/* Now include all the files which define the actual polyhedra */
-Polyinfo polygons[] = {
+static Polyinfo polygons[] = {
#include "allobjs.h"
};
#define NumberPolygons sizeof(polygons)/sizeof(polygons[0])
@@ -164,25 +164,25 @@ struct closure {
/* The display is shared and writable, but Xlib locks it as necessary */
-Display *dpy;
+static Display *dpy;
/* This atom will be used to catch the ICCCM "delete window" message. It will
* be allocated once and used in read-only mode by threads, so it can be a
* global variable */
-Atom wm_delete_window;
+static Atom wm_delete_window;
/*
* variables that are not set except maybe in initialization before
* any additional threads are created
*/
-char *Primaries[] = {
+static char *Primaries[] = {
"red", "green", "blue", "yellow", "cyan", "magenta"
};
#define NumberPrimaries 6
-const char *help_message[] = {
+static const char *help_message[] = {
"where options include:",
"-display host:dpy X server to use",
" -geometry geom geometry of window to use",
@@ -214,40 +214,40 @@ const char *help_message[] = {
#endif
NULL};
-const char *ProgramName; /* argv[0] */
+static const char *ProgramName; /* argv[0] */
/*
* variables set by command-line options
*/
-const char *geom = NULL; /* -geometry: window geometry */
-int useRoot = 0; /* -r */
-int dash = 0; /* -d: dashed line pattern */
-char **colornames; /* -colors (points into argv) */
+static const char *geom = NULL; /* -geometry: window geometry */
+static int useRoot = 0; /* -r */
+static int dash = 0; /* -d: dashed line pattern */
+static char **colornames; /* -colors (points into argv) */
#ifdef MULTIBUFFER
-int update_action = MultibufferUpdateActionBackground;
+static int update_action = MultibufferUpdateActionBackground;
#endif
-int linewidth = 0; /* -lw */
-int multibufext = 0; /* -dbl: use Multi-Buffering extension */
-int dblbuf = 0; /* -dbl or -softdbl: double buffering */
-int numcolors = 0; /* -p: number of primary colors to use */
-const char *background_colorname = NULL; /* -bg */
-int doedges = 1; /* -noedges turns this off */
-int dofaces = 0; /* -faces */
-int invert = 0; /* -i */
-const char *ico_geom = NULL; /* -size: size of object in window */
-const char *delta_geom = NULL; /* -delta: amount by which to move object */
-Polyinfo *poly; /* -obj: the poly to draw */
-int dsync = 0; /* -dsync */
-int xsync = 0; /* -sync */
-int msleepcount = 0; /* -sleep value in milliseconds*/
+static int linewidth = 0; /* -lw */
+static int multibufext = 0; /* -dbl: use Multi-Buffering extension */
+static int dblbuf = 0; /* -dbl or -softdbl: double buffering */
+static int numcolors = 0; /* -p: number of primary colors to use */
+static const char *background_colorname = NULL; /* -bg */
+static int doedges = 1; /* -noedges turns this off */
+static int dofaces = 0; /* -faces */
+static int invert = 0; /* -i */
+static const char *ico_geom = NULL; /* -size: size of object in window */
+static const char *delta_geom = NULL; /* -delta: amount by which to move object */
+static Polyinfo *poly; /* -obj: the poly to draw */
+static int dsync = 0; /* -dsync */
+static int xsync = 0; /* -sync */
+static int msleepcount = 0; /* -sleep value in milliseconds*/
#ifdef MULTITHREAD
-int thread_count;
+static int thread_count;
#ifdef XMUTEX_INITIALIZER
-xmutex_rec count_mutex = XMUTEX_INITIALIZER;
+static xmutex_rec count_mutex = XMUTEX_INITIALIZER;
#else
-xmutex_rec count_mutex;
+static xmutex_rec count_mutex;
#endif
-xcondition_rec count_cond; /* Xthreads doesn't define an equivalent to
+static xcondition_rec count_cond;/* Xthreads doesn't define an equivalent to
* PTHREAD_COND_INITIALIZER, so we must call
* xcondition_init later */
#endif
@@ -1151,9 +1151,7 @@ findpoly(const char *name)
icoFatal("can't find object %s", name);
}
-int main(argc, argv)
- int argc;
- char **argv;
+int main(int argc, char **argv)
{
const char *display = NULL;
#ifdef MULTIBUFFER