code style: convert tabs to spaces

This commit is contained in:
Nguyen Anh Quynh
2015-08-23 09:06:31 +08:00
parent 1cecc72f24
commit 4701fb80b4
2 changed files with 23 additions and 23 deletions

View File

@ -945,15 +945,15 @@ void helper_syscall(CPUX86State *env, int next_eip_addend)
#else #else
void helper_syscall(CPUX86State *env, int next_eip_addend) void helper_syscall(CPUX86State *env, int next_eip_addend)
{ {
// Unicorn: call interrupt callback if registered // Unicorn: call interrupt callback if registered
struct uc_struct *uc = env->uc; struct uc_struct *uc = env->uc;
if (uc->hook_syscall_idx) { if (uc->hook_syscall_idx) {
((uc_cb_insn_syscall_t)uc->hook_callbacks[uc->hook_syscall_idx].callback)( ((uc_cb_insn_syscall_t)uc->hook_callbacks[uc->hook_syscall_idx].callback)(
(uch)uc, uc->hook_callbacks[uc->hook_syscall_idx].user_data); (uch)uc, uc->hook_callbacks[uc->hook_syscall_idx].user_data);
env->eip += next_eip_addend; env->eip += next_eip_addend;
} }
return; return;
int selector; int selector;

30
uc.c
View File

@ -40,10 +40,10 @@ static unsigned int all_arch = 0;
static void archs_enable(void) static void archs_enable(void)
{ {
static bool initialized = false; static bool initialized = false;
if (initialized) if (initialized)
return; return;
#ifdef UNICORN_HAS_ARM #ifdef UNICORN_HAS_ARM
all_arch = all_arch + (1 << UC_ARCH_ARM); all_arch = all_arch + (1 << UC_ARCH_ARM);
@ -64,14 +64,14 @@ static void archs_enable(void)
all_arch = all_arch + (1 << UC_ARCH_X86); all_arch = all_arch + (1 << UC_ARCH_X86);
#endif #endif
initialized = true; initialized = true;
} }
UNICORN_EXPORT UNICORN_EXPORT
unsigned int uc_version(unsigned int *major, unsigned int *minor) unsigned int uc_version(unsigned int *major, unsigned int *minor)
{ {
archs_enable(); archs_enable();
if (major != NULL && minor != NULL) { if (major != NULL && minor != NULL) {
*major = UC_API_MAJOR; *major = UC_API_MAJOR;
@ -133,18 +133,18 @@ const char *uc_strerror(uc_err code)
UNICORN_EXPORT UNICORN_EXPORT
bool uc_support(int query) bool uc_support(int query)
{ {
archs_enable(); archs_enable();
if (query == UC_ARCH_ALL) if (query == UC_ARCH_ALL)
return all_arch == ((1 << UC_ARCH_ARM) | (1 << UC_ARCH_ARM64) | return all_arch == ((1 << UC_ARCH_ARM) | (1 << UC_ARCH_ARM64) |
(1 << UC_ARCH_MIPS) | (1 << UC_ARCH_X86) | (1 << UC_ARCH_MIPS) | (1 << UC_ARCH_X86) |
(1 << UC_ARCH_M68K) | (1 << UC_ARCH_SPARC)); (1 << UC_ARCH_M68K) | (1 << UC_ARCH_SPARC));
if ((unsigned int)query < UC_ARCH_MAX) if ((unsigned int)query < UC_ARCH_MAX)
return ((all_arch & (1 << query)) != 0); return ((all_arch & (1 << query)) != 0);
// unsupported query // unsupported query
return false; return false;
} }
@ -153,7 +153,7 @@ uc_err uc_open(uc_arch arch, uc_mode mode, uch *handle)
{ {
struct uc_struct *uc; struct uc_struct *uc;
archs_enable(); archs_enable();
if (arch < UC_ARCH_MAX) { if (arch < UC_ARCH_MAX) {
uc = calloc(1, sizeof(*uc)); uc = calloc(1, sizeof(*uc));