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_printf.c | |
parent | 4b29da1226133f2578557c0e8fa8b859061bf88b (diff) |
llvmpipe: Use pointer_to_func() instead of custom wrappers.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_test_printf.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_test_printf.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_test_printf.c b/src/gallium/drivers/llvmpipe/lp_test_printf.c index 13485c3774..d99ca81638 100644 --- a/src/gallium/drivers/llvmpipe/lp_test_printf.c +++ b/src/gallium/drivers/llvmpipe/lp_test_printf.c @@ -29,6 +29,7 @@ #include <stdlib.h> #include <stdio.h> +#include "util/u_pointer.h" #include "gallivm/lp_bld.h" #include "gallivm/lp_bld_printf.h" @@ -58,18 +59,6 @@ write_tsv_header(FILE *fp) typedef void (*test_printf_t)(int i); -/** cast wrapper */ -static test_printf_t -voidptr_to_test_printf_t(void *p) -{ - union { - void *v; - test_printf_t f; - } u; - u.v = p; - return u.f; -} - static LLVMValueRef add_printf_test(LLVMModuleRef module) @@ -140,7 +129,7 @@ test_printf(unsigned verbose, FILE *fp, const struct printf_test_case *testcase) #endif code = LLVMGetPointerToGlobal(engine, test); - test_printf = voidptr_to_test_printf_t(code); + test_printf = (test_printf_t)pointer_to_func(code); memset(unpacked, 0, sizeof unpacked); packed = 0; |