msvc: code style

This commit is contained in:
Nguyen Anh Quynh 2015-12-05 10:55:28 +07:00
parent 0e5bc9f84c
commit fc54007fab

View file

@ -95,20 +95,17 @@ static uc_mem_protect_t gp_uc_mem_protect = NULL;
bool uc_dyn_load(const char* path, int flags)
{
if( path == NULL )
{
if (path == NULL) {
path = DYNLOAD_DEFPATH;
}
if( g_dyn_handle )
{
if( !uc_dyn_free() )
if (g_dyn_handle) {
if (!uc_dyn_free())
return false;
}
g_dyn_handle = DYNLOAD_LOADLIB(path, flags);
if( g_dyn_handle == NULL )
{
if (g_dyn_handle == NULL) {
//int err = DYNLOAD_GETERROR();
//printf("Error loading %s: Last error is %X\n", path, err);
return false;
@ -136,7 +133,7 @@ bool uc_dyn_load(const char* path, int flags)
bool uc_dyn_free(void)
{
if( g_dyn_handle==NULL )
if (g_dyn_handle==NULL)
return true;
DYNLOAD_FREELIB(g_dyn_handle);
@ -164,40 +161,64 @@ bool uc_dyn_free(void)
unsigned int uc_version(unsigned int *major, unsigned int *minor)
{ return gp_uc_version(major, minor); }
{
return gp_uc_version(major, minor);
}
bool uc_arch_supported(uc_arch arch)
{ return gp_uc_arch_supported(arch); }
{
return gp_uc_arch_supported(arch);
}
uc_err uc_open(uc_arch arch, uc_mode mode, uc_engine **uc)
{ return gp_uc_open(arch, mode, uc); }
{
return gp_uc_open(arch, mode, uc);
}
uc_err uc_close(uc_engine *uc)
{ return gp_uc_close(uc); }
{
return gp_uc_close(uc);
}
uc_err uc_errno(uc_engine *uc)
{ return gp_uc_errno(uc); }
{
return gp_uc_errno(uc);
}
const char *uc_strerror(uc_err code)
{ return gp_uc_strerror(code); }
{
return gp_uc_strerror(code);
}
uc_err uc_reg_write(uc_engine *uc, int regid, const void *value)
{ return gp_uc_reg_write(uc, regid, value); }
{
return gp_uc_reg_write(uc, regid, value);
}
uc_err uc_reg_read(uc_engine *uc, int regid, void *value)
{ return gp_uc_reg_read(uc, regid, value); }
{
return gp_uc_reg_read(uc, regid, value);
}
uc_err uc_mem_write(uc_engine *uc, uint64_t address, const void *bytes, size_t size)
{ return gp_uc_mem_write(uc, address, bytes, size); }
{
return gp_uc_mem_write(uc, address, bytes, size);
}
uc_err uc_mem_read(uc_engine *uc, uint64_t address, void *bytes, size_t size)
{ return gp_uc_mem_read(uc, address, bytes, size); }
{
return gp_uc_mem_read(uc, address, bytes, size);
}
uc_err uc_emu_start(uc_engine *uc, uint64_t begin, uint64_t until, uint64_t timeout, size_t count)
{ return gp_uc_emu_start(uc, begin, until, timeout, count); }
{
return gp_uc_emu_start(uc, begin, until, timeout, count);
}
uc_err uc_emu_stop(uc_engine *uc)
{ return gp_uc_emu_stop(uc); }
{
return gp_uc_emu_stop(uc);
}
uc_err uc_hook_add(uc_engine *uc, uc_hook *hh, int type, void *callback, void *user_data, ...)
{
@ -236,14 +257,22 @@ uc_err uc_hook_add(uc_engine *uc, uc_hook *hh, int type, void *callback, void *u
}
uc_err uc_hook_del(uc_engine *uc, uc_hook hh)
{ return gp_uc_hook_del(uc, hh); }
{
return gp_uc_hook_del(uc, hh);
}
uc_err uc_mem_map(uc_engine *uc, uint64_t address, size_t size, uint32_t perms)
{ return gp_uc_mem_map(uc, address, size, perms); }
{
return gp_uc_mem_map(uc, address, size, perms);
}
uc_err uc_mem_unmap(uc_engine *uc, uint64_t address, size_t size)
{ return gp_uc_mem_unmap(uc, address, size); }
{
return gp_uc_mem_unmap(uc, address, size);
}
uc_err uc_mem_protect(uc_engine *uc, uint64_t address, size_t size, uint32_t perms)
{ return gp_uc_mem_protect(uc, address, size, perms); }
{
return gp_uc_mem_protect(uc, address, size, perms);
}