remove warning for gcc 4.7
This commit is contained in:
parent
0ed670f409
commit
17a9cd71be
6 changed files with 12 additions and 12 deletions
|
@ -50,7 +50,7 @@ public:
|
|||
#endif
|
||||
ret();
|
||||
}
|
||||
int (*get() const)(int) { return (int (*)(int))(void*)getCode(); }
|
||||
int (*get() const)(int) { return (int (*)(int))(const void*)getCode(); }
|
||||
};
|
||||
|
||||
class CallAtoi : public Xbyak::CodeGenerator {
|
||||
|
@ -75,7 +75,7 @@ public:
|
|||
#endif
|
||||
ret();
|
||||
}
|
||||
int (*get() const)(const char *) { return (int (*)(const char *))(void*)getCode(); }
|
||||
int (*get() const)(const char *) { return (int (*)(const char *))(const void*)getCode(); }
|
||||
};
|
||||
|
||||
class JmpAtoi : public Xbyak::CodeGenerator {
|
||||
|
@ -91,7 +91,7 @@ public:
|
|||
jmp((void*)atoi);
|
||||
#endif
|
||||
}
|
||||
int (*get() const)(const char *) { return (int (*)(const char *))(void*)getCode(); }
|
||||
int (*get() const)(const char *) { return (int (*)(const char *))(const void*)getCode(); }
|
||||
};
|
||||
|
||||
int main()
|
||||
|
@ -106,7 +106,7 @@ int main()
|
|||
#else
|
||||
puts("32bit");
|
||||
#endif
|
||||
int (*func)(int) = (int (*)(int))(void*)s.getCode();
|
||||
int (*func)(int) = (int (*)(int))(const void*)s.getCode();
|
||||
for (int i = 0; i <= 10; i++) {
|
||||
printf("0 + ... + %d = %d\n", i, func(i));
|
||||
}
|
||||
|
@ -128,7 +128,7 @@ int main()
|
|||
uint8 *p = CodeArray::getAlignedAddress(buf);
|
||||
CodeArray::protect(p, codeSize, true);
|
||||
Sample s(p, codeSize);
|
||||
int (*func)(int) = (int (*)(int))(void*)s.getCode();
|
||||
int (*func)(int) = (int (*)(int))(const void*)s.getCode();
|
||||
if ((uint8*)func != p) {
|
||||
fprintf(stderr, "internal error %p %p\n", p, func);
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue