build: fix -Wall warnings
[mate.git] / trap.c
diff --git a/trap.c b/trap.c
index 2e043d7d21cbd479a7c94d7e4e1dd4fe273b7aa0..5a124af2ea77ecc5399a6be9b02daa27a28979fa 100644 (file)
--- a/trap.c
+++ b/trap.c
@@ -35,16 +35,16 @@ void callertrap(int nSignal, siginfo_t *info, void *ctx)
 {
        struct ucontext *uctx = (struct ucontext *) ctx;
 
-       printf("callertrap(mctx)  by 0x%08x\n", uctx->uc_mcontext.eip);
+       printf("callertrap(mctx)  by 0x%08x\n", (unsigned int) uctx->uc_mcontext.eip);
        // printf("callertrap(addr)  by 0x%08x\n", info->si_addr);
        // printf("callertrap(*esp)  by 0x%08x\n", * (unsigned int *) uctx->uc_mcontext.esp);
 
        unsigned int *to_patch = (unsigned int *) (uctx->uc_mcontext.eip + 2);
-       unsigned char *insn = (unsigned int *) (uctx->uc_mcontext.eip);
+       unsigned char *insn = (unsigned char *) (uctx->uc_mcontext.eip);
        *insn = 0x90; // nop
        insn++;
        *insn = 0xe8; // call
-       printf(" to_patch: 0x%08x\n", to_patch);
+       printf(" to_patch: 0x%08x\n", (unsigned int) to_patch);
        printf("*to_patch: 0x%08x\n", *to_patch);
        if (*to_patch != 0x00000000) {
                printf("something is wrong here. abort\n");
@@ -52,7 +52,7 @@ void callertrap(int nSignal, siginfo_t *info, void *ctx)
        }
        *to_patch = (unsigned int) patchme - ((unsigned int) insn + 5);
        printf("*to_patch: 0x%08x\n", *to_patch);
-       uctx->uc_mcontext.eip = insn;
+       uctx->uc_mcontext.eip = (unsigned long) insn;
        // while (1) ;
 }