mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 22:02:27 +00:00
WIP: Correct all typos (#498)
This commit is contained in:
parent
98254a7c1f
commit
ed205e98a1
79 changed files with 162 additions and 162 deletions
4
third_party/quickjs/bigdecimal.c
vendored
4
third_party/quickjs/bigdecimal.c
vendored
|
@ -669,8 +669,8 @@ static int js_binary_arith_bigdecimal(JSContext *ctx, OPCodeEnum op,
|
|||
ret = bfdec_div(r, a, b, BF_PREC_INF, BF_RNDZ);
|
||||
break;
|
||||
case OP_math_mod:
|
||||
/* Euclidian remainder */
|
||||
ret = bfdec_rem(r, a, b, BF_PREC_INF, BF_RNDZ, BF_DIVREM_EUCLIDIAN);
|
||||
/* Euclidean remainder */
|
||||
ret = bfdec_rem(r, a, b, BF_PREC_INF, BF_RNDZ, BF_DIVREM_EUCLIDEAN);
|
||||
break;
|
||||
case OP_mod:
|
||||
ret = bfdec_rem(r, a, b, BF_PREC_INF, BF_RNDZ, BF_RNDZ);
|
||||
|
|
8
third_party/quickjs/bigint.c
vendored
8
third_party/quickjs/bigint.c
vendored
|
@ -403,11 +403,11 @@ static const JSCFunctionListEntry js_bigint_funcs[] = {
|
|||
JS_CFUNC_MAGIC_DEF("tdiv", 2, js_bigint_div, BF_RNDZ ),
|
||||
JS_CFUNC_MAGIC_DEF("fdiv", 2, js_bigint_div, BF_RNDD ),
|
||||
JS_CFUNC_MAGIC_DEF("cdiv", 2, js_bigint_div, BF_RNDU ),
|
||||
JS_CFUNC_MAGIC_DEF("ediv", 2, js_bigint_div, BF_DIVREM_EUCLIDIAN ),
|
||||
JS_CFUNC_MAGIC_DEF("ediv", 2, js_bigint_div, BF_DIVREM_EUCLIDEAN ),
|
||||
JS_CFUNC_MAGIC_DEF("tdivrem", 2, js_bigint_div, BF_RNDZ | 0x10 ),
|
||||
JS_CFUNC_MAGIC_DEF("fdivrem", 2, js_bigint_div, BF_RNDD | 0x10 ),
|
||||
JS_CFUNC_MAGIC_DEF("cdivrem", 2, js_bigint_div, BF_RNDU | 0x10 ),
|
||||
JS_CFUNC_MAGIC_DEF("edivrem", 2, js_bigint_div, BF_DIVREM_EUCLIDIAN | 0x10 ),
|
||||
JS_CFUNC_MAGIC_DEF("edivrem", 2, js_bigint_div, BF_DIVREM_EUCLIDEAN | 0x10 ),
|
||||
JS_CFUNC_MAGIC_DEF("sqrt", 1, js_bigint_sqrt, 0 ),
|
||||
JS_CFUNC_MAGIC_DEF("sqrtrem", 1, js_bigint_sqrt, 1 ),
|
||||
JS_CFUNC_MAGIC_DEF("floorLog2", 1, js_bigint_op1, 0 ),
|
||||
|
@ -584,9 +584,9 @@ static int js_binary_arith_bigint(JSContext *ctx, OPCodeEnum op,
|
|||
}
|
||||
break;
|
||||
case OP_math_mod:
|
||||
/* Euclidian remainder */
|
||||
/* Euclidean remainder */
|
||||
ret = bf_rem(r, a, b, BF_PREC_INF, BF_RNDZ,
|
||||
BF_DIVREM_EUCLIDIAN) & BF_ST_INVALID_OP;
|
||||
BF_DIVREM_EUCLIDEAN) & BF_ST_INVALID_OP;
|
||||
break;
|
||||
case OP_mod:
|
||||
ret = bf_rem(r, a, b, BF_PREC_INF, BF_RNDZ,
|
||||
|
|
2
third_party/quickjs/call.c
vendored
2
third_party/quickjs/call.c
vendored
|
@ -1240,7 +1240,7 @@ static int js_op_define_class(JSContext *ctx, JSValue *sp,
|
|||
if (JS_DefineObjectName(ctx, ctor, class_name, JS_PROP_CONFIGURABLE) < 0)
|
||||
goto fail;
|
||||
}
|
||||
/* the constructor property must be first. It can be overriden by
|
||||
/* the constructor property must be first. It can be overridden by
|
||||
computed property names */
|
||||
if (JS_DefinePropertyValue(ctx, proto, JS_ATOM_constructor,
|
||||
JS_DupValue(ctx, ctor),
|
||||
|
|
2
third_party/quickjs/cutils.c
vendored
2
third_party/quickjs/cutils.c
vendored
|
@ -394,7 +394,7 @@ static inline void *med3(void *a, void *b, void *c, cmp_f cmp, void *opaque)
|
|||
(cmp(b, c, opaque) > 0 ? b : (cmp(a, c, opaque) < 0 ? a : c ));
|
||||
}
|
||||
|
||||
/* pointer based version with local stack and insertion sort threshhold */
|
||||
/* pointer based version with local stack and insertion sort threshold */
|
||||
void rqsort(void *base, size_t nmemb, size_t size, cmp_f cmp, void *opaque)
|
||||
{
|
||||
struct { uint8_t *base; size_t count; int depth; } stack[50], *sp = stack;
|
||||
|
|
4
third_party/quickjs/float.c
vendored
4
third_party/quickjs/float.c
vendored
|
@ -1000,9 +1000,9 @@ static int js_binary_arith_bigfloat(JSContext *ctx, OPCodeEnum op,
|
|||
ret = bf_div(r, a, b, ctx->fp_env.prec, ctx->fp_env.flags);
|
||||
break;
|
||||
case OP_math_mod:
|
||||
/* Euclidian remainder */
|
||||
/* Euclidean remainder */
|
||||
ret = bf_rem(r, a, b, ctx->fp_env.prec, ctx->fp_env.flags,
|
||||
BF_DIVREM_EUCLIDIAN);
|
||||
BF_DIVREM_EUCLIDEAN);
|
||||
break;
|
||||
case OP_mod:
|
||||
ret = bf_rem(r, a, b, ctx->fp_env.prec, ctx->fp_env.flags,
|
||||
|
|
2
third_party/quickjs/gc.c
vendored
2
third_party/quickjs/gc.c
vendored
|
@ -397,7 +397,7 @@ void JS_RunGC(JSRuntime *rt)
|
|||
/* decrement the reference of the children of each object. mark =
|
||||
1 after this pass. */
|
||||
gc_decref(rt);
|
||||
/* keep the GC objects with a non zero refcount and their childs */
|
||||
/* keep the GC objects with a non zero refcount and their children */
|
||||
gc_scan(rt);
|
||||
/* free the GC objects in a cycle */
|
||||
gc_free_cycles(rt);
|
||||
|
|
8
third_party/quickjs/internal.h
vendored
8
third_party/quickjs/internal.h
vendored
|
@ -1291,7 +1291,7 @@ typedef struct BlockEnv {
|
|||
|
||||
typedef struct JSGlobalVar {
|
||||
int cpool_idx; /* if >= 0, index in the constant pool for hoisted
|
||||
function defintion*/
|
||||
function definition*/
|
||||
uint8_t force_init : 1; /* force initialization to undefined */
|
||||
uint8_t is_lexical : 1; /* global let/const definition */
|
||||
uint8_t is_const : 1; /* const definition */
|
||||
|
@ -1393,9 +1393,9 @@ typedef struct JSFunctionDef {
|
|||
int func_var_idx; /* variable containing the current function (-1
|
||||
if none, only used if is_func_expr is true) */
|
||||
int eval_ret_idx; /* variable containing the return value of the eval, -1 if none */
|
||||
int this_var_idx; /* variable containg the 'this' value, -1 if none */
|
||||
int new_target_var_idx; /* variable containg the 'new.target' value, -1 if none */
|
||||
int this_active_func_var_idx; /* variable containg the 'this.active_func' value, -1 if none */
|
||||
int this_var_idx; /* variable containing the 'this' value, -1 if none */
|
||||
int new_target_var_idx; /* variable containing the 'new.target' value, -1 if none */
|
||||
int this_active_func_var_idx; /* variable containing the 'this.active_func' value, -1 if none */
|
||||
int home_object_var_idx;
|
||||
BOOL need_home_object;
|
||||
int scope_level; /* index into fd->scopes if the current lexical scope */
|
||||
|
|
14
third_party/quickjs/libbf.c
vendored
14
third_party/quickjs/libbf.c
vendored
|
@ -1729,7 +1729,7 @@ static int __bf_div(bf_t *r, const bf_t *a, const bf_t *b, limb_t prec,
|
|||
/* division and remainder.
|
||||
|
||||
rnd_mode is the rounding mode for the quotient. The additional
|
||||
rounding mode BF_RND_EUCLIDIAN is supported.
|
||||
rounding mode BF_RND_EUCLIDEAN is supported.
|
||||
|
||||
'q' is an integer. 'r' is rounded with prec and flags (prec can be
|
||||
BF_PREC_INF).
|
||||
|
@ -1778,7 +1778,7 @@ int bf_divrem(bf_t *q, bf_t *r, const bf_t *a, const bf_t *b,
|
|||
case BF_RNDA:
|
||||
is_ceil = TRUE;
|
||||
break;
|
||||
case BF_DIVREM_EUCLIDIAN:
|
||||
case BF_DIVREM_EUCLIDEAN:
|
||||
is_ceil = a->sign;
|
||||
break;
|
||||
}
|
||||
|
@ -4120,7 +4120,7 @@ static void bf_const_pi_internal(bf_t *Q, limb_t prec)
|
|||
int64_t n, prec1;
|
||||
bf_t P, G;
|
||||
|
||||
/* number of serie terms */
|
||||
/* number of series terms */
|
||||
n = prec / CHUD_BITS_PER_TERM + 1;
|
||||
/* XXX: precision analysis */
|
||||
prec1 = prec + 32;
|
||||
|
@ -5188,7 +5188,7 @@ static int bf_atan2_internal(bf_t *r, const bf_t *y, limb_t prec, void *opaque)
|
|||
return 0;
|
||||
}
|
||||
|
||||
/* compute atan(y/x) assumming inf/inf = 1 and 0/0 = 0 */
|
||||
/* compute atan(y/x) assuming inf/inf = 1 and 0/0 = 0 */
|
||||
bf_init(s, T);
|
||||
prec1 = prec + 32;
|
||||
if (y->expn == BF_EXP_INF && x->expn == BF_EXP_INF) {
|
||||
|
@ -5670,7 +5670,7 @@ limb_t mp_add_mul1_dec(limb_t *tabr, const limb_t *taba, mp_size_t n,
|
|||
}
|
||||
|
||||
/* tabr[] -= taba[] * b. 0 <= b <= base - 1. Return the value to
|
||||
substract to the high word. */
|
||||
subtract to the high word. */
|
||||
limb_t mp_sub_mul1_dec(limb_t *tabr, const limb_t *taba, mp_size_t n,
|
||||
limb_t b)
|
||||
{
|
||||
|
@ -6934,7 +6934,7 @@ static void bfdec_tdivremu(bf_context_t *s, bfdec_t *q, bfdec_t *r,
|
|||
/* division and remainder.
|
||||
|
||||
rnd_mode is the rounding mode for the quotient. The additional
|
||||
rounding mode BF_RND_EUCLIDIAN is supported.
|
||||
rounding mode BF_RND_EUCLIDEAN is supported.
|
||||
|
||||
'q' is an integer. 'r' is rounded with prec and flags (prec can be
|
||||
BF_PREC_INF).
|
||||
|
@ -6985,7 +6985,7 @@ int bfdec_divrem(bfdec_t *q, bfdec_t *r, const bfdec_t *a, const bfdec_t *b,
|
|||
case BF_RNDA:
|
||||
is_ceil = TRUE;
|
||||
break;
|
||||
case BF_DIVREM_EUCLIDIAN:
|
||||
case BF_DIVREM_EUCLIDEAN:
|
||||
is_ceil = a->sign;
|
||||
break;
|
||||
}
|
||||
|
|
4
third_party/quickjs/libbf.h
vendored
4
third_party/quickjs/libbf.h
vendored
|
@ -149,7 +149,7 @@ static inline bf_flags_t bf_set_exp_bits(int n)
|
|||
#define BF_ST_OVERFLOW (1 << 2)
|
||||
#define BF_ST_UNDERFLOW (1 << 3)
|
||||
#define BF_ST_INEXACT (1 << 4)
|
||||
/* indicate that a memory allocation error occured. NaN is returned */
|
||||
/* indicate that a memory allocation error occurred. NaN is returned */
|
||||
#define BF_ST_MEM_ERROR (1 << 5)
|
||||
|
||||
#define BF_RADIX_MAX 36 /* maximum radix for bf_atof() and bf_ftoa() */
|
||||
|
@ -267,7 +267,7 @@ int bf_mul_si(bf_t *r, const bf_t *a, int64_t b1, limb_t prec,
|
|||
bf_flags_t flags);
|
||||
int bf_mul_2exp(bf_t *r, slimb_t e, limb_t prec, bf_flags_t flags);
|
||||
int bf_div(bf_t *r, const bf_t *a, const bf_t *b, limb_t prec, bf_flags_t flags);
|
||||
#define BF_DIVREM_EUCLIDIAN BF_RNDF
|
||||
#define BF_DIVREM_EUCLIDEAN BF_RNDF
|
||||
int bf_divrem(bf_t *q, bf_t *r, const bf_t *a, const bf_t *b,
|
||||
limb_t prec, bf_flags_t flags, int rnd_mode);
|
||||
int bf_rem(bf_t *r, const bf_t *a, const bf_t *b, limb_t prec,
|
||||
|
|
2
third_party/quickjs/libregexp.c
vendored
2
third_party/quickjs/libregexp.c
vendored
|
@ -1635,7 +1635,7 @@ static int re_parse_term(REParseState *s, BOOL is_backward_dir)
|
|||
put_u32(s->byte_code.buf + last_atom_start + 1,
|
||||
len + 5 + add_zero_advance_check);
|
||||
if (add_zero_advance_check) {
|
||||
/* avoid infinite loop by stoping the
|
||||
/* avoid infinite loop by stopping the
|
||||
recursion if no advance was made in the
|
||||
atom (only works if the atom has no
|
||||
side effect) */
|
||||
|
|
4
third_party/quickjs/quickjs.c
vendored
4
third_party/quickjs/quickjs.c
vendored
|
@ -10513,7 +10513,7 @@ static int find_private_class_field_all(JSContext *ctx, JSFunctionDef *fd,
|
|||
|
||||
static void get_loc_or_ref(DynBuf *bc, BOOL is_ref, int idx)
|
||||
{
|
||||
/* if the field is not initialized, the error is catched when
|
||||
/* if the field is not initialized, the error is caught when
|
||||
accessing it */
|
||||
if (is_ref)
|
||||
dbuf_putc(bc, OP_get_var_ref);
|
||||
|
@ -12667,7 +12667,7 @@ static __exception int ss_check(JSContext *ctx, StackSizeState *s,
|
|||
if (s->stack_level_tab[pos] != 0xffff) {
|
||||
/* already explored: check that the stack size is consistent */
|
||||
if (s->stack_level_tab[pos] != stack_len) {
|
||||
JS_ThrowInternalError(ctx, "unconsistent stack size: %d %d (pc=%d)",
|
||||
JS_ThrowInternalError(ctx, "inconsistent stack size: %d %d (pc=%d)",
|
||||
s->stack_level_tab[pos], stack_len, pos);
|
||||
return -1;
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue