From 77e3899ad6b767d29135ab98ed56a4d16ccbd290 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Sun, 19 Sep 2010 02:51:46 +0000 Subject: [PATCH] warnings-- SVN revision: 52450 --- legacy/embryo/src/lib/embryo_amx.c | 17 +++++++++++++---- legacy/embryo/src/lib/embryo_float.c | 2 +- legacy/embryo/src/lib/embryo_str.c | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/legacy/embryo/src/lib/embryo_amx.c b/legacy/embryo/src/lib/embryo_amx.c index 6e76411bdd..1dc5c86f31 100644 --- a/legacy/embryo/src/lib/embryo_amx.c +++ b/legacy/embryo/src/lib/embryo_amx.c @@ -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); diff --git a/legacy/embryo/src/lib/embryo_float.c b/legacy/embryo/src/lib/embryo_float.c index 54f81e4522..a65fbe55fe 100644 --- a/legacy/embryo/src/lib/embryo_float.c +++ b/legacy/embryo/src/lib/embryo_float.c @@ -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); diff --git a/legacy/embryo/src/lib/embryo_str.c b/legacy/embryo/src/lib/embryo_str.c index 653ff50bff..46a3284a13 100644 --- a/legacy/embryo/src/lib/embryo_str.c +++ b/legacy/embryo/src/lib/embryo_str.c @@ -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;