Skip to content

Commit 56e7ead

Browse files
committed
Fix build for GCC 4.7.
Related issue: #1 JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin [email protected]
1 parent 1b55630 commit 56e7ead

File tree

3 files changed

+10
-8
lines changed

3 files changed

+10
-8
lines changed

jerry-core/ecma/base/ecma-helpers-string.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1384,7 +1384,7 @@ ecma_string_get_length (const ecma_string_t *string_p) /**< ecma-string */
13841384
else if (container == ECMA_STRING_CONTAINER_UINT32_IN_DESC)
13851385
{
13861386
const uint32_t uint32_number = string_p->u.uint32_number;
1387-
const int32_t max_uint32_len = 10;
1387+
const uint32_t max_uint32_len = 10;
13881388
const uint32_t nums_with_ascending_length[10] =
13891389
{
13901390
1u,

jerry-core/lit/lit-strings.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -375,13 +375,13 @@ lit_utf8_string_calc_hash_last_bytes (const lit_utf8_byte_t *utf8_buf_p, /**< ch
375375
{
376376
JERRY_ASSERT (utf8_buf_p != NULL);
377377

378-
lit_utf8_byte_t byte1 = (utf8_buf_size > 0) ? utf8_buf_p[utf8_buf_size - 1] : 0;
379-
lit_utf8_byte_t byte2 = (utf8_buf_size > 1) ? utf8_buf_p[utf8_buf_size - 2] : 0;
378+
lit_utf8_size_t byte1 = utf8_buf_size > 0 ? utf8_buf_p[utf8_buf_size - 1] : (lit_utf8_size_t) 0;
379+
lit_utf8_size_t byte2 = utf8_buf_size > 1 ? utf8_buf_p[utf8_buf_size - 2] : (lit_utf8_size_t) 0;
380380

381-
uint32_t t1 = (uint32_t) byte1 + (uint32_t) byte2;
382-
uint32_t t2 = t1 * 0x24418b66;
383-
uint32_t t3 = (t2 >> 16) ^ (t2 & 0xffffu);
384-
uint32_t t4 = (t3 >> 8) ^ (t3 & 0xffu);
381+
lit_utf8_size_t t1 = byte1 + byte2;
382+
lit_utf8_size_t t2 = t1 * 0x24418b66;
383+
lit_utf8_size_t t3 = (t2 >> 16) ^ (t2 & 0xffffu);
384+
lit_utf8_size_t t4 = (t3 >> 8) ^ (t3 & 0xffu);
385385

386386
return (lit_string_hash_t) t4;
387387
} /* lit_utf8_string_calc_hash_last_bytes */

jerry-core/parser/regexp/re-parser.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@
2525
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN
2626

2727
/* FIXME: change it, when unicode support would be implemented */
28-
#define RE_LOOKUP(str_p, lookup) (lit_zt_utf8_string_size (str_p) > (lookup) ? str_p[lookup] : '\0')
28+
#define RE_LOOKUP(str_p, lookup) ((lit_zt_utf8_string_size (str_p) > (lookup)) \
29+
? (ecma_char_t) str_p[lookup] \
30+
: (ecma_char_t) '\0')
2931

3032
/* FIXME: change it, when unicode support would be implemented */
3133
#define RE_ADVANCE(str_p, advance) do { str_p += advance; } while (0)

0 commit comments

Comments
 (0)