rendercheck: 5 commits - configure.ac COPYING main.c Makefile.am rendercheck.h t_blend.c tests.c t_fill.c t_gtk_argb_xbgr.c t_repeat.c t_srccoords.c t_tsrccoords2.c t_tsrccoords.c

Eric Anholt anholt at kemper.freedesktop.org
Tue Apr 22 15:03:06 PDT 2014


 COPYING           |   19 ++++++
 Makefile.am       |    2 
 configure.ac      |    1 
 main.c            |   24 ++++----
 rendercheck.h     |    8 ++
 t_blend.c         |    6 +-
 t_fill.c          |    7 +-
 t_gtk_argb_xbgr.c |  150 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 t_repeat.c        |    2 
 t_srccoords.c     |    2 
 t_tsrccoords.c    |    2 
 t_tsrccoords2.c   |    2 
 tests.c           |   41 ++++++--------
 13 files changed, 222 insertions(+), 44 deletions(-)

New commits:
commit 589bb58df06f6cf3b5e92c05f8cf6f997f31ab12
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Apr 21 09:06:28 2014 -0700

    Add test for GTK rendering bug in glamor.
    
    I converted this from a standalone testcase Keith sent me to a
    rendercheck test, with a reformat and a minor fixup to make sure we
    actually found the PictFormats we wanted.
    
    Signed-off-by: Eric Anholt <eric at anholt.net>
    Acked-by: Keith Packard <keithp at keithp.com>

diff --git a/COPYING b/COPYING
index af1d06b..efe8756 100644
--- a/COPYING
+++ b/COPYING
@@ -1,3 +1,22 @@
+Rendercheck is a combination of GPLv2-or-later and MIT-licensed code.
+
+/* Copyright © 2014 Keith Packard <keithp at keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
 Copyright 2004 Eric Anholt
 
 Permission to use, copy, modify, distribute, and sell this software and its
diff --git a/Makefile.am b/Makefile.am
index 9afbed5..36d38e4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,6 +13,7 @@ rendercheck_SOURCES = \
 	t_dstcoords.c \
 	t_fill.c \
 	t_gradient.c \
+	t_gtk_argb_xbgr.c \
 	t_repeat.c \
 	t_srccoords.c \
 	t_tsrccoords.c \
diff --git a/main.c b/main.c
index 8783dd0..ee02423 100644
--- a/main.c
+++ b/main.c
@@ -121,6 +121,7 @@ struct {
     {TEST_REPEAT, "repeat"},
     {TEST_TRIANGLES, "triangles"},
     {TEST_BUG7366, "bug7366"},
+    {TEST_GTK_ARGB_XBGR, "gtk_argb_xbgr"},
     {0, NULL}
 };
 
diff --git a/rendercheck.h b/rendercheck.h
index 2b71bf2..c8ad9d6 100644
--- a/rendercheck.h
+++ b/rendercheck.h
@@ -81,6 +81,7 @@ struct op_info {
 #define TEST_REPEAT	  	0x0400
 #define TEST_TRIANGLES  	0x0800
 #define TEST_BUG7366		0x1000
+#define TEST_GTK_ARGB_XBGR	0x2000
 
 extern int pixmap_move_iter;
 extern int win_width, win_height;
@@ -219,3 +220,6 @@ trifan_test(Display *dpy, picture_info *win, picture_info *dst, int op,
 
 Bool
 bug7366_test(Display *dpy);
+
+Bool
+gtk_argb_xbgr_test(Display *dpy);
diff --git a/t_gtk_argb_xbgr.c b/t_gtk_argb_xbgr.c
new file mode 100644
index 0000000..b80e58b
--- /dev/null
+++ b/t_gtk_argb_xbgr.c
@@ -0,0 +1,150 @@
+/* Copyright © 2014 Keith Packard <keithp at keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ */
+
+/* Test Render's ability to flip bytes around when the source and mask are the
+ * same pixmap.
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <strings.h>
+#include "rendercheck.h"
+
+#define WIDTH	1
+#define HEIGHT	1
+
+#define PIXEL_ABGR	0xff886644
+#define PIXEL_RGB	0x446688
+
+Bool
+gtk_argb_xbgr_test(Display *dpy)
+{
+	int x, y;
+	Pixmap	pix_32;
+	Pixmap	pix_24;
+	Picture	pic_24;
+	Picture	pic_32_xbgr;
+	Picture	pic_32_argb;
+	XRenderPictFormat	templ;
+	XRenderPictFormat	*pic_xbgr_format;
+	XRenderPictFormat	*pic_argb_format;
+	XRenderPictFormat	*pic_rgb_format;
+	GC	gc_32;
+	XImage	*image_24, *image_32;
+
+	templ.type = PictTypeDirect;
+	templ.depth = 32;
+	templ.direct.alphaMask = 0;
+	templ.direct.red = 0;
+	templ.direct.green = 8;
+	templ.direct.blue = 16;
+
+	pic_xbgr_format = XRenderFindFormat(dpy,
+	    PictFormatType |
+	    PictFormatDepth |
+	    PictFormatAlphaMask |
+	    PictFormatRed |
+	    PictFormatGreen |
+	    PictFormatBlue,
+	    &templ, 0);
+
+	templ.type = PictTypeDirect;
+	templ.depth = 32;
+	templ.direct.alpha = 24;
+	templ.direct.red = 16;
+	templ.direct.green = 8;
+	templ.direct.blue = 0;
+
+	pic_argb_format = XRenderFindFormat(dpy,
+	    PictFormatType |
+	    PictFormatDepth |
+	    PictFormatAlpha |
+	    PictFormatRed |
+	    PictFormatGreen |
+	    PictFormatBlue,
+	    &templ, 0);
+
+	templ.type = PictTypeDirect;
+	templ.depth = 24;
+	templ.direct.red = 16;
+	templ.direct.green = 8;
+	templ.direct.blue = 0;
+
+	pic_rgb_format = XRenderFindFormat(dpy,
+	    PictFormatType |
+	    PictFormatDepth |
+	    PictFormatRed |
+	    PictFormatGreen |
+	    PictFormatBlue,
+	    &templ, 0);
+
+	if (!pic_argb_format || !pic_xbgr_format || !pic_rgb_format) {
+		printf("Couldn't find xBGR and ARGB formats\n");
+		return FALSE;
+	}
+
+	pix_32 = XCreatePixmap(dpy, RootWindow(dpy, DefaultScreen(dpy)),
+	    WIDTH, HEIGHT, 32);
+
+	pic_32_xbgr = XRenderCreatePicture(dpy, pix_32, pic_xbgr_format, 0,
+	    NULL);
+	pic_32_argb = XRenderCreatePicture(dpy, pix_32, pic_argb_format, 0,
+	    NULL);
+
+	image_32 = XCreateImage(dpy,
+	    NULL,
+	    32,
+	    ZPixmap,
+	    0,
+	    NULL,
+	    WIDTH, HEIGHT, 32, 0);
+
+	image_32->data = malloc(HEIGHT * image_32->bytes_per_line);
+
+	for (y = 0; y < HEIGHT; y++)
+		for (x = 0; x < WIDTH; x++)
+			XPutPixel(image_32, x, y, PIXEL_ABGR);
+
+	gc_32 = XCreateGC(dpy, pix_32, 0, NULL);
+
+	XPutImage(dpy, pix_32, gc_32, image_32, 0, 0, 0, 0, WIDTH, HEIGHT);
+
+	pix_24 = XCreatePixmap(dpy, RootWindow(dpy, DefaultScreen(dpy)),
+	    WIDTH, HEIGHT, 24);
+
+	pic_24 = XRenderCreatePicture(dpy, pix_24, pic_rgb_format, 0, NULL);
+
+	XRenderComposite(dpy, PictOpOver, pic_32_xbgr, pic_32_argb, pic_24,
+	    0, 0, 0, 0, 0, 0, WIDTH, HEIGHT);
+
+	image_24 = XGetImage(dpy, pix_24, 0, 0, WIDTH, HEIGHT, 0xffffffff,
+	    ZPixmap);
+	for (y = 0; y < HEIGHT; y++) {
+		for (x = 0; x < WIDTH; x++) {
+			unsigned long pixel = XGetPixel(image_24, x, y);
+			if (pixel != PIXEL_RGB) {
+				printf("fail: pixel value is %08lx "
+				    "should be %08x\n",
+				    pixel, PIXEL_RGB);
+				return FALSE;
+			}
+		}
+	}
+
+	return TRUE;
+}
diff --git a/tests.c b/tests.c
index 31493c9..8271d4c 100644
--- a/tests.c
+++ b/tests.c
@@ -732,6 +732,16 @@ do {								\
 		success_mask |= TEST_BUG7366;
 	}
 
+        if (enabled_tests & TEST_GTK_ARGB_XBGR) {
+		Bool ok, group_ok = TRUE;
+
+		ok = gtk_argb_xbgr_test(dpy);
+		RECORD_RESULTS();
+
+		if (group_ok)
+			success_mask |= TEST_GTK_ARGB_XBGR;
+	}
+
 	free(test_ops);
 	free(test_src);
 	free(test_mask);
commit 03934f1569b9e0a357e016350985b803f7b5572d
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Apr 21 10:14:09 2014 -0700

    Shut up some const assignment warnings.
    
    Trying to make all the callchain related to these const is too hard, and
    it's not like marking things const helps either the developer or the
    compiler.
    
    Signed-off-by: Eric Anholt <eric at anholt.net>
    Acked-by: Keith Packard <keithp at keithp.com>

diff --git a/t_repeat.c b/t_repeat.c
index 1abe542..0c25b60 100644
--- a/t_repeat.c
+++ b/t_repeat.c
@@ -73,7 +73,7 @@ repeat_test(Display *dpy, picture_info *win, picture_info *dst, int op,
 		src.format = XRenderFindStandardFormat(dpy, PictStandardARGB32);
 		src.pict = XRenderCreatePicture(dpy, src.d, src.format,
 		    CPComponentAlpha | CPRepeat, &pa);
-		src.name = "repeat picture";
+		src.name = (char *)"repeat picture";
 
 		/* Fill to the first color */
 		XRenderComposite(dpy, PictOpSrc, c1->pict, None, src.pict,
diff --git a/t_srccoords.c b/t_srccoords.c
index 6e29e8a..1eae7d8 100644
--- a/t_srccoords.c
+++ b/t_srccoords.c
@@ -46,7 +46,7 @@ static picture_info *create_target_picture(Display *dpy)
 	p->d = XCreatePixmap(dpy, DefaultRootWindow(dpy), 5, 5, 32);
 	p->format = XRenderFindStandardFormat(dpy, PictStandardARGB32);
 	p->pict = XRenderCreatePicture(dpy, p->d, p->format, 0, NULL);
-	p->name = "target picture";
+	p->name = (char *)"target picture";
 
 	for (i = 0; i < 25; i++) {
 		int x = i % 5;
diff --git a/t_tsrccoords.c b/t_tsrccoords.c
index 355880a..b931c4a 100644
--- a/t_tsrccoords.c
+++ b/t_tsrccoords.c
@@ -46,7 +46,7 @@ static picture_info *create_dot_picture(Display *dpy)
 	p->d = XCreatePixmap(dpy, DefaultRootWindow(dpy), 5, 5, 32);
 	p->format = XRenderFindStandardFormat(dpy, PictStandardARGB32);
 	p->pict = XRenderCreatePicture(dpy, p->d, p->format, 0, NULL);
-	p->name = "dot picture";
+	p->name = (char *)"dot picture";
 
 	for (i = 0; i < 25; i++) {
 		int x = i % 5;
diff --git a/t_tsrccoords2.c b/t_tsrccoords2.c
index 0d83fd5..b083577 100644
--- a/t_tsrccoords2.c
+++ b/t_tsrccoords2.c
@@ -46,7 +46,7 @@ static picture_info *create_target_picture(Display *dpy)
 	p->d = XCreatePixmap(dpy, DefaultRootWindow(dpy), 5, 5, 32);
 	p->format = XRenderFindStandardFormat(dpy, PictStandardARGB32);
 	p->pict = XRenderCreatePicture(dpy, p->d, p->format, 0, NULL);
-	p->name = "target picture";
+	p->name = (char *)"target picture";
 
 	for (i = 0; i < 25; i++) {
 		int x = i % 5;
diff --git a/tests.c b/tests.c
index 8f13902..31493c9 100644
--- a/tests.c
+++ b/tests.c
@@ -405,7 +405,7 @@ do_tests(Display *dpy, picture_info *win)
 	picture_3x3.format = XRenderFindStandardFormat(dpy, PictStandardARGB32);
 	picture_3x3.pict = XRenderCreatePicture(dpy, picture_3x3.d,
 	    picture_3x3.format, 0, NULL);
-	picture_3x3.name = "3x3 sample picture";
+	picture_3x3.name = (char *)"3x3 sample picture";
 	for (i = 0; i < 9; i++) {
 		int x = i % 3;
 		int y = i / 3;
@@ -424,7 +424,7 @@ do_tests(Display *dpy, picture_info *win)
             c.blue = (int)(colors[i].b*65535);
             pictures_solid[i].pict = XRenderCreateSolidFill(dpy, &c);
             pictures_solid[i].format = format_list[argb32index];
-            pictures_solid[i].name = "Solid";
+            pictures_solid[i].name = (char *)"Solid";
         }
 
 #define RECORD_RESULTS()					\
commit 6d8f7991a7d38f81808499148e047edb0434611e
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Apr 21 10:10:24 2014 -0700

    Disable useless shadow warnings.
    
    They never find real bugs in my experience.
    
    Signed-off-by: Eric Anholt <eric at anholt.net>
    Acked-by: Keith Packard <keithp at keithp.com>

diff --git a/configure.ac b/configure.ac
index 09b07bd..2bfb928 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,6 +17,7 @@ m4_ifndef([XORG_MACROS_VERSION],
           [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
 XORG_MACROS_VERSION(1.8)
 XORG_DEFAULT_OPTIONS
+XORG_TESTSET_CFLAG(CWARNFLAGS, [-Wno-shadow])
 
 # Checks for header files.
 AC_CHECK_HEADERS([err.h])
commit fee01994a780ba84b37bc814845d5f9948e89f0b
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Apr 21 09:42:46 2014 -0700

    Convert to using asprintf for describe_format.
    
    This simplifies the manual strcatting mess and avoids potential overflow
    issues.
    
    Signed-off-by: Eric Anholt <eric at anholt.net>
    Acked-by: Keith Packard <keithp at keithp.com>

diff --git a/Makefile.am b/Makefile.am
index b19ae4a..9afbed5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,6 +20,7 @@ rendercheck_SOURCES = \
 	t_triangles.c
 
 AM_CFLAGS = $(RC_CFLAGS) $(CWARNFLAGS)
+AM_CPPFLAGS = -D_GNU_SOURCE
 rendercheck_LDADD = $(RC_LIBS)
 
 MAINTAINERCLEANFILES = ChangeLog INSTALL
diff --git a/main.c b/main.c
index 51df7e4..8783dd0 100644
--- a/main.c
+++ b/main.c
@@ -55,12 +55,15 @@ bit_count(int i)
 
 /* This is not complete, but decent enough for now.*/
 void
-describe_format(char *desc, int len, XRenderPictFormat *format)
+describe_format(char **desc, const char *prefix, XRenderPictFormat *format)
 {
 	char ad[4] = "", rd[4] = "", gd[4] = "", bd[4] = "";
 	int ac, rc, gc, bc;
 	int ashift;
 
+	if (!prefix)
+	    prefix = "";
+
 	ac = bit_count(format->direct.alphaMask);
 	rc = bit_count(format->direct.redMask);
 	gc = bit_count(format->direct.greenMask);
@@ -90,14 +93,14 @@ describe_format(char *desc, int len, XRenderPictFormat *format)
 
 	if (ashift > format->direct.red) {
 		if (format->direct.red > format->direct.blue)
-			snprintf(desc, len, "%s%s%s%s", ad, rd, gd, bd);
+			asprintf(desc, "%s%s%s%s%s", prefix, ad, rd, gd, bd);
 		else
-			snprintf(desc, len, "%s%s%s%s", ad, bd, gd, rd);
+			asprintf(desc, "%s%s%s%s%s", prefix, ad, bd, gd, rd);
 	} else {
 		if (format->direct.red > format->direct.blue)
-			snprintf(desc, len, "%s%s%s%s", rd, gd, bd, ad);
+			asprintf(desc, "%s%s%s%s%s", prefix, rd, gd, bd, ad);
 		else
-			snprintf(desc, len, "%s%s%s%s", bd, gd, rd, ad);
+			asprintf(desc, "%s%s%s%s%s", prefix, bd, gd, rd, ad);
 	}
 }
 
@@ -297,12 +300,10 @@ int main(int argc, char **argv)
 	window.format = XRenderFindVisualFormat(dpy, a.visual);
 	window.pict = XRenderCreatePicture(dpy, window.d,
 	    window.format, 0, NULL);
-	window.name = (char *)malloc(20);
-	if (window.name == NULL)
-		errx(1, "malloc error");
-	describe_format(window.name, 20, window.format);
-	printf("Window format: %s\n", window.name);
-	strncat(window.name, " window", 20);
+	describe_format(&format, NULL, window.format);
+	printf("Window format: %s\n", format);
+	asprintf(&window.name, "%s window", format);
+	free(format);
 	XSelectInput(dpy, window.d, ExposureMask);
 	XMapWindow(dpy, window.d);
 
diff --git a/rendercheck.h b/rendercheck.h
index fcca571..2b71bf2 100644
--- a/rendercheck.h
+++ b/rendercheck.h
@@ -96,7 +96,7 @@ extern int num_colors;
 
 /* main.c */
 void
-describe_format(char *desc, int len, XRenderPictFormat *format);
+describe_format(char **desc, const char *prefix, XRenderPictFormat *format);
 
 int
 bit_count(int i);
diff --git a/t_blend.c b/t_blend.c
index 57b2f2d..b436fe4 100644
--- a/t_blend.c
+++ b/t_blend.c
@@ -21,6 +21,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 
 #include "rendercheck.h"
 
@@ -109,10 +110,10 @@ blend_test(Display *dpy, picture_info *win, picture_info *dst,
 					    color_correct(dst, &expected);
 
 					    if (eval_diff(&acc, &expected, &tested) > 3.) {
-						    char srcformat[20];
+						    char *srcformat;
 
 						    snprintf(testname, 20, "%s blend", ops[op[i]].name);
-						    describe_format(srcformat, 20, src_color[j]->format);
+						    describe_format(&srcformat, NULL, src_color[j]->format);
 						    print_fail(testname, &expected, &tested, 0, 0,
 							       eval_diff(&acc, &expected, &tested));
 						    printf("src color: %.2f %.2f %.2f %.2f (%s)\n"
@@ -125,6 +126,7 @@ blend_test(Display *dpy, picture_info *win, picture_info *dst,
 							   dst_color[k]->color.b,
 							   dst_color[k]->color.a);
 						    printf("src: %s, dst: %s\n", src_color[j]->name, dst->name);
+						    free(srcformat);
 						    return FALSE;
 					    }
 				    }
diff --git a/t_fill.c b/t_fill.c
index 4dd80a6..7e071c0 100644
--- a/t_fill.c
+++ b/t_fill.c
@@ -21,6 +21,7 @@
  */
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 
 #include "rendercheck.h"
@@ -32,16 +33,16 @@ Bool
 fill_test(Display *dpy, picture_info *win, picture_info *src)
 {
 	color4d tested;
-	char name[20];
+	char *name;
 
 	get_pixel(dpy, src, 0, 0, &tested);
 	copy_pict_to_win(dpy, src, win, win_width, win_height);
 
 	if (eval_diff(&src->format->direct, &src->color, &tested) > 2.) {
-	    strcpy(name, "fill ");
-	    describe_format(name, 20 - strlen(name), src->format);
+	    describe_format(&name, "fill ", src->format);
 	    print_fail(name, &src->color, &tested, 0, 0,
 		       eval_diff(&src->format->direct, &src->color, &tested));
+	    free(name);
 	    return FALSE;
 	}
 
diff --git a/tests.c b/tests.c
index bacc372..8f13902 100644
--- a/tests.c
+++ b/tests.c
@@ -252,7 +252,7 @@ create_formats_list(Display *dpy)
 
     argb32index = -1;
     for (i = 0; ; i++) {
-	char name[20];
+	char *name;
 	int alphabits, redbits;
 
 	if (nformats + 1 == nformats_allocated) {
@@ -280,7 +280,7 @@ create_formats_list(Display *dpy)
 	    continue;
 	}
 
-	describe_format(name, 20, format_list[nformats]);
+	describe_format(&name, NULL, format_list[nformats]);
 
 	if (format_whitelist_len != 0) {
 	    Bool ok = FALSE;
@@ -342,10 +342,7 @@ do_tests(Display *dpy, picture_info *win)
 		dests[i].pict = XRenderCreatePicture(dpy, dests[i].d,
 		    dests[i].format, 0, NULL);
 
-		dests[i].name = (char *)malloc(20);
-		if (dests[i].name == NULL)
-			errx(1, "malloc error");
-		describe_format(dests[i].name, 20, dests[i].format);
+		describe_format(&dests[i].name, NULL, dests[i].format);
 	}
 
 	pictures_1x1 = (picture_info *)malloc(num_colors * nformats *
@@ -365,13 +362,8 @@ do_tests(Display *dpy, picture_info *win)
 		pictures_1x1[i].pict = XRenderCreatePicture(dpy,
 		    pictures_1x1[i].d, pictures_1x1[i].format, CPRepeat, &pa);
 
-		pictures_1x1[i].name = (char *)malloc(20);
-		if (pictures_1x1[i].name == NULL)
-			errx(1, "malloc error");
-		sprintf(pictures_1x1[i].name, "1x1R ");
-		describe_format(pictures_1x1[i].name +
-		    strlen(pictures_1x1[i].name), 20 -
-		    strlen(pictures_1x1[i].name), pictures_1x1[i].format);
+		describe_format(&pictures_1x1[i].name, "1x1R ",
+		    pictures_1x1[i].format);
 
 		argb_fill(dpy, &pictures_1x1[i], 0, 0, 1, 1,
 		    c->a, c->r, c->g, c->b);
@@ -399,13 +391,8 @@ do_tests(Display *dpy, picture_info *win)
 		pictures_10x10[i].pict = XRenderCreatePicture(dpy,
 		    pictures_10x10[i].d, pictures_10x10[i].format, 0, NULL);
 
-		pictures_10x10[i].name = (char *)malloc(20);
-		if (pictures_10x10[i].name == NULL)
-			errx(1, "malloc error");
-		sprintf(pictures_10x10[i].name, "10x10 ");
-		describe_format(pictures_10x10[i].name +
-		    strlen(pictures_10x10[i].name), 20 -
-		    strlen(pictures_10x10[i].name), pictures_10x10[i].format);
+		describe_format(&pictures_10x10[i].name, "10x10 ",
+		    pictures_10x10[i].format);
 
 		argb_fill(dpy, &pictures_10x10[i], 0, 0, 10, 10,
 		    c->a, c->r, c->g, c->b);
commit 7f8da66d9ae4ac542970e8e2f5e73e7ab7a7c3c2
Author: Eric Anholt <eric at anholt.net>
Date:   Mon Apr 21 09:35:11 2014 -0700

    Fix const cast warnings in our ops definitions.
    
    We only store string literals here.
    
    Signed-off-by: Eric Anholt <eric at anholt.net>
    Acked-by: Keith Packard <keithp at keithp.com>

diff --git a/rendercheck.h b/rendercheck.h
index 18417a8..fcca571 100644
--- a/rendercheck.h
+++ b/rendercheck.h
@@ -64,7 +64,7 @@ typedef struct _picture_info {
 
 struct op_info {
 	int op;
-	char *name;
+	const char *name;
 	Bool disabled;
 };
 


More information about the xorg-commit mailing list