Skip to content

Commit 7e5d085

Browse files
authored
Removed unneeded macro (#880)
1 parent 55bb8be commit 7e5d085

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

quickjs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10814,7 +10814,7 @@ static __exception int __JS_ToFloat64Free(JSContext *ctx, double *pres,
1081410814

1081510815
val = JS_ToNumberFree(ctx, val);
1081610816
if (JS_IsException(val)) {
10817-
*pres = JS_FLOAT64_NAN;
10817+
*pres = NAN;
1081810818
return -1;
1081910819
}
1082010820
tag = JS_VALUE_GET_NORM_TAG(val);
@@ -12208,7 +12208,7 @@ static double js_math_pow(double a, double b)
1220812208
{
1220912209
if (unlikely(!isfinite(b)) && fabs(a) == 1) {
1221012210
/* not compatible with IEEE 754 */
12211-
return JS_FLOAT64_NAN;
12211+
return NAN;
1221212212
} else {
1221312213
return pow(a, b);
1221412214
}
@@ -47273,7 +47273,7 @@ static uint32_t map_hash_key(JSContext *ctx, JSValue key)
4727347273
d = JS_VALUE_GET_FLOAT64(key);
4727447274
/* normalize the NaN */
4727547275
if (isnan(d))
47276-
d = JS_FLOAT64_NAN;
47276+
d = NAN;
4727747277
hash_float64:
4727847278
u.d = d;
4727947279
h = (u.u32[0] ^ u.u32[1]) * 3163;

quickjs.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,6 @@ enum {
104104
/* any larger tag is FLOAT64 if JS_NAN_BOXING */
105105
};
106106

107-
#define JS_FLOAT64_NAN NAN
108107
#define JSValueConst JSValue /* For backwards compatibility. */
109108

110109
#if defined(JS_NAN_BOXING) && JS_NAN_BOXING
@@ -210,7 +209,7 @@ static inline JSValue JS_MKVAL(int64_t tag, int32_t int32)
210209
static inline JSValue JS_MKNAN(void)
211210
{
212211
JSValue v;
213-
v.u.float64 = JS_FLOAT64_NAN;
212+
v.u.float64 = NAN;
214213
v.tag = JS_TAG_FLOAT64;
215214
return v;
216215
}
@@ -221,7 +220,7 @@ static inline JSValue JS_MKNAN(void)
221220
#else
222221
#define JS_MKPTR(tag, p) (JSValue){ (JSValueUnion){ .ptr = p }, tag }
223222
#define JS_MKVAL(tag, val) (JSValue){ (JSValueUnion){ .int32 = val }, tag }
224-
#define JS_NAN (JSValue){ (JSValueUnion){ .float64 = JS_FLOAT64_NAN }, JS_TAG_FLOAT64 }
223+
#define JS_NAN (JSValue){ (JSValueUnion){ .float64 = NAN }, JS_TAG_FLOAT64 }
225224
#endif
226225

227226
#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);
813812
/* 'input' must be zero terminated i.e. input[input_len] = '\0'. */
814813
JS_EXTERN JSValue JS_Eval(JSContext *ctx, const char *input, size_t input_len,
815814
const char *filename, int eval_flags);
816-
JS_EXTERN JSValue JS_Eval2(JSContext *ctx, const char *input, size_t input_len,
815+
JS_EXTERN JSValue JS_Eval2(JSContext *ctx, const char *input, size_t input_len,
817816
JSEvalOptions *options);
818817
JS_EXTERN JSValue JS_EvalThis(JSContext *ctx, JSValue this_obj,
819818
const char *input, size_t input_len,

0 commit comments

Comments
 (0)