diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2018-11-23 22:49:18 +0200 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2018-11-23 22:49:18 +0200 |
commit | 69db6f1f195817079e08ee1f0225ac77ce5ca392 (patch) | |
tree | b0136d0df2839bee8d7bcdb36dc0ba69b4a5dd1b | |
parent | bc70bb89e8cc61bb2a3ea6c1b90b798d8b2ebbb6 (diff) |
wrapper: fix compiler warnings
-rw-r--r-- | src/wrapper/wrapper.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/wrapper/wrapper.c b/src/wrapper/wrapper.c index 79f792f..1c2d684 100644 --- a/src/wrapper/wrapper.c +++ b/src/wrapper/wrapper.c @@ -114,7 +114,7 @@ wrapper_create(const char *const symbol, void *function) } tracefun = { .fun = trace }; const size_t len = strlen(symbol) + 1; - const char *copy = malloc(len); + char *copy = malloc(len); assert(copy && "welp, malloc failed"); memcpy(copy, symbol, len); const size_t sz = &wrapper_end - &wrapper_start; @@ -125,11 +125,11 @@ wrapper_create(const char *const symbol, void *function) memcpy(fun + (&wrapper_symbol - &wrapper_start) + 1, ©, sizeof(copy)); { const unsigned char *from = fun + (&wrapper_restore - &wrapper_start); - const unsigned char *to = (unsigned char*)tracefun.ptr - from; + const intptr_t to = (unsigned char*)tracefun.ptr - from; memcpy(fun + (&wrapper_trace - &wrapper_start) + 1, &to, sizeof(to)); }{ const unsigned char *from = fun + (&wrapper_ud - &wrapper_start); - const unsigned char *to = (unsigned char*)function - from; + const intptr_t to = (unsigned char*)function - from; memcpy(fun + (&wrapper_jmp - &wrapper_start) + 1, &to, sizeof(to)); } #else |