Skip to content

Commit

Permalink
fix type to avoid compiler warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
rovo89 committed Sep 28, 2013
1 parent bbfafd7 commit 400c44e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions xposed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ static jobject xposedAddLocalReference(::Thread* self, Object* obj) {
return jobj;
}

static void replaceAsm(void* function, char* newCode, int len) {
static void replaceAsm(void* function, unsigned const char* newCode, int len) {
#ifdef __arm__
function = (void*)((int)function & ~1);
#endif
Expand All @@ -336,8 +336,8 @@ static void replaceAsm(void* function, char* newCode, int len) {

static void patchReturnTrue(void* function) {
#ifdef __arm__
char asmReturnTrueThumb[] = { 0x01, 0x20, 0x70, 0x47 };
char asmReturnTrueArm[] = { 0x01, 0x00, 0xA0, 0xE3, 0x1E, 0xFF, 0x2F, 0xE1 };
unsigned const char asmReturnTrueThumb[] = { 0x01, 0x20, 0x70, 0x47 };
unsigned const char asmReturnTrueArm[] = { 0x01, 0x00, 0xA0, 0xE3, 0x1E, 0xFF, 0x2F, 0xE1 };
if ((int)function & 1)
replaceAsm(function, asmReturnTrueThumb, sizeof(asmReturnTrueThumb));
else
Expand Down
6 changes: 3 additions & 3 deletions xposedtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include <fcntl.h>
#include <sys/mman.h>

static void replaceAsm(void* function, char* newCode, int len) {
static void replaceAsm(void* function, unsigned const char* newCode, int len) {
#ifdef __arm__
function = (void*)((int)function & ~1);
#endif
Expand All @@ -28,9 +28,9 @@ int main(int argc, const char* const argv[]) {
}

#ifdef __arm__
char asmReturn42[] = { 42, 0x20, 0x70, 0x47 };
unsigned const char asmReturn42[] = { 42, 0x20, 0x70, 0x47 };
#else
char asmReturn42[] = { 0xB8, 42, 0x00, 0x00, 0x00, 0xC3 };
unsigned const char asmReturn42[] = { 0xB8, 42, 0x00, 0x00, 0x00, 0xC3 };
#endif
replaceAsm((void*) asmReplaceTest, asmReturn42, sizeof(asmReturn42));

Expand Down

0 comments on commit 400c44e

Please sign in to comment.