Skip to content

Fix build for GCC 4.7. #291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 2, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jerry-core/ecma/base/ecma-helpers-string.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@ ecma_string_get_length (const ecma_string_t *string_p) /**< ecma-string */
else if (container == ECMA_STRING_CONTAINER_UINT32_IN_DESC)
{
const uint32_t uint32_number = string_p->u.uint32_number;
const int32_t max_uint32_len = 10;
const uint32_t max_uint32_len = 10;
const uint32_t nums_with_ascending_length[10] =
{
1u,
Expand Down
12 changes: 6 additions & 6 deletions jerry-core/lit/lit-strings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,13 +375,13 @@ 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_size_t byte1 = utf8_buf_size > 0 ? utf8_buf_p[utf8_buf_size - 1] : (lit_utf8_size_t) 0;
lit_utf8_size_t byte2 = utf8_buf_size > 1 ? utf8_buf_p[utf8_buf_size - 2] : (lit_utf8_size_t) 0;

uint32_t t1 = (uint32_t) byte1 + (uint32_t) byte2;
uint32_t t2 = t1 * 0x24418b66;
uint32_t t3 = (t2 >> 16) ^ (t2 & 0xffffu);
uint32_t t4 = (t3 >> 8) ^ (t3 & 0xffu);
lit_utf8_size_t t1 = byte1 + byte2;
lit_utf8_size_t t2 = t1 * 0x24418b66;
lit_utf8_size_t t3 = (t2 >> 16) ^ (t2 & 0xffffu);
lit_utf8_size_t t4 = (t3 >> 8) ^ (t3 & 0xffu);

return (lit_string_hash_t) t4;
} /* lit_utf8_string_calc_hash_last_bytes */
Expand Down
4 changes: 3 additions & 1 deletion jerry-core/parser/regexp/re-parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
#ifndef CONFIG_ECMA_COMPACT_PROFILE_DISABLE_REGEXP_BUILTIN

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

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