diff options
-rw-r--r-- | mpi/mpi.c | 2 | ||||
-rw-r--r-- | parser.l | 4 | ||||
-rw-r--r-- | struct.c | 8 | ||||
-rw-r--r-- | sysif.c | 2 | ||||
-rw-r--r-- | termios.c | 4 | ||||
-rw-r--r-- | txr.c | 2 |
6 files changed, 11 insertions, 11 deletions
@@ -609,7 +609,7 @@ mp_err mp_get_intptr(mp_int *mp, int_ptr_t *z) uint_ptr_t tmp = 0; mp_get_uintptr(mp, &tmp); /* Reliance on bitwise unsigned to two's complement conversion */ - *z = (int_ptr_t) tmp; + *z = convert(int_ptr_t, tmp); return MP_OKAY; } @@ -177,7 +177,7 @@ static wchar_t num_esc(scanner_t *scn, char *num) val = strtol(num, 0, 8); } - if (val < 0 || val > 0x10FFFF || (wchar_t) val != val) { + if (val < 0 || val > 0x10FFFF || convert(wchar_t, val) != val) { yyerror(scn, yyget_extra(scn), "numeric character escape out of range"); val = 0; } @@ -895,7 +895,7 @@ UONLY {U2}{U}|{U3}{U}{U}|{U4}{U}{U}{U} <SREGEX>. { /* Allow non-UTF-8 byte for regexes scanned from string */ - yylval->chr = (unsigned char) yytext[0] + 0xDC00; + yylval->chr = convert(unsigned char, yytext[0]) + 0xDC00; return REGCHAR; } @@ -924,7 +924,7 @@ val static_slot_set(val stype, val sym, val newval) if (symbolp(sym)) { loc ptr = lookup_static_slot(stype, st, sym); if (!nullocp(ptr)) { - if (st->eqmslot == (struct stslot *) -1) + if (st->eqmslot == coerce(struct stslot *, -1)) st->eqmslot = 0; return set(ptr, newval); } @@ -1014,7 +1014,7 @@ static val static_slot_ens_rec(val stype, val sym, val newval, no_error_p = default_bool_arg(no_error_p); - if (st->eqmslot == (struct stslot *) -1) + if (st->eqmslot == coerce(struct stslot *, -1)) st->eqmslot = 0; if (stsl != 0 && opt_compat && opt_compat <= 151) { @@ -1384,7 +1384,7 @@ static cnum struct_inst_hash(val obj, int *count) static val get_equal_method(val stype, struct struct_type *st) { - if (st->eqmslot == (struct stslot *) -1) { + if (st->eqmslot == coerce(struct stslot *, -1)) { return nil; } else if (st->eqmslot) { struct stslot *stsl = st->eqmslot; @@ -1395,7 +1395,7 @@ static val get_equal_method(val stype, struct struct_type *st) st->eqmslot = stsl; return stslot_place(stsl); } - st->eqmslot = (struct stslot *) -1; + st->eqmslot = coerce(struct stslot *, -1); return nil; } } @@ -1048,7 +1048,7 @@ static val setgroups_wrap(val list) cnum len = c_num(length(list)); size_t size = len; - if ((cnum) size != len) { + if (convert(cnum, size) != len) { uw_throwf(system_error_s, lit("setgroups: list too long"), nao); } else { gid_t *arr = coerce(gid_t *, chk_malloc(size *sizeof *arr)); @@ -190,7 +190,7 @@ static val termios_unpack(struct termios *in) { args_decl(args, ARGS_MIN); val out = make_struct(termios_s, nil, args); - int i, cc_sz = (int) (sizeof in->c_cc / sizeof in->c_cc[0]); + int i, cc_sz = convert(int, sizeof in->c_cc / sizeof in->c_cc[0]); val cc = vector(num_fast(cc_sz), nil); slotset(out, iflag_s, num(in->c_iflag)); @@ -209,7 +209,7 @@ static val termios_unpack(struct termios *in) static void termios_pack(struct termios *out, val in) { - int i, cc_sz = (int) (sizeof out->c_cc / sizeof out->c_cc[0]); + int i, cc_sz = convert(int, sizeof out->c_cc / sizeof out->c_cc[0]); val cc = slot(in, cc_s); out->c_iflag = c_num(slot(in, iflag_s)); @@ -304,7 +304,7 @@ static void sysroot_init(void) #if HAVE_WINDOWS_H val slash = regex_compile(lit("\\\\"), nil); #endif - protect(&prog_path, &sysroot_path, &stdlib_path, (val *) 0); + protect(&prog_path, &sysroot_path, &stdlib_path, convert(val *, 0)); prog_path = get_self_path(); #if HAVE_WINDOWS_H prog_path = regsub(slash, lit("/"), prog_path); |