[Piglit] [PATCH 02/20] fbo: Make fbo-formats.h able to be included from a .cpp file.

Paul Berry stereotype441 at gmail.com
Tue Jun 5 17:03:12 PDT 2012


This required changing format_desc::name to a const char *, renaming a
variable called "new", and fixing a few signed/unsigned comparison
warnings.
---
 tests/fbo/fbo-formats.h |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/tests/fbo/fbo-formats.h b/tests/fbo/fbo-formats.h
index cadf30d..a70954f 100644
--- a/tests/fbo/fbo-formats.h
+++ b/tests/fbo/fbo-formats.h
@@ -28,7 +28,7 @@
 
 struct format_desc {
 	GLenum internalformat;
-	char *name;
+	const char *name;
 };
 
 #define FORMAT(f) { f, #f }
@@ -490,7 +490,7 @@ static void next_test_set(int inc_dec)
 {
 	do {
 		test_index += inc_dec;
-		if (test_index >= ARRAY_SIZE(test_sets)) {
+		if (test_index >= (int) ARRAY_SIZE(test_sets)) {
 			test_index = 0;
 		}
 		else if (test_index < 0) {
@@ -515,7 +515,7 @@ static void fbo_formats_key_func(unsigned char key, int x, int y)
 
 	case 'm': /* next format */
 		format_index++;
-		if (format_index >= test_sets[test_index].num_formats) {
+		if (format_index >= (int) test_sets[test_index].num_formats) {
 			format_index = 0;
 		}
 		break;
@@ -528,7 +528,7 @@ static void fbo_formats_key_func(unsigned char key, int x, int y)
 		break;
 	case 'f': /* next format, or next test set */
 		format_index++;
-		if (format_index >= test_sets[test_index].num_formats) {
+		if (format_index >= (int) test_sets[test_index].num_formats) {
 			next_test_set(+1);
 		}
 		break;
@@ -556,7 +556,7 @@ static void fbo_formats_init(int argc, char **argv, GLboolean print_options)
 	test_set = &test_sets[0];
 
 	for (i = 1; i < argc; i++) {
-		for (j = 1; j < ARRAY_SIZE(test_sets); j++) {
+		for (j = 1; j < (int) ARRAY_SIZE(test_sets); j++) {
 			if (!strcmp(argv[i], test_sets[j].param)) {
 				for (k = 0; k < 3; k++) {
 					if (test_sets[j].ext[k]) {
@@ -586,13 +586,13 @@ static void fbo_formats_init(int argc, char **argv, GLboolean print_options)
 }
 
 static void add_result(bool *all_skip, enum piglit_result *end_result,
-		       enum piglit_result new)
+		       enum piglit_result new_result)
 {
-	if (new != PIGLIT_SKIP)
+	if (new_result != PIGLIT_SKIP)
 		*all_skip = false;
 
-	if (new == PIGLIT_FAIL)
-		*end_result = new;
+	if (new_result == PIGLIT_FAIL)
+		*end_result = new_result;
 }
 
 typedef enum piglit_result (*test_func)(const struct format_desc *format, GLenum baseformat);
@@ -601,7 +601,7 @@ static enum piglit_result fbo_formats_display(test_func test_format)
 {
 	enum piglit_result result, end_result = PIGLIT_PASS;
 	bool all_skip = true;
-	int i;
+	unsigned i;
 
 	glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
 	glClearColor(0.5, 0.5, 0.5, 0.5);
-- 
1.7.7.6



More information about the Piglit mailing list