[Mesa-dev] [PATCH 1/2] mesa: Address `assignment makes integer from pointer without a cast` gcc warning.

Jose Fonseca jfonseca at vmware.com
Thu Jan 8 08:41:45 PST 2015


From: José Fonseca <jfonseca at vmware.com>

Trivial.
---
 src/mesa/main/imports.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c
index 6945c2f..4f5a2d1 100644
--- a/src/mesa/main/imports.c
+++ b/src/mesa/main/imports.c
@@ -94,7 +94,7 @@ _mesa_align_malloc(size_t bytes, unsigned long alignment)
 
    ASSERT( alignment > 0 );
 
-   ptr = malloc(bytes + alignment + sizeof(void *));
+   ptr = (uintptr_t)malloc(bytes + alignment + sizeof(void *));
    if (!ptr)
       return NULL;
 
@@ -143,7 +143,7 @@ _mesa_align_calloc(size_t bytes, unsigned long alignment)
 
    ASSERT( alignment > 0 );
 
-   ptr = calloc(1, bytes + alignment + sizeof(void *));
+   ptr = (uintptr_t)calloc(1, bytes + alignment + sizeof(void *));
    if (!ptr)
       return NULL;
 
-- 
2.1.0



More information about the mesa-dev mailing list