summaryrefslogtreecommitdiff
path: root/src/gallium/drivers/llvmpipe/lp_test_format.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_format.c
parent45d6289fab1aa012f265e5b51a10c2a07c85679b (diff)
llvmpipe: silence cast warnings in test programs
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_test_format.c')
-rw-r--r--src/gallium/drivers/llvmpipe/lp_test_format.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_test_format.c b/src/gallium/drivers/llvmpipe/lp_test_format.c
index d5a81a941c..267f1487bb 100644
--- a/src/gallium/drivers/llvmpipe/lp_test_format.c
+++ b/src/gallium/drivers/llvmpipe/lp_test_format.c
@@ -73,6 +73,19 @@ typedef void
(*fetch_ptr_t)(float *, const void *packed,
unsigned i, unsigned j);
+/** cast wrapper to avoid warnings */
+static fetch_ptr_t
+void_to_fetch_ptr_t(void *p)
+{
+ union {
+ void *v;
+ fetch_ptr_t f;
+ } u;
+ u.v = p;
+ return u.f;
+}
+
+
static LLVMValueRef
add_fetch_rgba_test(LLVMModuleRef lp_build_module,
@@ -149,7 +162,7 @@ test_format(unsigned verbose, FILE *fp,
(void)pass;
#endif
- fetch_ptr = (fetch_ptr_t) LLVMGetPointerToGlobal(lp_build_engine, fetch);
+ fetch_ptr = void_to_fetch_ptr_t(LLVMGetPointerToGlobal(lp_build_engine, fetch));
for (i = 0; i < desc->block.height; ++i) {
for (j = 0; j < desc->block.width; ++j) {