From 442e70328ed51c9cb5e54c9d51e23ca792b22cf7 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sat, 17 Oct 2015 08:02:02 -0700 Subject: [PATCH] slirp: Compiler suggested cleanups --- slirp/tcp_input.c | 2 +- slirp/tcp_output.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/slirp/tcp_input.c b/slirp/tcp_input.c index 54eeb136..73a98682 100644 --- a/slirp/tcp_input.c +++ b/slirp/tcp_input.c @@ -1030,7 +1030,7 @@ trimthenstep6: incr = incr * incr / cw; tp->snd_cwnd = min(cw + incr, TCP_MAXWIN<snd_scale); } - if (acked > so->so_snd.sb_cc) { + if (acked > (int)so->so_snd.sb_cc) { tp->snd_wnd -= so->so_snd.sb_cc; sbdrop(&so->so_snd, (int )so->so_snd.sb_cc); ourfinisacked = 1; diff --git a/slirp/tcp_output.c b/slirp/tcp_output.c index c8b63c8b..24d2cda9 100644 --- a/slirp/tcp_output.c +++ b/slirp/tcp_output.c @@ -115,7 +115,7 @@ again: * to send then the probe will be the FIN * itself. */ - if (off < so->so_snd.sb_cc) + if (off < (int)so->so_snd.sb_cc) flags &= ~TH_FIN; win = 1; } else { @@ -124,7 +124,7 @@ again: } } - len = min(so->so_snd.sb_cc, win) - off; + len = min((long)so->so_snd.sb_cc, win) - off; if (len < 0) { /* @@ -166,12 +166,12 @@ again: if (len) { if (len == tp->t_maxseg) goto send; - if ((1 || idle || tp->t_flags & TF_NODELAY) && - len + off >= so->so_snd.sb_cc) + if ((1 || idle || (tp->t_flags & TF_NODELAY)) && + ((len + off) >= (long)so->so_snd.sb_cc)) goto send; if (tp->t_force) goto send; - if (len >= tp->max_sndwnd / 2 && tp->max_sndwnd > 0) + if ((len >= (long)(tp->max_sndwnd / 2)) && (tp->max_sndwnd > 0)) goto send; if (SEQ_LT(tp->snd_nxt, tp->snd_max)) goto send; @@ -280,7 +280,7 @@ send: * Adjust data length if insertion of options will * bump the packet length beyond the t_maxseg length. */ - if (len > tp->t_maxseg - optlen) { + if (len > (long)(tp->t_maxseg - optlen)) { len = tp->t_maxseg - optlen; sendalot = 1; }