rendercheck: 2 commits - main.c tests.c t_gradient.c

Aaron Plattner aplattner at kemper.freedesktop.org
Wed Jan 7 18:44:57 PST 2009


 main.c       |   14 +++++++++++---
 t_gradient.c |    2 ++
 tests.c      |    2 +-
 3 files changed, 14 insertions(+), 4 deletions(-)

New commits:
commit 2659ac63a1b17e489cb37a44d8c26350de8c7c82
Author: Aaron Plattner <aplattner at nvidia.com>
Date:   Wed Jan 7 18:40:50 2009 -0800

    Fix build with -Wall -Werror -pedantic

diff --git a/t_gradient.c b/t_gradient.c
index 71cfebe..f17d01d 100644
--- a/t_gradient.c
+++ b/t_gradient.c
@@ -157,6 +157,8 @@ render_to_gradient_test(Display *dpy, picture_info *src)
 	XSetErrorHandler(NULL);
 
 	XRenderFreePicture(dpy, gradient);
+
+	return TRUE;
 }
 
 static void gradientPixel(const stop *stops, double pos, unsigned int spread, color4d *result)
diff --git a/tests.c b/tests.c
index 8e15d86..3453e00 100644
--- a/tests.c
+++ b/tests.c
@@ -393,8 +393,8 @@ do_tests(Display *dpy, picture_info *win)
 
         pictures_solid = malloc(num_colors * sizeof(picture_info));
 	for (i = 0; i < num_colors; i++) {
-            pictures_solid[i].color = colors[i];
             XRenderColor c;
+            pictures_solid[i].color = colors[i];
             c.alpha = (int)(colors[i].a*65535);
             c.red = (int)(colors[i].r*65535);
             c.green = (int)(colors[i].g*65535);
commit c006790eff135feb16c88e48afb12496d74930b4
Author: Aaron Plattner <aplattner at nvidia.com>
Date:   Wed Jan 7 18:24:08 2009 -0800

    Add a --version option.
    
    Print the version unconditionally.  Exit immediately if --version was specified
    and continue otherwise.
    
    While I'm at it, use Bool instead of int for is_sync.

diff --git a/main.c b/main.c
index 164a0ca..2cd7ce5 100644
--- a/main.c
+++ b/main.c
@@ -108,7 +108,7 @@ usage (char *program)
 {
     fprintf(stderr, "usage: %s [-d|--display display] [-v|--verbose]\n"
 	"\t[-t test1,test2,...] [-o op1,op2,...] [-f format1,format2,...]\n"
-	"\t[--sync] [--minimalrendering]\n"
+	"\t[--sync] [--minimalrendering] [--version]\n"
             "\tAvailable tests: fill,dcoords,scoords,mcoords,tscoords,\n"
             "\t\ttmcoords,blend,composite,cacomposite,gradients,repeat,triangles,\n"
             "\t\tbug7366\n",
@@ -121,7 +121,7 @@ int main(int argc, char **argv)
 	Display *dpy;
 	XEvent ev;
 	int i, o, maj, min;
-	static int is_sync = 0;
+	static Bool is_sync = FALSE, print_version = FALSE;
 	XWindowAttributes a;
 	XSetWindowAttributes as;
 	picture_info window;
@@ -135,9 +135,10 @@ int main(int argc, char **argv)
 		{ "tests",	required_argument,	NULL,	't' },
 		{ "ops",	required_argument,	NULL,	'o' },
 		{ "verbose",	no_argument,		NULL,	'v' },
-		{ "sync",	no_argument,		&is_sync, 1},
+		{ "sync",	no_argument,		&is_sync, TRUE},
 		{ "minimalrendering", no_argument,	&minimalrendering,
 		    TRUE},
+		{ "version",	no_argument,		&print_version, TRUE },
 		{ NULL,		0,			NULL,	0 }
 	};
 
@@ -239,6 +240,13 @@ int main(int argc, char **argv)
 		}
 	}
 
+	/* Print the version string.  Bail out if --version was requested and
+	 * continue otherwise.
+	 */
+	puts(PACKAGE_STRING);
+	if (print_version)
+		return 0;
+
 	dpy = XOpenDisplay(display);
 	if (dpy == NULL)
 		errx(1, "Couldn't open display.");


More information about the xorg-commit mailing list