Skip to content

Commit ecf9b1a

Browse files
committed
Move __JS_NewShortBigInt to quickjs.c and unify on int32_t
Ref: #1500
1 parent 252e3dc commit ecf9b1a

2 files changed

Lines changed: 6 additions & 21 deletions

File tree

quickjs.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1545,6 +1545,12 @@ static JSValue js_number(double d)
15451545
return js_float64(d);
15461546
}
15471547

1548+
static JSValue __JS_NewShortBigInt(JSContext *ctx, int32_t d)
1549+
{
1550+
(void)&ctx;
1551+
return JS_MKVAL(JS_TAG_SHORT_BIG_INT, d);
1552+
}
1553+
15481554
JSValue JS_NewNumber(JSContext *ctx, double d)
15491555
{
15501556
return js_number(d);

quickjs.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -224,12 +224,6 @@ static inline JSValue __JS_NewFloat64(double d)
224224
return JS_MKVAL(JS_TAG_FLOAT64, (int)d);
225225
}
226226

227-
static inline JSValue __JS_NewShortBigInt(JSContext *ctx, int32_t d)
228-
{
229-
(void)&ctx;
230-
return JS_MKVAL(JS_TAG_SHORT_BIG_INT, d);
231-
}
232-
233227
static inline bool JS_VALUE_IS_NAN(JSValue v)
234228
{
235229
(void)&v;
@@ -280,12 +274,6 @@ static inline JSValue __JS_NewFloat64(double d)
280274
return v;
281275
}
282276

283-
static inline JSValue __JS_NewShortBigInt(JSContext *ctx, int32_t d)
284-
{
285-
(void)&ctx;
286-
return JS_MKVAL(JS_TAG_SHORT_BIG_INT, d);
287-
}
288-
289277
#define JS_TAG_IS_FLOAT64(tag) ((unsigned)((tag) - JS_TAG_FIRST) >= (JS_TAG_FLOAT64 - JS_TAG_FIRST))
290278

291279
/* same as JS_VALUE_GET_TAG, but return JS_TAG_FLOAT64 with NaN boxing */
@@ -372,15 +360,6 @@ static inline JSValue __JS_NewFloat64(double d)
372360
return v;
373361
}
374362

375-
static inline JSValue __JS_NewShortBigInt(JSContext *ctx, int64_t d)
376-
{
377-
(void)&ctx;
378-
JSValue v;
379-
v.tag = JS_TAG_SHORT_BIG_INT;
380-
v.u.short_big_int = d;
381-
return v;
382-
}
383-
384363
static inline bool JS_VALUE_IS_NAN(JSValue v)
385364
{
386365
union {

0 commit comments

Comments
 (0)