Skip to content

Commit 9bca792

Browse files
committed
Fix build for GCC 4.7.
JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin [email protected]
1 parent 91d9583 commit 9bca792

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

jerry-core/lit/lit-strings.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -555,10 +555,10 @@ lit_read_code_point_from_utf8 (const lit_utf8_byte_t *buf_p, /**< buffer with ch
555555
{
556556
JERRY_ASSERT (buf_p && buf_size);
557557

558-
lit_utf8_byte_t c = (uint8_t) buf_p[0];
558+
lit_utf8_byte_t c = buf_p[0];
559559
if ((c & LIT_UTF8_1_BYTE_MASK) == LIT_UTF8_1_BYTE_MARKER)
560560
{
561-
*code_point = (uint32_t) (c & LIT_UTF8_LAST_7_BITS_MASK);
561+
*code_point = (lit_code_point_t) (c & LIT_UTF8_LAST_7_BITS_MASK);
562562
return 1;
563563
}
564564

@@ -567,17 +567,17 @@ lit_read_code_point_from_utf8 (const lit_utf8_byte_t *buf_p, /**< buffer with ch
567567
if ((c & LIT_UTF8_2_BYTE_MASK) == LIT_UTF8_2_BYTE_MARKER)
568568
{
569569
bytes_count = 2;
570-
ret = ((uint32_t) (c & LIT_UTF8_LAST_5_BITS_MASK));
570+
ret = ((lit_code_point_t) (c & LIT_UTF8_LAST_5_BITS_MASK));
571571
}
572572
else if ((c & LIT_UTF8_3_BYTE_MASK) == LIT_UTF8_3_BYTE_MARKER)
573573
{
574574
bytes_count = 3;
575-
ret = ((uint32_t) (c & LIT_UTF8_LAST_4_BITS_MASK));
575+
ret = ((lit_code_point_t) (c & LIT_UTF8_LAST_4_BITS_MASK));
576576
}
577577
else if ((c & LIT_UTF8_4_BYTE_MASK) == LIT_UTF8_4_BYTE_MARKER)
578578
{
579579
bytes_count = 4;
580-
ret = ((uint32_t) (c & LIT_UTF8_LAST_3_BITS_MASK));
580+
ret = ((lit_code_point_t) (c & LIT_UTF8_LAST_3_BITS_MASK));
581581
}
582582
else
583583
{
@@ -608,8 +608,8 @@ lit_utf8_string_calc_hash_last_bytes (const lit_utf8_byte_t *utf8_buf_p, /**< ch
608608
{
609609
JERRY_ASSERT (utf8_buf_p != NULL);
610610

611-
lit_utf8_byte_t byte1 = (utf8_buf_size > 0) ? utf8_buf_p[utf8_buf_size - 1] : 0;
612-
lit_utf8_byte_t byte2 = (utf8_buf_size > 1) ? utf8_buf_p[utf8_buf_size - 2] : 0;
611+
lit_utf8_byte_t byte1 = (utf8_buf_size > 0) ? utf8_buf_p[utf8_buf_size - 1] : (lit_utf8_byte_t) 0;
612+
lit_utf8_byte_t byte2 = (utf8_buf_size > 1) ? utf8_buf_p[utf8_buf_size - 2] : (lit_utf8_byte_t) 0;
613613

614614
uint32_t t1 = (uint32_t) byte1 + (uint32_t) byte2;
615615
uint32_t t2 = t1 * 0x24418b66;

0 commit comments

Comments
 (0)