Fix compiler warnings (clang -Wextra)

This commit is contained in:
Lassi Kortela 2019-08-09 19:53:35 +03:00
parent 7d93f262a7
commit bb78dc0634
3 changed files with 3 additions and 3 deletions

View File

@ -1139,7 +1139,7 @@ static value_t fl_neg(value_t n)
{ {
if (isfixnum(n)) { if (isfixnum(n)) {
fixnum_t s = fixnum(-numval(n)); fixnum_t s = fixnum(-numval(n));
if (__unlikely(s == n)) if (__unlikely(n == (ufixnum_t)s))
return mk_long(-numval(n)); // negate overflows return mk_long(-numval(n)); // negate overflows
else else
return s; return s;

View File

@ -1490,7 +1490,7 @@ apply_cl_top:
do_neg: do_neg:
if (isfixnum(Stack[SP - 1])) { if (isfixnum(Stack[SP - 1])) {
s = fixnum(-numval(Stack[SP - 1])); s = fixnum(-numval(Stack[SP - 1]));
if (__unlikely(s == Stack[SP - 1])) if (__unlikely(Stack[SP - 1] == (ufixnum_t)s))
Stack[SP - 1] = Stack[SP - 1] =
mk_long(-numval(Stack[SP - 1])); // negate overflows mk_long(-numval(Stack[SP - 1])); // negate overflows
else else

View File

@ -970,7 +970,7 @@ int ios_vprintf(struct ios *s, const char *format, va_list args)
va_end(al); va_end(al);
return c; return c;
} }
if (c < avail) { if (avail > (size_t)c) {
s->bpos += (size_t)c; s->bpos += (size_t)c;
_write_update_pos(s); _write_update_pos(s);
// TODO: only works right if newline is at end // TODO: only works right if newline is at end