mesa: Address `assignment makes integer from pointer without a cast` gcc warning.
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 7 Jan 2015 14:27:12 +0000 (14:27 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Thu, 8 Jan 2015 18:57:04 +0000 (18:57 +0000)
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/main/imports.c

index 6945c2f621b1bbd930be29bb2458060d8ac5e1ed..4f5a2d11fa97d1e3c78c4d19aae07366b702f012 100644 (file)
@@ -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;