From 82e2d3226893487d33152f15763516473187c07d Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Wed, 26 Sep 2007 13:30:01 +0100 Subject: Fix some compiler warnings with -pedantic --- src/mesa/x86/rtasm/x86sse.c | 12 +++++++++--- src/mesa/x86/rtasm/x86sse.h | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'src/mesa/x86/rtasm') diff --git a/src/mesa/x86/rtasm/x86sse.c b/src/mesa/x86/rtasm/x86sse.c index 96c1301d7f..a6cfa40f91 100644 --- a/src/mesa/x86/rtasm/x86sse.c +++ b/src/mesa/x86/rtasm/x86sse.c @@ -6,6 +6,12 @@ #define DISASSEM 0 #define X86_TWOB 0x0f +static GLubyte *cptr( void (*label)() ) +{ + return (char *)(unsigned long)label; +} + + /* Emit bytes to the instruction stream: */ static void emit_1b( struct x86_function *p, GLbyte b0 ) @@ -252,10 +258,10 @@ void x86_jmp( struct x86_function *p, GLubyte *label) emit_1i(p, label - x86_get_label(p) - 4); } -void x86_call( struct x86_function *p, GLubyte *label) +void x86_call( struct x86_function *p, void (*label)()) { emit_1ub(p, 0xe8); - emit_1i(p, label - x86_get_label(p) - 4); + emit_1i(p, cptr(label) - x86_get_label(p) - 4); } /* michal: @@ -1138,7 +1144,7 @@ void (*x86_get_func( struct x86_function *p ))(void) { if (DISASSEM) _mesa_printf("disassemble %p %p\n", p->store, p->csr); - return (void (*)(void))p->store; + return (void (*)(void)) (unsigned long) p->store; } #else diff --git a/src/mesa/x86/rtasm/x86sse.h b/src/mesa/x86/rtasm/x86sse.h index 4816bd2ad2..c1ca06088b 100644 --- a/src/mesa/x86/rtasm/x86sse.h +++ b/src/mesa/x86/rtasm/x86sse.h @@ -120,7 +120,7 @@ void x86_fixup_fwd_jump( struct x86_function *p, void x86_jmp( struct x86_function *p, GLubyte *label ); -void x86_call( struct x86_function *p, GLubyte *label ); +void x86_call( struct x86_function *p, void (*label)() ); /* michal: * Temporary. As I need immediate operands, and dont want to mess with the codegen, -- cgit v1.2.3