rendercheck: configure.ac .gitignore main.c Makefile.am rendercheck.h tests.c t_gradient.c

Paulo Cesar Pereira de Andrade pcpa at kemper.freedesktop.org
Mon Jan 19 09:56:41 PST 2009


 .gitignore    |    3 +++
 Makefile.am   |    2 +-
 configure.ac  |   30 ++++++++++++++----------------
 main.c        |    2 +-
 rendercheck.h |    2 ++
 t_gradient.c  |    6 +++---
 tests.c       |    6 +++---
 7 files changed, 27 insertions(+), 24 deletions(-)

New commits:
commit 63814639cb070e34a1aa2205ff71d64e6cc884ce
Author: Paulo Cesar Pereira de Andrade <pcpa at mandriva.com.br>
Date:   Mon Jan 19 15:20:50 2009 -0200

    Ansification and compile warning fixes.
    
      This also uses XORG_CHANGELOG and XORG_CWARNFLAGS, corrects
    make distcheck, all gcc 4.3 and sparse warnings, and a configure
    configure warning about err.h.

diff --git a/.gitignore b/.gitignore
index ae15496..617bafe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,3 +15,6 @@ mkinstalldirs
 rendercheck
 *.o
 *~
+ChangeLog
+rendercheck-*.tar.*
+tags
diff --git a/Makefile.am b/Makefile.am
index 513c1e7..e494bea 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -37,6 +37,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 b9d124e..4475c89 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,9 +12,18 @@ AM_INIT_AUTOMAKE([dist-bzip2])
 
 AM_MAINTAINER_MODE
 
-# Checks for programs.
+# 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)
+
 AC_PROG_CC
 
+XORG_CWARNFLAGS
+
+# Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS([err.h])
+
 AC_ARG_ENABLE(werror,        AS_HELP_STRING([--enable-werror],
 				  [Treat warnings as errors (default: disabled)]),
 			        [WERROR=$enableval], [WERROR=no])
@@ -36,24 +45,13 @@ then
 	RC_LIBS="$X_LIBS -lXrender -lXext -lX11"
 fi
 
-if test "x$GCC" = "xyes"; then
-       GCC_WARNINGS1="-Wall -Wpointer-arith -Wstrict-prototypes"
-       GCC_WARNINGS2="-Wmissing-prototypes -Wmissing-declarations"
-       GCC_WARNINGS3="-Wnested-externs -fno-strict-aliasing"
-       GCC_WARNINGS="$GCC_WARNINGS1 $GCC_WARNINGS2 $GCC_WARNINGS3"
-       if test "x$WERROR" = "xyes"; then
-               GCC_WARNINGS="${GCC_WARNINGS} -Werror"
-       fi
-       RC_CFLAGS="$RC_CFLAGS $GCC_WARNINGS"
+if test "x$GCC" = "xyes" -a "x$WERROR" = "xyes"; then
+	CWARNFLAGS="$CWARNFLAGS -Werror"
 fi
-
+RC_CFLAGS="$CWARNFLAGS $RC_CFLAGS"
 AC_SUBST(RC_CFLAGS)
 AC_SUBST(RC_LIBS)
 
-# Checks for libraries.
-
-# Checks for header files.
-AC_HEADER_STDC
-AC_CHECK_HEADERS([err.h])
+XORG_CHANGELOG
 
 AC_OUTPUT([Makefile])
diff --git a/main.c b/main.c
index 2cd7ce5..99d8441 100644
--- a/main.c
+++ b/main.c
@@ -279,7 +279,7 @@ int main(int argc, char **argv)
 	XGetWindowAttributes(dpy, window.d, &a);
 	window.format = XRenderFindVisualFormat(dpy, a.visual);
 	window.pict = XRenderCreatePicture(dpy, window.d,
-	    window.format, 0, 0);
+	    window.format, 0, NULL);
 	window.name = (char *)malloc(20);
 	if (window.name == NULL)
 		errx(1, "malloc error");
diff --git a/rendercheck.h b/rendercheck.h
index b60e482..bb35c5e 100644
--- a/rendercheck.h
+++ b/rendercheck.h
@@ -91,6 +91,8 @@ extern int enabled_tests;
 extern int format_whitelist_len;
 extern char **format_whitelist;
 extern picture_info *argb32white, *argb32red, *argb32green, *argb32blue;
+extern int num_ops;
+extern int num_colors;
 
 /* main.c */
 void
diff --git a/t_gradient.c b/t_gradient.c
index f17d01d..1d8ac01 100644
--- a/t_gradient.c
+++ b/t_gradient.c
@@ -55,7 +55,7 @@ static const stop stop_list[][10] = {
         { -1, {0, 0, 0, 0} }
     }
 };
-const int n_stop_list = sizeof(stop_list)/(10*sizeof(stop));
+static const int n_stop_list = sizeof(stop_list)/(10*sizeof(stop));
 
 typedef struct _point {
     double x;
@@ -85,7 +85,7 @@ static const pixel test_pixels [] = {
     {-1, -1}
 };
 
-const int n_linear_gradient_points = sizeof(linear_gradient_points)/(2*sizeof(point));
+static const int n_linear_gradient_points = sizeof(linear_gradient_points)/(2*sizeof(point));
 
 static Bool got_bad_drawable;
 
@@ -303,7 +303,7 @@ Bool linear_gradient_test(Display *dpy, picture_info *win,
 
                     tdst = dst_color->color;
                     color_correct(dst, &tdst);
-                    do_composite(ops[op].op, &tgradient, 0, &tdst,
+                    do_composite(ops[op].op, &tgradient, NULL, &tdst,
                                  &expected, False);
                     color_correct(dst, &expected);
 
diff --git a/tests.c b/tests.c
index 3453e00..47a10dc 100644
--- a/tests.c
+++ b/tests.c
@@ -27,9 +27,9 @@
 
 #include "rendercheck.h"
 
-XRenderPictFormat **format_list;
-int nformats;
-int argb32index;
+static XRenderPictFormat **format_list;
+static int nformats;
+static int argb32index;
 
 /* Note: changing the order of these colors may disrupt tests that depend on
  * specific colors.  Just add to the end if you need.  These are


More information about the xorg-commit mailing list