forked from enlightenment/efl
parent
1a72827555
commit
77e3899ad6
|
@ -206,12 +206,13 @@ _embryo_program_init(Embryo_Program *ep, void *code)
|
|||
ep->flags = EMBRYO_FLAG_RELOC;
|
||||
|
||||
{
|
||||
Embryo_Cell cip, code_size;
|
||||
Embryo_Cell cip, code_size, cip_end;
|
||||
Embryo_Cell *code;
|
||||
|
||||
code_size = hdr->dat - hdr->cod;
|
||||
code = (Embryo_Cell *)((unsigned char *)ep->code + (int)hdr->cod);
|
||||
for (cip = 0; cip < (code_size / sizeof(Embryo_Cell)); cip++)
|
||||
cip_end = code_size / sizeof(Embryo_Cell);
|
||||
for (cip = 0; cip < cip_end; cip++)
|
||||
{
|
||||
/* move this here - later we probably want something that verifies opcodes
|
||||
* are valid and ok...
|
||||
|
@ -547,7 +548,11 @@ embryo_program_vm_pop(Embryo_Program *ep)
|
|||
* @ingroup Embryo_Swap_Group
|
||||
*/
|
||||
EAPI void
|
||||
embryo_swap_16(unsigned short *v)
|
||||
embryo_swap_16(unsigned short *v
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
__UNUSED__
|
||||
#endif
|
||||
)
|
||||
{
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
_embryo_byte_swap_16(v);
|
||||
|
@ -561,7 +566,11 @@ embryo_swap_16(unsigned short *v)
|
|||
* @ingroup Embryo_Swap_Group
|
||||
*/
|
||||
EAPI void
|
||||
embryo_swap_32(unsigned int *v)
|
||||
embryo_swap_32(unsigned int *v
|
||||
#ifndef WORDS_BIGENDIAN
|
||||
__UNUSED__
|
||||
#endif
|
||||
)
|
||||
{
|
||||
#ifdef WORDS_BIGENDIAN
|
||||
_embryo_byte_swap_32(v);
|
||||
|
|
|
@ -91,7 +91,7 @@ _embryo_fp_str(Embryo_Program *ep, Embryo_Cell *params)
|
|||
if (params[0] != (1 * sizeof(Embryo_Cell))) return 0;
|
||||
str = embryo_data_address_get(ep, params[1]);
|
||||
len = embryo_data_string_length_get(ep, str);
|
||||
if ((len == 0) || (len >= sizeof(buf))) return 0;
|
||||
if ((len == 0) || (len >= (int)sizeof(buf))) return 0;
|
||||
embryo_data_string_get(ep, str, buf);
|
||||
f = (float)atof(buf);
|
||||
return EMBRYO_FLOAT_TO_CELL(f);
|
||||
|
|
|
@ -276,7 +276,7 @@ _embryo_str_snprintf(Embryo_Program *ep, Embryo_Cell *params)
|
|||
/* params[2] = bufsize */
|
||||
/* params[3] = format_string */
|
||||
/* params[4] = first arg ... */
|
||||
if (params[0] < (3 * sizeof(Embryo_Cell))) return 0;
|
||||
if (params[0] < (Embryo_Cell)(3 * sizeof(Embryo_Cell))) return 0;
|
||||
if (params[2] <= 0) return 0;
|
||||
STRGET(ep, s1, params[3]);
|
||||
if (!s1) return -1;
|
||||
|
|
Loading…
Reference in New Issue