Fix JerryScript build with clang-6.0 (#2610)
This patch fixes the following error with Clang-6.0
```
jerryscript/jerry-core/api/jerry.c:1527:71: error: implicit conversion loses integer precision:
'jerry_regexp_flags_t' to 'uint16_t' (aka 'unsigned short') [-Werror,-Wconversion]
jerry_value_t ret_val = ecma_op_create_regexp_object (ecma_pattern, flags);
```
Also change the `jerry_create_regexp` and `jerry_create_regexp_sz` functions' `flags` parameter to `uint16_t` since the values created with `bitwise inclusive OR` are not part of the enum.
JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
This commit is contained in:
committed by
Zoltan Herczeg
parent
99b968de3c
commit
3ee771655f
@@ -1500,7 +1500,7 @@ jerry_create_string_sz (const jerry_char_t *str_p, /**< pointer to string */
|
||||
*/
|
||||
jerry_value_t
|
||||
jerry_create_regexp (const jerry_char_t *pattern_p, /**< zero-terminated UTF-8 string as RegExp pattern */
|
||||
jerry_regexp_flags_t flags) /**< optional RegExp flags */
|
||||
uint16_t flags) /**< optional RegExp flags */
|
||||
{
|
||||
return jerry_create_regexp_sz (pattern_p, lit_zt_utf8_string_size (pattern_p), flags);
|
||||
} /* jerry_create_regexp */
|
||||
@@ -1513,7 +1513,7 @@ jerry_create_regexp (const jerry_char_t *pattern_p, /**< zero-terminated UTF-8 s
|
||||
jerry_value_t
|
||||
jerry_create_regexp_sz (const jerry_char_t *pattern_p, /**< zero-terminated UTF-8 string as RegExp pattern */
|
||||
jerry_size_t pattern_size, /**< length of the pattern */
|
||||
jerry_regexp_flags_t flags) /**< optional RegExp flags */
|
||||
uint16_t flags) /**< optional RegExp flags */
|
||||
{
|
||||
jerry_assert_api_available ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user