From e181b0717470194a853d5084f902fde539635822 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 5 Apr 2020 19:46:56 -0700 Subject: warning cleanup: signed/unsigned in ternaries. This is the third round of an effort to enable GCC's -Wextra option. Instances of signed/unsigned mismatch between the branches of ternary conditionals are addressed. * ffi.c (pad_retval): Add cast into the consequent of the conditional so it yields size_t, like the alternative. * lib.c (split_str_keep): Likewise. (vector): Cast -1 to ucnum so it has the same type as the alloc_plus opposite to it. * parser.c (lino_getch): Add a cast to wint_t to match return value and opposite WEOF operand. * stream.c (generic_get_line): Likewise. * sysif.c (c_time): Convert both consequent and alternative to time_t to silence warning. --- sysif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sysif.c') diff --git a/sysif.c b/sysif.c index 0f614a2e..d4452b65 100644 --- a/sysif.c +++ b/sysif.c @@ -1042,7 +1042,7 @@ static val exit_star_wrap(val status) time_t c_time(val time) { - return if3(convert(time_t, -1) > 0, c_unum(time), c_num(time)); + return if3(convert(time_t, -1) > 0, (time_t) c_unum(time), (time_t) c_num(time)); } val num_time(time_t time) -- cgit v1.2.3