From 7ed9432eed94beef4f35f16df2c0bd53dd2ce4bc Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 7 Dec 2016 06:18:30 -0800 Subject: Fix some C style casts to use casting macros. This is uncovered by compiling with g++ using -Wold-style-cast. * mpi/mpi.c (mp_get_intptr): Use convert macro. Also in one of the rules producing REGCHAR. * parser.l (num_esc): Likewise. * struct.c (static_slot_set, static_slot_ens_rec, get_equal_method): Use coerce macro for int to pointer conversion. * sysif.c (setgroups_wrap): Use convert macro. * termios.c (termios_unpack, termios_pack): Likewise. * txr.c (sysroot_init): Likewise. --- termios.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'termios.c') diff --git a/termios.c b/termios.c index edb0e87a..8a7eb3e7 100644 --- a/termios.c +++ b/termios.c @@ -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)); -- cgit v1.2.3