From 9c18648b6c25b9e6d5c9e1859e44167e68476d40 Mon Sep 17 00:00:00 2001 From: Evgeny Gavrin Date: Thu, 9 Jul 2015 15:26:10 +0300 Subject: [PATCH] Fix build for GCC 4.7. JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin e.gavrin@samsung.com --- jerry-core/lit/lit-strings.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/jerry-core/lit/lit-strings.cpp b/jerry-core/lit/lit-strings.cpp index 4abcdcf06..230e4173f 100644 --- a/jerry-core/lit/lit-strings.cpp +++ b/jerry-core/lit/lit-strings.cpp @@ -555,10 +555,10 @@ lit_read_code_point_from_utf8 (const lit_utf8_byte_t *buf_p, /**< buffer with ch { JERRY_ASSERT (buf_p && buf_size); - lit_utf8_byte_t c = (uint8_t) buf_p[0]; + lit_utf8_byte_t c = buf_p[0]; if ((c & LIT_UTF8_1_BYTE_MASK) == LIT_UTF8_1_BYTE_MARKER) { - *code_point = (uint32_t) (c & LIT_UTF8_LAST_7_BITS_MASK); + *code_point = (lit_code_point_t) (c & LIT_UTF8_LAST_7_BITS_MASK); return 1; } @@ -567,17 +567,17 @@ lit_read_code_point_from_utf8 (const lit_utf8_byte_t *buf_p, /**< buffer with ch if ((c & LIT_UTF8_2_BYTE_MASK) == LIT_UTF8_2_BYTE_MARKER) { bytes_count = 2; - ret = ((uint32_t) (c & LIT_UTF8_LAST_5_BITS_MASK)); + ret = ((lit_code_point_t) (c & LIT_UTF8_LAST_5_BITS_MASK)); } else if ((c & LIT_UTF8_3_BYTE_MASK) == LIT_UTF8_3_BYTE_MARKER) { bytes_count = 3; - ret = ((uint32_t) (c & LIT_UTF8_LAST_4_BITS_MASK)); + ret = ((lit_code_point_t) (c & LIT_UTF8_LAST_4_BITS_MASK)); } else if ((c & LIT_UTF8_4_BYTE_MASK) == LIT_UTF8_4_BYTE_MARKER) { bytes_count = 4; - ret = ((uint32_t) (c & LIT_UTF8_LAST_3_BITS_MASK)); + ret = ((lit_code_point_t) (c & LIT_UTF8_LAST_3_BITS_MASK)); } else { @@ -608,8 +608,8 @@ 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_byte_t byte1 = (utf8_buf_size > 0) ? utf8_buf_p[utf8_buf_size - 1] : (lit_utf8_byte_t) 0; + lit_utf8_byte_t byte2 = (utf8_buf_size > 1) ? utf8_buf_p[utf8_buf_size - 2] : (lit_utf8_byte_t) 0; uint32_t t1 = (uint32_t) byte1 + (uint32_t) byte2; uint32_t t2 = t1 * 0x24418b66;