diff options
author | José Fonseca <jfonseca@vmware.com> | 2010-05-30 16:38:23 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2010-05-30 16:38:23 +0100 |
commit | f503b3dd9d6522abdabab1e25d0652c9d3079421 (patch) | |
tree | bdccbc87ab88cfa33bc776b95a587d7e226698d8 /src/gallium/drivers/llvmpipe/lp_test_format.c | |
parent | 4b29da1226133f2578557c0e8fa8b859061bf88b (diff) |
llvmpipe: Use pointer_to_func() instead of custom wrappers.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_test_format.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_test_format.c | 16 |
1 files changed, 2 insertions, 14 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_test_format.c b/src/gallium/drivers/llvmpipe/lp_test_format.c index e5f8bf9633..7c0d7d2e65 100644 --- a/src/gallium/drivers/llvmpipe/lp_test_format.c +++ b/src/gallium/drivers/llvmpipe/lp_test_format.c @@ -37,6 +37,7 @@ #include <llvm-c/Transforms/Scalar.h> #include "util/u_memory.h" +#include "util/u_pointer.h" #include "util/u_format.h" #include "util/u_format_tests.h" #include "util/u_format_s3tc.h" @@ -73,19 +74,6 @@ typedef void (*fetch_ptr_t)(float *, const void *packed, unsigned i, unsigned j); -/** cast wrapper to avoid warnings */ -static fetch_ptr_t -void_to_fetch_ptr_t(void *p) -{ - union { - void *v; - fetch_ptr_t f; - } u; - u.v = p; - return u.f; -} - - static LLVMValueRef add_fetch_rgba_test(LLVMModuleRef lp_build_module, @@ -162,7 +150,7 @@ test_format(unsigned verbose, FILE *fp, (void)pass; #endif - fetch_ptr = void_to_fetch_ptr_t(LLVMGetPointerToGlobal(lp_build_engine, fetch)); + fetch_ptr = (fetch_ptr_t)pointer_to_func(LLVMGetPointerToGlobal(lp_build_engine, fetch)); for (i = 0; i < desc->block.height; ++i) { for (j = 0; j < desc->block.width; ++j) { |