summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_test_conv.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_test_conv.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_test_conv.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_test_conv.c b/src/gallium/drivers/llvmpipe/lp_test_conv.c
index 958cc40538..254f0daea3 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_conv.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_conv.c
@@ -43,6 +43,17 @@
typedef void (*conv_test_ptr_t)(const void *src, const void *dst);
+/** cast wrapper */
+static conv_test_ptr_t
+voidptr_to_conv_test_ptr_t(void *p)
+{
+ union {
+ void *v;
+ conv_test_ptr_t f;
+ } u;
+ u.v = p;
+ return u.f;
+}
void
write_tsv_header(FILE *fp)
@@ -164,6 +175,7 @@ test_one(unsigned verbose,
unsigned num_dsts;
double eps;
unsigned i, j;
+ void *code;
if(verbose >= 1)
dump_conv_types(stdout, src_type, dst_type);
@@ -221,10 +233,11 @@ test_one(unsigned verbose,
if(verbose >= 2)
LLVMDumpModule(module);
- conv_test_ptr = (conv_test_ptr_t)LLVMGetPointerToGlobal(engine, func);
+ code = LLVMGetPointerToGlobal(engine, func);
+ conv_test_ptr = voidptr_to_conv_test_ptr_t(code);
if(verbose >= 2)
- lp_disassemble(conv_test_ptr);
+ lp_disassemble(code);
success = TRUE;
for(i = 0; i < n && success; ++i) {
@@ -384,7 +397,7 @@ test_all(unsigned verbose, FILE *fp)
{
const struct lp_type *src_type;
const struct lp_type *dst_type;
- bool success = TRUE;
+ boolean success = TRUE;
for(src_type = conv_types; src_type < &conv_types[num_types]; ++src_type) {
for(dst_type = conv_types; dst_type < &conv_types[num_types]; ++dst_type) {
@@ -411,7 +424,7 @@ test_some(unsigned verbose, FILE *fp, unsigned long n)
const struct lp_type *src_type;
const struct lp_type *dst_type;
unsigned long i;
- bool success = TRUE;
+ boolean success = TRUE;
for(i = 0; i < n; ++i) {
src_type = &conv_types[rand() % num_types];