summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_test_blend.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-05-13 13:21:19 -0600
committerBrian Paul <brianp@vmware.com>2010-05-13 14:15:44 -0600
commit966d28cb2e5e090d8f591810f331df0d05b06271 (patch)
tree623f7cbc621fc4d0c41151896990173bdecae67c /src/gallium/drivers/llvmpipe/lp_test_blend.c
parent45d6289fab1aa012f265e5b51a10c2a07c85679b (diff)
llvmpipe: silence cast warnings in test programs
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_test_blend.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_test_blend.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_test_blend.c b/src/gallium/drivers/llvmpipe/lp_test_blend.c
index d32a9223cd..072d699666 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_blend.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_blend.c
@@ -52,6 +52,19 @@ enum vector_mode
typedef void (*blend_test_ptr_t)(const void *src, const void *dst, const void *con, void *res);
+/** cast wrapper */
+static blend_test_ptr_t
+voidptr_to_blend_test_ptr_t(void *p)
+{
+ union {
+ void *v;
+ blend_test_ptr_t f;
+ } u;
+ u.v = p;
+ return u.f;
+}
+
+
void
write_tsv_header(FILE *fp)
@@ -482,6 +495,7 @@ test_one(unsigned verbose,
int64_t cycles[LP_TEST_NUM_SAMPLES];
double cycles_avg = 0.0;
unsigned i, j;
+ void *code;
if(verbose >= 1)
dump_blend_type(stdout, blend, mode, type);
@@ -523,10 +537,11 @@ test_one(unsigned verbose,
if(verbose >= 2)
LLVMDumpModule(module);
- blend_test_ptr = (blend_test_ptr_t)LLVMGetPointerToGlobal(engine, func);
+ code = LLVMGetPointerToGlobal(engine, func);
+ blend_test_ptr = voidptr_to_blend_test_ptr_t(code);
if(verbose >= 2)
- lp_disassemble(blend_test_ptr);
+ lp_disassemble(code);
success = TRUE;
for(i = 0; i < n && success; ++i) {