gallivm: Fix 'cast from pointer to integer of different size' warning.
authorVinson Lee <vlee@vmware.com>
Thu, 23 Dec 2010 00:48:19 +0000 (16:48 -0800)
committerVinson Lee <vlee@vmware.com>
Thu, 23 Dec 2010 00:48:19 +0000 (16:48 -0800)
Fixes this GCC warning.
lp_bld_const.h: In function 'lp_build_const_int_pointer':
lp_bld_const.h:137: warning: cast from pointer to integer of different size

src/gallium/auxiliary/gallivm/lp_bld_const.h

index 680211fbbd7939f28829abaf7af80a087c6facdd..69718eb4b3d1116ec1da2e6ca0aeef5d302cb3db 100644 (file)
@@ -134,7 +134,7 @@ lp_build_const_int_pointer(struct gallivm_state *gallivm, const void *ptr)
 
    /* int type large enough to hold a pointer */
    int_type = LLVMIntTypeInContext(gallivm->context, 8 * sizeof(void *));
-   v = LLVMConstInt(int_type, (unsigned long long) ptr, 0);
+   v = LLVMConstInt(int_type, (uintptr_t) ptr, 0);
    v = LLVMBuildIntToPtr(gallivm->builder, v,
                          LLVMPointerType(int_type, 0),
                          "cast int to ptr");