From f87d813b6339efe1f7b96028cce0df2d96bae507 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 29 Mar 2016 20:05:34 -0700 Subject: Replace all stray C style casts with macros. * gc.c (gc_report_copies): C style casts found in this function. * linenoise.c (strip_qual, convert, coerce): Copy and paste the macros here. (record_undo, compare_completions, lino_add_completion, history_search, ab_append, sync_data_to_buf, refresh_singleline, screen_rows, refresh_multiline, find_nearest_paren, paren_jump, yank_sel, edit_move_matching_paren, edit, lino_make, lino_copy, lino_hist_add, lino_hist_set_max_len): C style casts replaced. * mpi/mpi-types.h (MP_DIGIT_BIT, MP_DIGIT_MAX, MP_WORD_BIT, MP_WORD_MAX, RADIX): C style casts replaced. * mpi/mpi.c (convert, coerce): Copy and paste the macros here. (mp_init_size, mp_init_copy, mp_copy, mp_set_int, mp_div_d, mp_bit, mp_to_double, mp_to_signed_bin, mp_to_unsigned_bin, mp_to_unsigned_buf, mp_toradix_case, mp_grow, s_mp_set_bit, s_mp_mod_2d, s_mp_mul_2d, s_mp_div_2d, s_mp_mul_d, s_mp_mul, s_mp_sqr, s_mp_div, s_mp_2expt, s_mp_todigit): C style casts replaced. * mpi/mplogic (convert): Macro copy and pasted here. (mpl_num_set, mpl_num_clear): C style casts replaced. * parser.c (provide_completions): Likewise. * signal.c (small_sigfillset): Likewise. * stream.c (stdio_truncate, test_set_indent_mode, set_indent_mode): Likewise. --- stream.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'stream.c') diff --git a/stream.c b/stream.c index 76d0c3cb..dfab164a 100644 --- a/stream.c +++ b/stream.c @@ -757,7 +757,7 @@ static val stdio_truncate(val stream, val len) int (*truncfun)(int, long) = chsize; #endif - if ((cnum) (trunc_off_t) l != l) + if (convert(cnum, convert(trunc_off_t, l)) != l) uw_throwf(error_s, lit("truncate-stream: ~s is too large"), len, nao); return (h->f != 0 && truncfun(fileno(h->f), l) == 0) @@ -3254,7 +3254,7 @@ val test_set_indent_mode(val stream, val compare, val mode) cobj_handle(stream, stream_s)); val oldval = num_fast(s->indent_mode); if (oldval == compare) - s->indent_mode = (enum indent_mode) c_num(mode); + s->indent_mode = convert(enum indent_mode, c_num(mode)); return oldval; } @@ -3263,7 +3263,7 @@ val set_indent_mode(val stream, val mode) struct strm_base *s = coerce(struct strm_base *, cobj_handle(stream, stream_s)); val oldval = num_fast(s->indent_mode); - s->indent_mode = (enum indent_mode) c_num(mode); + s->indent_mode = convert(enum indent_mode, c_num(mode)); return oldval; } -- cgit v1.2.3