[Mesa-dev] [PATCH 1/2] mesa: init dst values in COPY_CLEAN_4V_TYPE_AS_FLOAT()

Brian Paul brianp at vmware.com
Mon Aug 26 09:18:33 PDT 2013


to silence gcc 4.8.1 warnings.  And improve the ASSERT(0) call.
---
 src/mesa/main/macros.h |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h
index ddfeee2..1052f75 100644
--- a/src/mesa/main/macros.h
+++ b/src/mesa/main/macros.h
@@ -607,7 +607,8 @@ COPY_CLEAN_4V_TYPE_AS_FLOAT(GLfloat dst[4], int sz, const GLfloat src[4],
                      UINT_AS_FLT(0), UINT_AS_FLT(1));
       break;
    default:
-      ASSERT(0);
+      ASSIGN_4V(dst, 0.0f, 0.0f, 0.0f, 1.0f); /* silence warnings */
+      ASSERT(!"Unexpected type in COPY_CLEAN_4V_TYPE_AS_FLOAT macro");
    }
    COPY_SZ_4V(dst, sz, src);
 }
-- 
1.7.10.4



More information about the mesa-dev mailing list