From b5762b1ccb61e5d20084d54590fb4e517b56771a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Mon, 3 Feb 2025 10:36:25 +0100 Subject: [PATCH] Removed unneded macro --- quickjs.c | 6 +++--- quickjs.h | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/quickjs.c b/quickjs.c index 89bc1c56c..b2e4dfbb3 100644 --- a/quickjs.c +++ b/quickjs.c @@ -10814,7 +10814,7 @@ static __exception int __JS_ToFloat64Free(JSContext *ctx, double *pres, val = JS_ToNumberFree(ctx, val); if (JS_IsException(val)) { - *pres = JS_FLOAT64_NAN; + *pres = NAN; return -1; } tag = JS_VALUE_GET_NORM_TAG(val); @@ -12208,7 +12208,7 @@ static double js_math_pow(double a, double b) { if (unlikely(!isfinite(b)) && fabs(a) == 1) { /* not compatible with IEEE 754 */ - return JS_FLOAT64_NAN; + return NAN; } else { return pow(a, b); } @@ -47273,7 +47273,7 @@ static uint32_t map_hash_key(JSContext *ctx, JSValue key) d = JS_VALUE_GET_FLOAT64(key); /* normalize the NaN */ if (isnan(d)) - d = JS_FLOAT64_NAN; + d = NAN; hash_float64: u.d = d; h = (u.u32[0] ^ u.u32[1]) * 3163; diff --git a/quickjs.h b/quickjs.h index 9668abf71..d4d47ccba 100644 --- a/quickjs.h +++ b/quickjs.h @@ -104,7 +104,6 @@ enum { /* any larger tag is FLOAT64 if JS_NAN_BOXING */ }; -#define JS_FLOAT64_NAN NAN #define JSValueConst JSValue /* For backwards compatibility. */ #if defined(JS_NAN_BOXING) && JS_NAN_BOXING @@ -210,7 +209,7 @@ static inline JSValue JS_MKVAL(int64_t tag, int32_t int32) static inline JSValue JS_MKNAN(void) { JSValue v; - v.u.float64 = JS_FLOAT64_NAN; + v.u.float64 = NAN; v.tag = JS_TAG_FLOAT64; return v; } @@ -221,7 +220,7 @@ static inline JSValue JS_MKNAN(void) #else #define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag } #define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag } -#define JS_NAN (JSValue){ (JSValueUnion){ .float64 = JS_FLOAT64_NAN }, JS_TAG_FLOAT64 } +#define JS_NAN (JSValue){ (JSValueUnion){ .float64 = NAN }, JS_TAG_FLOAT64 } #endif #define JS_TAG_IS_FLOAT64(tag) ((unsigned)(tag) == JS_TAG_FLOAT64) @@ -813,7 +812,7 @@ JS_EXTERN bool JS_DetectModule(const char *input, size_t input_len); /* 'input' must be zero terminated i.e. input[input_len] = '\0'. */ JS_EXTERN JSValue JS_Eval(JSContext *ctx, const char *input, size_t input_len, const char *filename, int eval_flags); -JS_EXTERN JSValue JS_Eval2(JSContext *ctx, const char *input, size_t input_len, +JS_EXTERN JSValue JS_Eval2(JSContext *ctx, const char *input, size_t input_len, JSEvalOptions *options); JS_EXTERN JSValue JS_EvalThis(JSContext *ctx, JSValue this_obj, const char *input, size_t input_len,