Skip to content

Commit 31b163b

Browse files
committed
Fix build for GCC 4.7.
JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin [email protected]
1 parent 146ac15 commit 31b163b

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

build/configs/toolchain_linux_armv7l-el.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ set(CMAKE_SYSTEM_PROCESSOR armv7l-el)
1717

1818
set(CMAKE_C_COMPILER arm-linux-gnueabi-gcc)
1919
set(CMAKE_CXX_COMPILER arm-linux-gnueabi-g++)
20+
# FIXME: This could break cross compilation, when the strip is not for the target architecture
21+
find_program(CMAKE_STRIP NAMES arm-linux-gnueabi-strip arm-linux-gnueabi-strip strip)
2022

2123
set(FLAGS_COMMON_ARCH -mlittle-endian -mthumb)

build/configs/toolchain_linux_armv7l-hf.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ set(CMAKE_SYSTEM_PROCESSOR armv7l-hf)
1717

1818
set(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
1919
set(CMAKE_CXX_COMPILER arm-linux-gnueabihf-g++)
20-
20+
# FIXME: This could break cross compilation, when the strip is not for the target architecture
21+
find_program(CMAKE_STRIP NAMES arm-linux-gnueabihf-strip arm-linux-gnueabihf-strip strip)
2122
#
2223
# Limit fpu to VFPv3 with d0-d15 registers
2324
#

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)