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:
Daniel Balla
2019-01-09 08:22:47 +00:00
committed by Zoltan Herczeg
parent 99b968de3c
commit 3ee771655f
4 changed files with 15 additions and 14 deletions
+1 -1
View File
@@ -26,7 +26,7 @@ main (void)
jerry_value_t global_obj_val = jerry_get_global_object ();
jerry_char_t pattern[] = "[^.]+";
jerry_regexp_flags_t flags = JERRY_REGEXP_FLAG_GLOBAL | JERRY_REGEXP_FLAG_MULTILINE;
uint16_t flags = JERRY_REGEXP_FLAG_GLOBAL | JERRY_REGEXP_FLAG_MULTILINE;
jerry_value_t regex_obj = jerry_create_regexp (pattern, flags);
TEST_ASSERT (jerry_value_is_object (regex_obj));