diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2007-09-26 13:30:01 +0100 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2007-09-27 07:56:23 +0100 |
commit | 82e2d3226893487d33152f15763516473187c07d (patch) | |
tree | 1cbd2aa8dd95dd693ea99cfd9056e73b66b0ddb6 /src/mesa/x86/rtasm | |
parent | 65e3af51efc9d688ef8face0a44429a90c5dd4c9 (diff) | |
download | external_mesa3d-82e2d3226893487d33152f15763516473187c07d.zip external_mesa3d-82e2d3226893487d33152f15763516473187c07d.tar.gz external_mesa3d-82e2d3226893487d33152f15763516473187c07d.tar.bz2 |
Fix some compiler warnings with -pedantic
Diffstat (limited to 'src/mesa/x86/rtasm')
-rw-r--r-- | src/mesa/x86/rtasm/x86sse.c | 12 | ||||
-rw-r--r-- | src/mesa/x86/rtasm/x86sse.h | 2 |
2 files changed, 10 insertions, 4 deletions
diff --git a/src/mesa/x86/rtasm/x86sse.c b/src/mesa/x86/rtasm/x86sse.c index 96c1301..a6cfa40 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 4816bd2..c1ca060 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, |