Skip to content

Fix LLVM/clang conversion errors #2473

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
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
12 changes: 6 additions & 6 deletions jerry-core/ecma/builtin-objects/ecma-builtins.c
Original file line number Diff line number Diff line change
Expand Up @@ -735,12 +735,12 @@ ecma_builtin_try_to_instantiate_property (ecma_object_t *object_p, /**< object *
}
case ECMA_BUILTIN_PROPERTY_STRING:
{
value = ecma_make_magic_string_value (curr_property_p->value);
value = ecma_make_magic_string_value ((lit_magic_string_id_t) curr_property_p->value);
break;
}
case ECMA_BUILTIN_PROPERTY_OBJECT:
{
value = ecma_make_object_value (ecma_builtin_get (curr_property_p->value));
value = ecma_make_object_value (ecma_builtin_get ((ecma_builtin_id_t) curr_property_p->value));
break;
}
case ECMA_BUILTIN_PROPERTY_ROUTINE:
Expand Down Expand Up @@ -878,15 +878,15 @@ ecma_builtin_list_lazy_property_names (ecma_object_t *object_p, /**< a built-in
index = 0;
}

ecma_string_t *name_p = ecma_get_magic_string (curr_property_p->magic_string_id);
ecma_string_t *name_p = ecma_get_magic_string ((lit_magic_string_id_t) curr_property_p->magic_string_id);

uint32_t bit_for_index = (uint32_t) 1u << index;

if (!(*bitset_p & bit_for_index) || ecma_op_object_has_own_property (object_p, name_p))
{
ecma_append_to_values_collection (for_non_enumerable_p,
ecma_make_magic_string_value (curr_property_p->magic_string_id),
0);
ecma_value_t name = ecma_make_magic_string_value ((lit_magic_string_id_t) curr_property_p->magic_string_id);

ecma_append_to_values_collection (for_non_enumerable_p, name, 0);
}

ecma_deref_ecma_string (name_p);
Expand Down
4 changes: 2 additions & 2 deletions jerry-core/ecma/operations/ecma-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -1775,7 +1775,7 @@ ecma_object_get_class_name (ecma_object_t *obj_p) /**< object */
case ECMA_OBJECT_TYPE_CLASS:
{
ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
return ext_object_p->u.class_prop.class_id;
return (lit_magic_string_id_t) ext_object_p->u.class_prop.class_id;
}
case ECMA_OBJECT_TYPE_PSEUDO_ARRAY:
{
Expand All @@ -1787,7 +1787,7 @@ ecma_object_get_class_name (ecma_object_t *obj_p) /**< object */
case ECMA_PSEUDO_ARRAY_TYPEDARRAY:
case ECMA_PSEUDO_ARRAY_TYPEDARRAY_WITH_INFO:
{
return ext_obj_p->u.pseudo_array.u1.class_id;
return (lit_magic_string_id_t) ext_obj_p->u.pseudo_array.u1.class_id;
}
#endif /* !CONFIG_DISABLE_ES2015_TYPEDARRAY_BUILTIN */
default:
Expand Down
2 changes: 1 addition & 1 deletion jerry-core/ecma/operations/ecma-typedarray-object.c
Original file line number Diff line number Diff line change
Expand Up @@ -916,7 +916,7 @@ ecma_op_create_typedarray_with_type_and_length (ecma_object_t *obj_p, /**< Typed
JERRY_ASSERT (ecma_is_typedarray (ecma_make_object_value (obj_p)));

ecma_extended_object_t *ext_object_p = (ecma_extended_object_t *) obj_p;
lit_magic_string_id_t class_id = ext_object_p->u.pseudo_array.u1.class_id;
lit_magic_string_id_t class_id = (lit_magic_string_id_t) ext_object_p->u.pseudo_array.u1.class_id;
ecma_object_t *proto_p;
uint8_t element_size_shift = 0;

Expand Down
4 changes: 2 additions & 2 deletions jerry-core/lit/lit-magic-strings.c
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ lit_is_utf8_string_magic (const lit_utf8_byte_t *string_p, /**< utf-8 string */
while (first < last)
{
lit_utf8_size_t middle = ((first + last) / 2); /**< mid point of search */
int compare = memcmp (lit_get_magic_string_utf8 (middle), string_p, string_size);
int compare = memcmp (lit_get_magic_string_utf8 ((lit_magic_string_id_t) middle), string_p, string_size);

if (compare == 0)
{
Expand Down Expand Up @@ -249,7 +249,7 @@ lit_is_utf8_string_pair_magic (const lit_utf8_byte_t *string1_p, /**< first utf-
while (first < last)
{
lit_utf8_size_t middle = ((first + last) / 2); /**< mid point of search */
const lit_utf8_byte_t *middle_string_p = lit_get_magic_string_utf8 (middle);
const lit_utf8_byte_t *middle_string_p = lit_get_magic_string_utf8 ((lit_magic_string_id_t) middle);

int compare = memcmp (middle_string_p, string1_p, string1_size);

Expand Down