OSDN Git Service

mesa: Silence 'assignment makes integer from pointer without a cast' warnings.
authorJosé Fonseca <jfonseca@vmware.com>
Wed, 10 Oct 2012 10:35:34 +0000 (11:35 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Wed, 10 Oct 2012 10:35:34 +0000 (11:35 +0100)
src/mesa/main/imports.c

index 934a2d0..ed324b5 100644 (file)
@@ -97,7 +97,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;
 
@@ -146,7 +146,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;