Skip to content

Commit cff255d

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

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ $(JERRY_LINUX_TARGETS): $(BUILD_DIR)/native
185185
@ [ "$(STATIC_CHECK)" = "OFF" ] || $(MAKE) -C $(BUILD_DIR)/native VERBOSE=1 cppcheck.$@ &>$(OUT_DIR)/$@/cppcheck.log || \
186186
(echo "cppcheck run failed. See $(OUT_DIR)/$@/cppcheck.log for details."; exit 1;)
187187
@ $(MAKE) -C $(BUILD_DIR)/native VERBOSE=1 $@ &>$(OUT_DIR)/$@/make.log || \
188-
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; exit 1;)
188+
(echo "Build failed. See $(OUT_DIR)/$@/make.log for details."; \
189+
grep "Error" -B3 $(OUT_DIR)/$@/make.log | grep "error:" ;exit 1;)
189190
@ cp $(BUILD_DIR)/native/$@ $(OUT_DIR)/$@/jerry
190191

191192
unittests: $(BUILD_DIR)/native

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)