summaryrefslogtreecommitdiff
path: root/src/mesa/x86/rtasm
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2007-09-26 13:30:01 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2007-09-27 07:56:23 +0100
commit82e2d3226893487d33152f15763516473187c07d (patch)
tree1cbd2aa8dd95dd693ea99cfd9056e73b66b0ddb6 /src/mesa/x86/rtasm
parent65e3af51efc9d688ef8face0a44429a90c5dd4c9 (diff)
Fix some compiler warnings with -pedantic
Diffstat (limited to 'src/mesa/x86/rtasm')
-rw-r--r--src/mesa/x86/rtasm/x86sse.c12
-rw-r--r--src/mesa/x86/rtasm/x86sse.h2
2 files changed, 10 insertions, 4 deletions
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,