Fix build for GCC 4.7.

Related issue: #1

JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin e.gavrin@samsung.com
This commit is contained in:
Evgeny Gavrin 2015-07-01 20:52:37 +03:00
parent 1b55630b2a
commit 56e7ead9f9
3 changed files with 10 additions and 8 deletions

View File

@ -1384,7 +1384,7 @@ ecma_string_get_length (const ecma_string_t *string_p) /**< ecma-string */
else if (container == ECMA_STRING_CONTAINER_UINT32_IN_DESC)
{
const uint32_t uint32_number = string_p->u.uint32_number;
const int32_t max_uint32_len = 10;
const uint32_t max_uint32_len = 10;
const uint32_t nums_with_ascending_length[10] =
{
1u,

View File

@ -375,13 +375,13 @@ lit_utf8_string_calc_hash_last_bytes (const lit_utf8_byte_t *utf8_buf_p, /**< ch
{
JERRY_ASSERT (utf8_buf_p != NULL);
lit_utf8_byte_t byte1 = (utf8_buf_size > 0) ? utf8_buf_p[utf8_buf_size - 1] : 0;
lit_utf8_byte_t byte2 = (utf8_buf_size > 1) ? utf8_buf_p[utf8_buf_size - 2] : 0;
lit_utf8_size_t byte1 = utf8_buf_size > 0 ? utf8_buf_p[utf8_buf_size - 1] : (lit_utf8_size_t) 0;
lit_utf8_size_t byte2 = utf8_buf_size > 1 ? utf8_buf_p[utf8_buf_size - 2] : (lit_utf8_size_t) 0;
uint32_t t1 = (uint32_t) byte1 + (uint32_t) byte2;
uint32_t t2 = t1 * 0x24418b66;
uint32_t t3 = (t2 >> 16) ^ (t2 & 0xffffu);
uint32_t t4 = (t3 >> 8) ^ (t3 & 0xffu);
lit_utf8_size_t t1 = byte1 + byte2;
lit_utf8_size_t t2 = t1 * 0x24418b66;
lit_utf8_size_t t3 = (t2 >> 16) ^ (t2 & 0xffffu);
lit_utf8_size_t t4 = (t3 >> 8) ^ (t3 & 0xffu);
return (lit_string_hash_t) t4;
} /* lit_utf8_string_calc_hash_last_bytes */

View File

@ -25,7 +25,9 @@
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN
/* FIXME: change it, when unicode support would be implemented */
#define RE_LOOKUP(str_p, lookup) (lit_zt_utf8_string_size (str_p) > (lookup) ? str_p[lookup] : '\0')
#define RE_LOOKUP(str_p, lookup) ((lit_zt_utf8_string_size (str_p) > (lookup)) \
? (ecma_char_t) str_p[lookup] \
: (ecma_char_t) '\0')
/* FIXME: change it, when unicode support would be implemented */
#define RE_ADVANCE(str_p, advance) do { str_p += advance; } while (0)