gallivm: Use func_to_pointer().

This commit is contained in:
José Fonseca
2010-06-10 16:23:25 +01:00
parent 91bbe466c7
commit 21a9ef12bf

View File

@@ -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), "");