Silencing Clang warning bys casting values

Warnings were: "Implicit conversion loses integer precision: 'size_t' to 'cs_mode'/'cs_opt_value'"
This commit is contained in:
Félix Cloutier 2015-03-02 22:06:56 -05:00
parent cc8fd38aa2
commit c141af9052
4 changed files with 4 additions and 4 deletions

View File

@ -48,7 +48,7 @@ static cs_err option(cs_struct *handle, cs_opt_type type, size_t value)
else else
handle->disasm = ARM_getInstruction; handle->disasm = ARM_getInstruction;
handle->mode = value; handle->mode = (cs_mode)value;
break; break;
case CS_OPT_SYNTAX: case CS_OPT_SYNTAX:
ARM_getRegName(handle, (int)value); ARM_getRegName(handle, (int)value);

View File

@ -46,7 +46,7 @@ static cs_err option(cs_struct *handle, cs_opt_type type, size_t value)
else else
handle->disasm = Mips64_getInstruction; handle->disasm = Mips64_getInstruction;
handle->mode = value; handle->mode = (cs_mode)value;
} }
return CS_ERR_OK; return CS_ERR_OK;
} }

View File

@ -51,7 +51,7 @@ static cs_err option(cs_struct *handle, cs_opt_type type, size_t value)
else else
handle->regsize_map = regsize_map_32; handle->regsize_map = regsize_map_32;
handle->mode = value; handle->mode = (cs_mode)value;
break; break;
case CS_OPT_SYNTAX: case CS_OPT_SYNTAX:
switch(value) { switch(value) {

2
cs.c
View File

@ -363,7 +363,7 @@ cs_err cs_option(csh ud, cs_opt_type type, size_t value)
default: default:
break; break;
case CS_OPT_DETAIL: case CS_OPT_DETAIL:
handle->detail = value; handle->detail = (cs_opt_value)value;
return CS_ERR_OK; return CS_ERR_OK;
case CS_OPT_SKIPDATA: case CS_OPT_SKIPDATA:
handle->skipdata = (value == CS_OPT_ON); handle->skipdata = (value == CS_OPT_ON);