[Piglit] [PATCH] util: Fix piglit-vbo.cpp tautological-compare warning.

Vinson Lee vlee at freedesktop.org
Tue Jun 14 21:58:29 UTC 2016


piglit-vbo.cpp:310:26: warning: comparison of unsigned expression < 0 is always false [-Wtautological-compare]
                if (this->matrix_index < 0 || this->matrix_index > 3) {
                    ~~~~~~~~~~~~~~~~~~ ^ ~

vertex_attrib_description::matrix_index has type size_t.

Fixes: 8e71b836e8ea ("util: Add new headed matrix_index header to [vertex data]")
Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/util/piglit-vbo.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/util/piglit-vbo.cpp b/tests/util/piglit-vbo.cpp
index b8f2d48079d9..755efb295c41 100644
--- a/tests/util/piglit-vbo.cpp
+++ b/tests/util/piglit-vbo.cpp
@@ -307,7 +307,7 @@ vertex_attrib_description::vertex_attrib_description(GLuint prog,
 		const char *third_slash = strchr(second_slash + 1, '/');
 		this->matrix_index = strtoul(third_slash + 1, &endptr, 10);
 
-		if (this->matrix_index < 0 || this->matrix_index > 3) {
+		if (this->matrix_index > 3) {
 			printf("Matrix column index must be between 0 and 3.  Got: %lu\n",
 				(unsigned long) this->matrix_index);
 			piglit_report_result(PIGLIT_FAIL);
-- 
2.7.4



More information about the Piglit mailing list