From 21a9ef12bf229bf66287b5444708c51a89eaa09c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Thu, 10 Jun 2010 16:23:25 +0100 Subject: [PATCH] gallivm: Use func_to_pointer(). --- .../auxiliary/gallivm/lp_bld_format_aos.c | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/src/gallium/auxiliary/gallivm/lp_bld_format_aos.c b/src/gallium/auxiliary/gallivm/lp_bld_format_aos.c index eb492042387..87e3e72a6e8 100644 --- a/src/gallium/auxiliary/gallivm/lp_bld_format_aos.c +++ b/src/gallium/auxiliary/gallivm/lp_bld_format_aos.c @@ -310,21 +310,6 @@ lp_build_pack_rgba_aos(LLVMBuilderRef builder, } -typedef void (*fetch_func)(float *, const uint8_t *, unsigned, unsigned); - -/** cast wrapper */ -static void * -fetch_func_ptr_to_voidptr(fetch_func f) -{ - union { - void *v; - fetch_func f; - } u; - u.f = f; - return u.v; -} - - /** * Fetch a pixel into a 4 float AoS. * @@ -406,7 +391,7 @@ lp_build_fetch_rgba_aos(LLVMBuilderRef builder, assert(LLVMIsDeclaration(function)); LLVMAddGlobalMapping(lp_build_engine, function, - fetch_func_ptr_to_voidptr(format_desc->fetch_rgba_float)); + func_to_pointer((func_pointer)format_desc->fetch_rgba_float)); } tmp = lp_build_alloca(builder, LLVMVectorType(LLVMFloatType(), 4), ""); -- 2.30.2