[Mesa-dev] [PATCH] dri/r600: Fix insufficient return type

Nicolas Kaiser nikai at nikai.net
Thu Sep 30 15:35:51 PDT 2010


Two functions with unsigned return type, but returning
negative constants to indicate an error condition.

Inspired by similar Linux kernel patches by Julia Lawall
(http://coccinelle.lip6.fr/).

Signed-off-by: Nicolas Kaiser <nikai at nikai.net>
---
 src/mesa/drivers/dri/r600/evergreen_render.c |    2 +-
 src/mesa/drivers/dri/r600/r700_render.c      |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/r600/evergreen_render.c b/src/mesa/drivers/dri/r600/evergreen_render.c
index 85b2f9d..70c8270 100644
--- a/src/mesa/drivers/dri/r600/evergreen_render.c
+++ b/src/mesa/drivers/dri/r600/evergreen_render.c
@@ -55,7 +55,7 @@
 #include "radeon_buffer_objects.h"
 #include "radeon_common_context.h"
 
-static unsigned int evergreenPrimitiveType(int prim) //same
+static int evergreenPrimitiveType(int prim) //same
 {
     switch (prim & PRIM_MODE_MASK)
     {
diff --git a/src/mesa/drivers/dri/r600/r700_render.c b/src/mesa/drivers/dri/r600/r700_render.c
index f90c69c..f857536 100644
--- a/src/mesa/drivers/dri/r600/r700_render.c
+++ b/src/mesa/drivers/dri/r600/r700_render.c
@@ -58,7 +58,7 @@
 
 void r700WaitForIdle(context_t *context);
 void r700WaitForIdleClean(context_t *context);
-static unsigned int r700PrimitiveType(int prim);
+static int r700PrimitiveType(int prim);
 GLboolean r700SyncSurf(context_t *context,
 		       struct radeon_bo *pbo,
 		       uint32_t read_domain,
@@ -151,7 +151,7 @@ GLboolean r700SyncSurf(context_t *context,
     return GL_TRUE;
 }
 
-static unsigned int r700PrimitiveType(int prim)
+static int r700PrimitiveType(int prim)
 {
     switch (prim & PRIM_MODE_MASK)
     {
-- 
1.7.2.2


More information about the mesa-dev mailing list