summaryrefslogtreecommitdiff
path: root/src/gallium/auxiliary/rtasm/rtasm_x86sse.c
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2010-05-13 13:41:49 -0600
committerBrian Paul <brianp@vmware.com>2010-05-13 14:15:44 -0600
commitf667526016dd1710fafd50eb09ac2c5c5b36063e (patch)
tree165e286361ca01755353c41f38807ea0f1260c87 /src/gallium/auxiliary/rtasm/rtasm_x86sse.c
parent56da0cb7ac1c22c8029028ed804bdbd1972d0d8b (diff)
rtasm: fix void * / func * casting warnings
Diffstat (limited to 'src/gallium/auxiliary/rtasm/rtasm_x86sse.c')
-rw-r--r--src/gallium/auxiliary/rtasm/rtasm_x86sse.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/rtasm/rtasm_x86sse.c b/src/gallium/auxiliary/rtasm/rtasm_x86sse.c
index 7595214bdf..9f70b73698 100644
--- a/src/gallium/auxiliary/rtasm/rtasm_x86sse.c
+++ b/src/gallium/auxiliary/rtasm/rtasm_x86sse.c
@@ -1743,20 +1743,35 @@ void x86_release_func( struct x86_function *p )
}
-void (*x86_get_func( struct x86_function *p ))(void)
+static INLINE x86_func
+voidptr_to_x86_func(void *v)
+{
+ union {
+ void *v;
+ x86_func f;
+ } u;
+ assert(sizeof(u.v) == sizeof(u.f));
+ u.v = v;
+ return u.f;
+}
+
+
+x86_func x86_get_func( struct x86_function *p )
{
DUMP_END();
if (DISASSEM && p->store)
debug_printf("disassemble %p %p\n", p->store, p->csr);
if (p->store == p->error_overflow)
- return (void (*)(void)) NULL;
+ return voidptr_to_x86_func(NULL);
else
- return (void (*)(void)) p->store;
+ return voidptr_to_x86_func(p->store);
}
#else
+void x86sse_dummy( void );
+
void x86sse_dummy( void )
{
}