[Piglit] [PATCH] primitive-restart: Fix GCC warnings.

Vinson Lee vlee at freedesktop.org
Fri Jan 10 18:34:17 PST 2014


This patch fixes these GCC warnings.

primitive-restart.c: In function 'read_index_value':
primitive-restart.c:253:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
primitive-restart.c: In function 'test_draw_by_index':
primitive-restart.c:445:18: warning: 'restart_index' may be used uninitialized in this function [-Wmaybe-uninitialized]
    enable_restart(restart_index);
                  ^

Signed-off-by: Vinson Lee <vlee at freedesktop.org>
---
 tests/general/primitive-restart.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/general/primitive-restart.c b/tests/general/primitive-restart.c
index 5cff163..0674c11 100644
--- a/tests/general/primitive-restart.c
+++ b/tests/general/primitive-restart.c
@@ -249,6 +249,7 @@ static GLuint read_index_value(const GLvoid *indices, GLenum type, GLuint index)
       return ((GLuint*)indices)[index];
    default:
       assert(0);
+      return 0;
    }
 }
 
@@ -337,6 +338,7 @@ test_draw_by_index(VBO_CFG vbo_cfg, GLboolean one_by_one, GLenum primMode, GLenu
       break;
    default:
       assert(0);
+      restart_index = 0;
    }
 
    x = 0.0;
-- 
1.8.4.2



More information about the Piglit mailing list