diff options
author | Keith Whitwell <[email protected]> | 2007-09-26 13:30:01 +0100 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2007-09-27 07:56:23 +0100 |
commit | 82e2d3226893487d33152f15763516473187c07d (patch) | |
tree | 1cbd2aa8dd95dd693ea99cfd9056e73b66b0ddb6 /src/mesa/x86/rtasm/x86sse.c | |
parent | 65e3af51efc9d688ef8face0a44429a90c5dd4c9 (diff) |
Fix some compiler warnings with -pedantic
Diffstat (limited to 'src/mesa/x86/rtasm/x86sse.c')
-rw-r--r-- | src/mesa/x86/rtasm/x86sse.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/mesa/x86/rtasm/x86sse.c b/src/mesa/x86/rtasm/x86sse.c index 96c1301d7f5..a6cfa40f91f 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 |