@@ -2188,15 +2188,13 @@ static inline void set_value(JSContext *ctx, JSValue *pval, JSValue new_val)
2188
2188
2189
2189
void JS_SetClassProto(JSContext *ctx, JSClassID class_id, JSValue obj)
2190
2190
{
2191
- JSRuntime *rt = ctx->rt;
2192
- assert(class_id < rt->class_count);
2191
+ assert(class_id < ctx->rt->class_count);
2193
2192
set_value(ctx, &ctx->class_proto[class_id], obj);
2194
2193
}
2195
2194
2196
2195
JSValue JS_GetClassProto(JSContext *ctx, JSClassID class_id)
2197
2196
{
2198
- JSRuntime *rt = ctx->rt;
2199
- assert(class_id < rt->class_count);
2197
+ assert(class_id < ctx->rt->class_count);
2200
2198
return js_dup(ctx->class_proto[class_id]);
2201
2199
}
2202
2200
@@ -11083,8 +11081,6 @@ static int js_ecvt(double d, int n_digits,
11083
11081
char dest[minimum_length(JS_ECVT_BUF_SIZE)],
11084
11082
size_t size, int *decpt)
11085
11083
{
11086
- int i;
11087
-
11088
11084
if (n_digits == 0) {
11089
11085
/* find the minimum number of digits (XXX: inefficient but simple) */
11090
11086
// TODO(chqrlie) use direct method from quickjs-printf
@@ -11134,7 +11130,7 @@ static int js_ecvt(double d, int n_digits,
11134
11130
return n_digits; /* truncate the 2 extra digits */
11135
11131
}
11136
11132
/* round up in the string */
11137
- for(i = n_digits;; i--) {
11133
+ for(int i = n_digits;; i--) {
11138
11134
/* ignore the locale specific decimal point */
11139
11135
if (is_digit(dest[i])) {
11140
11136
if (dest[i]++ < '9')
@@ -11164,7 +11160,7 @@ static size_t js_fcvt(double d, int n_digits,
11164
11160
char dest[minimum_length(JS_FCVT_BUF_SIZE)], size_t size)
11165
11161
{
11166
11162
#if defined(FE_DOWNWARD) && defined(FE_TONEAREST)
11167
- int i, n1, n2 ;
11163
+ int i, n1;
11168
11164
/* generate 2 extra digits: 99% chances to avoid 2 calls */
11169
11165
n1 = snprintf(dest, size, "%.*f", n_digits + 2, d) - 2;
11170
11166
if (dest[n1] >= '5') {
@@ -11427,7 +11423,6 @@ static JSValue js_dtoa_radix(JSContext *ctx, double d, int radix)
11427
11423
JSValue JS_ToStringInternal(JSContext *ctx, JSValue val, BOOL is_ToPropertyKey)
11428
11424
{
11429
11425
uint32_t tag;
11430
- const char *str;
11431
11426
char buf[32];
11432
11427
size_t len;
11433
11428
@@ -12061,8 +12056,7 @@ static JSValue JS_CompactBigInt1(JSContext *ctx, JSValue val)
12061
12056
return val; /* fail safe */
12062
12057
bf_t *a = JS_GetBigInt(val);
12063
12058
if (a->expn == BF_EXP_ZERO && a->sign) {
12064
- JSBigInt *p = JS_VALUE_GET_PTR(val);
12065
- assert(p->header.ref_count == 1);
12059
+ assert(((JSBigInt*)JS_VALUE_GET_PTR(val))->header.ref_count == 1);
12066
12060
a->sign = 0;
12067
12061
}
12068
12062
return val;
@@ -18830,7 +18824,6 @@ static __exception int js_parse_string(JSParseState *s, int sep,
18830
18824
break;
18831
18825
}
18832
18826
if (c == '\\') {
18833
- const uint8_t *p0 = p;
18834
18827
c = *p;
18835
18828
switch(c) {
18836
18829
case '\0':
@@ -27030,7 +27023,6 @@ static JSValue js_dynamic_import_job(JSContext *ctx,
27030
27023
JSValue *resolving_funcs = argv;
27031
27024
JSValue basename_val = argv[2];
27032
27025
JSValue specifier = argv[3];
27033
- JSModuleDef *m;
27034
27026
const char *basename = NULL, *filename;
27035
27027
JSValue ret, err;
27036
27028
@@ -27371,7 +27363,7 @@ static int js_inner_module_evaluation(JSContext *ctx, JSModuleDef *m,
27371
27363
JSReqModuleEntry *rme = &m->req_module_entries[i];
27372
27364
m1 = rme->module;
27373
27365
index = js_inner_module_evaluation(ctx, m1, index, pstack_top, pvalue);
27374
- if (index < 0)
27366
+ if (index < 0)
27375
27367
return -1;
27376
27368
assert(m1->status == JS_MODULE_STATUS_EVALUATING ||
27377
27369
m1->status == JS_MODULE_STATUS_EVALUATING_ASYNC ||
@@ -32962,11 +32954,10 @@ JSValue JS_EvalThis(JSContext *ctx, JSValue this_obj,
32962
32954
const char *input, size_t input_len,
32963
32955
const char *filename, int eval_flags)
32964
32956
{
32965
- int eval_type = eval_flags & JS_EVAL_TYPE_MASK;
32966
32957
JSValue ret;
32967
32958
32968
- assert(eval_type == JS_EVAL_TYPE_GLOBAL ||
32969
- eval_type == JS_EVAL_TYPE_MODULE);
32959
+ assert((eval_flags & JS_EVAL_TYPE_MASK) == JS_EVAL_TYPE_GLOBAL ||
32960
+ (eval_flags & JS_EVAL_TYPE_MASK) == JS_EVAL_TYPE_MODULE);
32970
32961
ret = JS_EvalInternal(ctx, this_obj, input, input_len, filename,
32971
32962
eval_flags, -1);
32972
32963
return ret;
@@ -34400,8 +34391,6 @@ static JSValue JS_ReadFunctionTag(BCReaderState *s)
34400
34391
int idx, i, local_count, has_debug_info;
34401
34392
int function_size, cpool_offset, byte_code_offset;
34402
34393
int closure_var_offset, vardefs_offset;
34403
- uint32_t ic_len;
34404
- JSAtom atom;
34405
34394
34406
34395
memset(&bc, 0, sizeof(bc));
34407
34396
bc.header.ref_count = 1;
@@ -37659,8 +37648,6 @@ static JSValue js_array_at(JSContext *ctx, JSValue this_val,
37659
37648
{
37660
37649
JSValue obj, ret;
37661
37650
int64_t len, idx;
37662
- JSValue *arrp;
37663
- uint32_t count;
37664
37651
37665
37652
ret = JS_EXCEPTION;
37666
37653
obj = JS_ToObject(ctx, this_val);
@@ -52250,7 +52237,6 @@ static JSValue js_atomics_wait(JSContext *ctx,
52250
52237
int32_t v32;
52251
52238
void *ptr;
52252
52239
int64_t timeout;
52253
- struct timespec ts;
52254
52240
JSAtomicsWaiter waiter_s, *waiter;
52255
52241
int ret, size_log2, res;
52256
52242
double d;
0 commit comments