Compare commits
4 Commits
master
...
float32-fix
| Author | SHA1 | Date | |
|---|---|---|---|
| 6c9fe8ab5b | |||
| 0ed67e6a53 | |||
| 5cced37f43 | |||
| 1160fd543e |
@@ -2247,7 +2247,7 @@ jerry_value_as_integer (const jerry_value_t value) /**< input value */
|
||||
return 0;
|
||||
}
|
||||
|
||||
double number = ecma_get_number_from_value (value);
|
||||
ecma_number_t number = ecma_get_number_from_value (value);
|
||||
|
||||
if (ecma_number_is_nan (number))
|
||||
{
|
||||
|
||||
@@ -333,7 +333,7 @@ ecma_utf8_string_to_number_by_radix (const lit_utf8_byte_t *str_p, /**< utf-8 st
|
||||
return ecma_number_make_nan ();
|
||||
}
|
||||
|
||||
num = num * radix + value;
|
||||
num = num * (ecma_number_t) radix + (ecma_number_t) value;
|
||||
}
|
||||
|
||||
return num;
|
||||
@@ -630,7 +630,10 @@ ecma_utf8_string_to_number (const lit_utf8_byte_t *str_p, /**< utf-8 string */
|
||||
return ecma_number_create (sign, (uint32_t) binary_exponent, significand);
|
||||
#elif !JERRY_NUMBER_TYPE_FLOAT64
|
||||
/* Less precise conversion */
|
||||
ecma_number_t num = (ecma_number_t) (uint32_t) fraction_uint64;
|
||||
ecma_number_t num = (ecma_number_t) (uint32_t) significand;
|
||||
|
||||
bool e_sign = decimal_exponent < 0;
|
||||
int32_t e = e_sign ? -decimal_exponent : decimal_exponent;
|
||||
|
||||
ecma_number_t m = e_sign ? (ecma_number_t) 0.1 : (ecma_number_t) 10.0;
|
||||
|
||||
@@ -645,7 +648,7 @@ ecma_utf8_string_to_number (const lit_utf8_byte_t *str_p, /**< utf-8 string */
|
||||
e /= 2;
|
||||
}
|
||||
|
||||
return num;
|
||||
return sign ? -num : num;
|
||||
#endif /* JERRY_NUMBER_TYPE_FLOAT64 */
|
||||
} /* ecma_utf8_string_to_number */
|
||||
|
||||
@@ -707,7 +710,7 @@ ecma_number_to_uint32 (ecma_number_t num) /**< ecma-number */
|
||||
/* 2 ^ 32 */
|
||||
const uint64_t uint64_2_pow_32 = (1ull << 32);
|
||||
|
||||
const ecma_number_t num_2_pow_32 = (float) uint64_2_pow_32;
|
||||
const ecma_number_t num_2_pow_32 = (ecma_number_t) uint64_2_pow_32;
|
||||
|
||||
ecma_number_t num_in_uint32_range;
|
||||
|
||||
@@ -809,7 +812,48 @@ ecma_number_to_decimal (ecma_number_t num, /**< ecma-number */
|
||||
JERRY_ASSERT (!ecma_number_is_infinity (num));
|
||||
JERRY_ASSERT (!ecma_number_is_negative (num));
|
||||
|
||||
#if JERRY_NUMBER_TYPE_FLOAT64
|
||||
return ecma_errol0_dtoa ((double) num, out_digits_p, out_decimal_exp_p);
|
||||
#else /* !JERRY_NUMBER_TYPE_FLOAT64 */
|
||||
/* Float32: snprintf with ECMA_NUMBER_MAX_DIGITS significant digits guarantees round-trip.
|
||||
* Using %e gives "D.DDDDDDDDe±EEE" which we parse into digits + decimal exponent. */
|
||||
char buf[ECMA_NUMBER_MAX_DIGITS + 16];
|
||||
snprintf (buf, sizeof (buf), "%.*e", ECMA_NUMBER_MAX_DIGITS - 1, (double) num);
|
||||
|
||||
char *p = buf;
|
||||
lit_utf8_byte_t *out_p = out_digits_p;
|
||||
int32_t k = 0;
|
||||
|
||||
*out_p++ = (lit_utf8_byte_t) *p++; /* first significant digit */
|
||||
k++;
|
||||
p++; /* skip '.' */
|
||||
|
||||
while (*p != 'e' && *p != 'E')
|
||||
{
|
||||
*out_p++ = (lit_utf8_byte_t) *p++;
|
||||
k++;
|
||||
}
|
||||
|
||||
/* strip trailing zeros */
|
||||
while (k > 1 && out_digits_p[k - 1] == '0')
|
||||
{
|
||||
k--;
|
||||
}
|
||||
|
||||
p++; /* skip 'e' */
|
||||
int32_t exp_sign = (*p == '-') ? -1 : 1;
|
||||
p++; /* skip sign */
|
||||
int32_t exponent = 0;
|
||||
while (*p)
|
||||
{
|
||||
exponent = exponent * 10 + (*p++ - '0');
|
||||
}
|
||||
|
||||
/* decimal exponent convention: n=1 means first digit is units, n=0 means "0.d..." */
|
||||
*out_decimal_exp_p = exp_sign * exponent + 1;
|
||||
|
||||
return (lit_utf8_size_t) k;
|
||||
#endif /* JERRY_NUMBER_TYPE_FLOAT64 */
|
||||
} /* ecma_number_to_decimal */
|
||||
|
||||
/**
|
||||
|
||||
@@ -117,7 +117,7 @@ ecma_number_create (bool sign, /**< sign */
|
||||
ecma_binary_num_t binary = biased_exp;
|
||||
binary <<= ECMA_NUMBER_FRACTION_WIDTH;
|
||||
|
||||
binary |= fraction;
|
||||
binary |= (ecma_binary_num_t) fraction;
|
||||
|
||||
if (sign)
|
||||
{
|
||||
@@ -259,7 +259,11 @@ ecma_number_t JERRY_ATTR_CONST
|
||||
ecma_number_get_prev (ecma_number_t num) /**< ecma-number */
|
||||
{
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#if JERRY_NUMBER_TYPE_FLOAT64
|
||||
return __builtin_nextafter (num, -INFINITY);
|
||||
#else /* !JERRY_NUMBER_TYPE_FLOAT64 */
|
||||
return __builtin_nextafterf (num, -INFINITY);
|
||||
#endif /* JERRY_NUMBER_TYPE_FLOAT64 */
|
||||
#else /* !defined (__GNUC__) && !defined (__clang__) */
|
||||
JERRY_ASSERT (!ecma_number_is_nan (num));
|
||||
ecma_binary_num_t binary = ecma_number_to_binary (num);
|
||||
@@ -294,7 +298,11 @@ ecma_number_t JERRY_ATTR_CONST
|
||||
ecma_number_get_next (ecma_number_t num) /**< ecma-number */
|
||||
{
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
#if JERRY_NUMBER_TYPE_FLOAT64
|
||||
return __builtin_nextafter (num, INFINITY);
|
||||
#else /* !JERRY_NUMBER_TYPE_FLOAT64 */
|
||||
return __builtin_nextafterf (num, INFINITY);
|
||||
#endif /* JERRY_NUMBER_TYPE_FLOAT64 */
|
||||
#else /* !defined (__GNUC__) && !defined (__clang__) */
|
||||
JERRY_ASSERT (!ecma_number_is_nan (num));
|
||||
ecma_binary_num_t binary = ecma_number_to_binary (num);
|
||||
@@ -345,7 +353,7 @@ ecma_number_trunc (ecma_number_t num) /**< ecma-number */
|
||||
return num;
|
||||
}
|
||||
|
||||
binary &= ~((1ull << (ECMA_NUMBER_FRACTION_WIDTH - unbiased_exp)) - 1);
|
||||
binary &= ~(((ecma_binary_num_t) 1 << (ECMA_NUMBER_FRACTION_WIDTH - unbiased_exp)) - 1);
|
||||
return ecma_number_from_binary (binary);
|
||||
} /* ecma_number_trunc */
|
||||
|
||||
@@ -542,8 +550,8 @@ ecma_number_parse_int (const lit_utf8_byte_t *str_p, /**< routine's first argume
|
||||
break;
|
||||
}
|
||||
|
||||
value *= radix;
|
||||
value += digit;
|
||||
value *= (ecma_number_t) radix;
|
||||
value += (ecma_number_t) digit;
|
||||
|
||||
str_p++;
|
||||
}
|
||||
|
||||
@@ -103,7 +103,7 @@ ecma_number_t ecma_number_create (bool sign, uint32_t biased_exp, uint64_t fract
|
||||
#if JERRY_NUMBER_TYPE_FLOAT64
|
||||
#define ECMA_NUMBER_SIGN_BIT 0x8000000000000000ull
|
||||
#else /* !JERRY_NUMBER_TYPE_FLOAT64 */
|
||||
#define ECMA_NUMBER_SIGN_BIT 0x7f800000u;
|
||||
#define ECMA_NUMBER_SIGN_BIT 0x80000000u
|
||||
#endif /* !JERRY_NUMBER_TYPE_FLOAT64 */
|
||||
|
||||
/**
|
||||
|
||||
@@ -102,13 +102,13 @@ ecma_convert_number_to_typed_array_type (ecma_number_t num, /**< ecma_number arg
|
||||
}
|
||||
case ECMA_INT32_ARRAY:
|
||||
{
|
||||
return ecma_make_number_value ((int32_t) value);
|
||||
return ecma_make_number_value ((ecma_number_t) (int32_t) value);
|
||||
}
|
||||
default:
|
||||
{
|
||||
JERRY_ASSERT (element_type == ECMA_UINT32_ARRAY);
|
||||
|
||||
return ecma_make_number_value (value);
|
||||
return ecma_make_number_value ((ecma_number_t) value);
|
||||
}
|
||||
}
|
||||
} /* ecma_convert_number_to_typed_array_type */
|
||||
|
||||
@@ -36,12 +36,12 @@
|
||||
/**
|
||||
* Day names
|
||||
*/
|
||||
const char day_names_p[7][3] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
|
||||
const char day_names_p[7][4] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
|
||||
|
||||
/**
|
||||
* Month names
|
||||
*/
|
||||
const char month_names_p[12][3] = {
|
||||
const char month_names_p[12][4] = {
|
||||
"Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
|
||||
};
|
||||
|
||||
|
||||
@@ -489,7 +489,7 @@ ecma_builtin_helper_string_find_last_index (ecma_string_t *original_str_p, /**<
|
||||
const lit_utf8_byte_t *end_p = original_str_utf8_p + original_str_size;
|
||||
const lit_utf8_byte_t *current_p = end_p;
|
||||
|
||||
for (ecma_number_t i = original_length; i > position; i--)
|
||||
for (ecma_number_t i = (ecma_number_t) original_length; i > position; i--)
|
||||
{
|
||||
lit_utf8_decr (¤t_p);
|
||||
}
|
||||
|
||||
@@ -175,8 +175,8 @@ typedef enum
|
||||
} ecma_date_timezone_t;
|
||||
|
||||
/* ecma-builtin-helpers-date.c */
|
||||
extern const char day_names_p[7][3];
|
||||
extern const char month_names_p[12][3];
|
||||
extern const char day_names_p[7][4];
|
||||
extern const char month_names_p[12][4];
|
||||
|
||||
int32_t ecma_date_day_from_time (ecma_number_t time);
|
||||
int32_t ecma_date_year_from_time (ecma_number_t time);
|
||||
|
||||
@@ -207,7 +207,7 @@ ecma_builtin_math_object_hypot (const ecma_value_t *arg, /**< arguments list */
|
||||
result_num += arg_num * arg_num;
|
||||
}
|
||||
|
||||
return ecma_make_number_value (sqrt (result_num));
|
||||
return ecma_make_number_value ((ecma_number_t) sqrt (result_num));
|
||||
} /* ecma_builtin_math_object_hypot */
|
||||
|
||||
/**
|
||||
@@ -236,7 +236,7 @@ ecma_builtin_math_object_trunc (ecma_number_t arg)
|
||||
return (ecma_number_t) -0.0;
|
||||
}
|
||||
|
||||
return (ecma_number_t) arg - fmod (arg, 1);
|
||||
return (ecma_number_t) arg - (ecma_number_t) fmod (arg, 1);
|
||||
} /* ecma_builtin_math_object_trunc */
|
||||
|
||||
/**
|
||||
@@ -392,7 +392,7 @@ ecma_builtin_math_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wi
|
||||
break;
|
||||
}
|
||||
|
||||
ecma_number_t fraction = fmod (x, ECMA_NUMBER_ONE);
|
||||
ecma_number_t fraction = (ecma_number_t) fmod (x, ECMA_NUMBER_ONE);
|
||||
|
||||
if (ecma_number_is_zero (fraction))
|
||||
{
|
||||
@@ -504,7 +504,7 @@ ecma_builtin_math_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wi
|
||||
{
|
||||
uint32_t n = ecma_number_to_uint32 (x);
|
||||
#if defined(__GNUC__) || defined(__clang__)
|
||||
x = n ? __builtin_clz (n) : 32;
|
||||
x = (ecma_number_t) (n ? __builtin_clz (n) : 32);
|
||||
#elif defined(_WIN32)
|
||||
unsigned long ret;
|
||||
x = _BitScanReverse (&ret, n) ? 31 - ret : 32;
|
||||
@@ -528,7 +528,7 @@ ecma_builtin_math_dispatch_routine (uint8_t builtin_routine_id, /**< built-in wi
|
||||
}
|
||||
case ECMA_MATH_OBJECT_IMUL:
|
||||
{
|
||||
x = (int32_t) (ecma_number_to_uint32 (x) * ecma_number_to_uint32 (y));
|
||||
x = (ecma_number_t) (int32_t) (ecma_number_to_uint32 (x) * ecma_number_to_uint32 (y));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ ecma_builtin_number_prototype_object_to_string (ecma_number_t this_arg_number, /
|
||||
is_number_negative = true;
|
||||
}
|
||||
|
||||
ecma_number_t integer_part = floor (this_arg_number);
|
||||
ecma_number_t integer_part = (ecma_number_t) floor (this_arg_number);
|
||||
ecma_number_t fraction_part = this_arg_number - integer_part;
|
||||
|
||||
uint8_t *integer_cursor_p = integer_digits + NUMBER_TO_STRING_MAX_DIGIT_COUNT;
|
||||
@@ -208,8 +208,8 @@ ecma_builtin_number_prototype_object_to_string (ecma_number_t this_arg_number, /
|
||||
|
||||
do
|
||||
{
|
||||
fraction_part *= radix;
|
||||
precision *= radix;
|
||||
fraction_part *= (ecma_number_t) radix;
|
||||
precision *= (ecma_number_t) radix;
|
||||
|
||||
digit = (uint8_t) floor (fraction_part);
|
||||
|
||||
@@ -255,11 +255,11 @@ ecma_builtin_number_prototype_object_to_string (ecma_number_t this_arg_number, /
|
||||
}
|
||||
}
|
||||
|
||||
while (ecma_number_biased_exp (ecma_number_to_binary (integer_part / radix))
|
||||
while (ecma_number_biased_exp (ecma_number_to_binary (integer_part / (ecma_number_t) radix))
|
||||
> ECMA_NUMBER_EXPONENT_BIAS + ECMA_NUMBER_FRACTION_WIDTH)
|
||||
{
|
||||
integer_zeros++;
|
||||
integer_part /= radix;
|
||||
integer_part /= (ecma_number_t) radix;
|
||||
}
|
||||
|
||||
uint64_t integer_u64 = (uint64_t) integer_part;
|
||||
|
||||
@@ -1060,7 +1060,7 @@ ecma_builtin_string_prototype_object_substring (ecma_string_t *original_string_p
|
||||
}
|
||||
|
||||
/* 6 */
|
||||
start = (uint32_t) JERRY_MIN (JERRY_MAX (start_num, 0), len);
|
||||
start = (uint32_t) JERRY_MIN (JERRY_MAX (start_num, (ecma_number_t) 0), (ecma_number_t) len);
|
||||
|
||||
/* 5 */
|
||||
if (ecma_is_value_undefined (arg2))
|
||||
@@ -1077,7 +1077,7 @@ ecma_builtin_string_prototype_object_substring (ecma_string_t *original_string_p
|
||||
return ECMA_VALUE_ERROR;
|
||||
}
|
||||
/* 7 */
|
||||
end = (uint32_t) JERRY_MIN (JERRY_MAX (end_num, 0), len);
|
||||
end = (uint32_t) JERRY_MIN (JERRY_MAX (end_num, (ecma_number_t) 0), (ecma_number_t) len);
|
||||
}
|
||||
|
||||
JERRY_ASSERT (start <= len && end <= len);
|
||||
@@ -1321,7 +1321,7 @@ ecma_builtin_string_prototype_object_substr (ecma_string_t *this_string_p, /**<
|
||||
lit_utf8_size_t this_len = ecma_string_get_length (this_string_p);
|
||||
|
||||
/* 5. */
|
||||
uint32_t from = (uint32_t) ((start_num < 0) ? JERRY_MAX (this_len + start_num, 0) : start_num);
|
||||
uint32_t from = (uint32_t) ((start_num < 0) ? JERRY_MAX ((ecma_number_t) this_len + start_num, (ecma_number_t) 0) : start_num);
|
||||
|
||||
if (from > this_len)
|
||||
{
|
||||
@@ -1329,7 +1329,7 @@ ecma_builtin_string_prototype_object_substr (ecma_string_t *this_string_p, /**<
|
||||
}
|
||||
|
||||
/* 6. */
|
||||
ecma_number_t to_num = JERRY_MIN (JERRY_MAX (length_num, 0), this_len - from);
|
||||
ecma_number_t to_num = JERRY_MIN (JERRY_MAX (length_num, (ecma_number_t) 0), (ecma_number_t) (this_len - from));
|
||||
|
||||
/* 7. */
|
||||
uint32_t to = from + (uint32_t) to_num;
|
||||
|
||||
@@ -234,7 +234,7 @@ ecma_builtin_typedarray_prototype_map (ecma_value_t this_arg, /**< this object *
|
||||
}
|
||||
|
||||
// TODO: 22.2.3.18, 7-8.
|
||||
ecma_value_t len = ecma_make_number_value (src_info_p->length);
|
||||
ecma_value_t len = ecma_make_number_value ((ecma_number_t) src_info_p->length);
|
||||
ecma_value_t new_typedarray = ecma_typedarray_species_create (this_arg, &len, 1);
|
||||
ecma_free_value (len);
|
||||
|
||||
@@ -500,7 +500,7 @@ ecma_builtin_typedarray_prototype_filter (ecma_value_t this_arg, /**< this objec
|
||||
ecma_fast_free_value (call_value);
|
||||
}
|
||||
|
||||
ecma_value_t collected = ecma_make_number_value (collected_p->item_count);
|
||||
ecma_value_t collected = ecma_make_number_value ((ecma_number_t) collected_p->item_count);
|
||||
ret_value = ecma_typedarray_species_create (this_arg, &collected, 1);
|
||||
ecma_free_value (collected);
|
||||
|
||||
@@ -1141,14 +1141,14 @@ ecma_builtin_typedarray_prototype_sort_compare_helper (ecma_value_t lhs, /**< le
|
||||
#if JERRY_BUILTIN_BIGINT
|
||||
if (ecma_is_value_bigint (lhs) && ecma_is_value_bigint (rhs))
|
||||
{
|
||||
return ecma_make_number_value (ecma_bigint_compare_to_bigint (lhs, rhs));
|
||||
return ecma_make_number_value ((ecma_number_t) ecma_bigint_compare_to_bigint (lhs, rhs));
|
||||
}
|
||||
#endif /* JERRY_BUILTIN_BIGINT */
|
||||
|
||||
ecma_number_t result = ECMA_NUMBER_ZERO;
|
||||
|
||||
double lhs_value = (double) ecma_get_number_from_value (lhs);
|
||||
double rhs_value = (double) ecma_get_number_from_value (rhs);
|
||||
ecma_number_t lhs_value = ecma_get_number_from_value (lhs);
|
||||
ecma_number_t rhs_value = ecma_get_number_from_value (rhs);
|
||||
|
||||
if (ecma_number_is_nan (lhs_value))
|
||||
{
|
||||
@@ -1482,7 +1482,7 @@ ecma_builtin_typedarray_prototype_index_of (ecma_typedarray_info_t *info_p, /**<
|
||||
if (ecma_op_same_value_zero (args[0], element, true))
|
||||
{
|
||||
ecma_free_value (element);
|
||||
return ecma_make_number_value (from_index);
|
||||
return ecma_make_number_value ((ecma_number_t) from_index);
|
||||
}
|
||||
|
||||
ecma_free_value (element);
|
||||
@@ -1545,7 +1545,7 @@ ecma_builtin_typedarray_prototype_last_index_of (ecma_typedarray_info_t *info_p,
|
||||
return ECMA_VALUE_ERROR;
|
||||
}
|
||||
|
||||
if (info_p->length + to_int < 0)
|
||||
if ((ecma_number_t) info_p->length + to_int < 0)
|
||||
{
|
||||
return ecma_make_integer_value (-1);
|
||||
}
|
||||
@@ -1690,7 +1690,7 @@ ecma_builtin_typedarray_prototype_slice (ecma_value_t this_arg, /**< this argume
|
||||
int32_t distance = (int32_t) (relative_end - relative_start);
|
||||
uint32_t count = distance > 0 ? (uint32_t) distance : 0;
|
||||
|
||||
ecma_value_t len = ecma_make_number_value (count);
|
||||
ecma_value_t len = ecma_make_number_value ((ecma_number_t) count);
|
||||
// TODO: 22.2.3.23, 12-13.
|
||||
ecma_value_t new_typedarray = ecma_typedarray_species_create (this_arg, &len, 1);
|
||||
ecma_free_value (len);
|
||||
|
||||
@@ -88,7 +88,7 @@ ecma_op_dataview_create (const ecma_value_t *arguments_list_p, /**< arguments li
|
||||
}
|
||||
|
||||
/* 5. */
|
||||
ecma_number_t buffer_byte_length = ecma_arraybuffer_get_length (buffer_p);
|
||||
ecma_number_t buffer_byte_length = (ecma_number_t) ecma_arraybuffer_get_length (buffer_p);
|
||||
|
||||
/* 6. */
|
||||
if (offset > buffer_byte_length)
|
||||
|
||||
@@ -2082,7 +2082,7 @@ ecma_op_bound_function_try_to_lazy_instantiate_property (ecma_object_t *object_p
|
||||
}
|
||||
|
||||
length_attributes = ECMA_PROPERTY_BUILT_IN_CONFIGURABLE;
|
||||
length = ecma_get_number_from_value (bound_func_p->target_length) - (args_length - 1);
|
||||
length = ecma_get_number_from_value (bound_func_p->target_length) - (ecma_number_t) (args_length - 1);
|
||||
|
||||
if (length < 0)
|
||||
{
|
||||
|
||||
@@ -2694,7 +2694,9 @@ ecma_object_check_class_name_is_object (ecma_object_t *obj_p) /**< object */
|
||||
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_AGGREGATE_ERROR_PROTOTYPE)
|
||||
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_URI_ERROR_PROTOTYPE)
|
||||
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_ERROR_PROTOTYPE)
|
||||
#if JERRY_BUILTIN_DATE
|
||||
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_DATE_PROTOTYPE)
|
||||
#endif /* JERRY_BUILTIN_DATE */
|
||||
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_REGEXP_PROTOTYPE)
|
||||
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_SYMBOL_PROTOTYPE)
|
||||
|| ecma_builtin_is (obj_p, ECMA_BUILTIN_ID_ASYNC_FUNCTION_PROTOTYPE)
|
||||
|
||||
@@ -127,7 +127,7 @@ ecma_typedarray_get_int32_element (lit_utf8_byte_t *src) /**< the location in th
|
||||
{
|
||||
int32_t num;
|
||||
ECMA_TYPEDARRAY_GET_ELEMENT (src, num, int32_t);
|
||||
return ecma_make_number_value (num);
|
||||
return ecma_make_number_value ((ecma_number_t) num);
|
||||
} /* ecma_typedarray_get_int32_element */
|
||||
|
||||
/**
|
||||
@@ -138,7 +138,7 @@ ecma_typedarray_get_uint32_element (lit_utf8_byte_t *src) /**< the location in t
|
||||
{
|
||||
uint32_t num;
|
||||
ECMA_TYPEDARRAY_GET_ELEMENT (src, num, uint32_t);
|
||||
return ecma_make_number_value (num);
|
||||
return ecma_make_number_value ((ecma_number_t) num);
|
||||
} /* ecma_typedarray_get_uint32_element */
|
||||
|
||||
/**
|
||||
@@ -155,6 +155,7 @@ ecma_typedarray_get_float_element (lit_utf8_byte_t *src) /**< the location in th
|
||||
/**
|
||||
* Read a double value from the given arraybuffer
|
||||
*/
|
||||
#if JERRY_NUMBER_TYPE_FLOAT64
|
||||
static ecma_value_t
|
||||
ecma_typedarray_get_double_element (lit_utf8_byte_t *src) /**< the location in the internal arraybuffer */
|
||||
{
|
||||
@@ -162,6 +163,7 @@ ecma_typedarray_get_double_element (lit_utf8_byte_t *src) /**< the location in t
|
||||
ECMA_TYPEDARRAY_GET_ELEMENT (src, num, double);
|
||||
return ecma_make_number_value (num);
|
||||
} /* ecma_typedarray_get_double_element */
|
||||
#endif /* JERRY_NUMBER_TYPE_FLOAT64 */
|
||||
|
||||
#if JERRY_BUILTIN_BIGINT
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user