mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-01 23:03:54 -06:00
slirp: prefer c99 types over BSD kind
Replace: - u_char -> uint8_t - u_short -> uint16_t - u_long -> uint32_t - u_int -> unsigned - caddr_t -> char * Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
This commit is contained in:
parent
a9d8b3ec43
commit
d7df0b41dc
17 changed files with 69 additions and 71 deletions
|
@ -76,7 +76,7 @@
|
|||
} \
|
||||
}
|
||||
|
||||
static void tcp_dooptions(struct tcpcb *tp, u_char *cp, int cnt,
|
||||
static void tcp_dooptions(struct tcpcb *tp, uint8_t *cp, int cnt,
|
||||
struct tcpiphdr *ti);
|
||||
static void tcp_xmit_timer(register struct tcpcb *tp, int rtt);
|
||||
|
||||
|
@ -197,7 +197,7 @@ tcp_input(struct mbuf *m, int iphlen, struct socket *inso, unsigned short af)
|
|||
struct ip save_ip, *ip;
|
||||
struct ip6 save_ip6, *ip6;
|
||||
register struct tcpiphdr *ti;
|
||||
caddr_t optp = NULL;
|
||||
char *optp = NULL;
|
||||
int optlen = 0;
|
||||
int len, tlen, off;
|
||||
register struct tcpcb *tp = NULL;
|
||||
|
@ -205,7 +205,7 @@ tcp_input(struct mbuf *m, int iphlen, struct socket *inso, unsigned short af)
|
|||
struct socket *so = NULL;
|
||||
int todrop, acked, ourfinisacked, needoutput = 0;
|
||||
int iss = 0;
|
||||
u_long tiwin;
|
||||
uint32_t tiwin;
|
||||
int ret;
|
||||
struct sockaddr_storage lhost, fhost;
|
||||
struct sockaddr_in *lhost4, *fhost4;
|
||||
|
@ -327,7 +327,7 @@ tcp_input(struct mbuf *m, int iphlen, struct socket *inso, unsigned short af)
|
|||
ti->ti_len = tlen;
|
||||
if (off > sizeof (struct tcphdr)) {
|
||||
optlen = off - sizeof (struct tcphdr);
|
||||
optp = mtod(m, caddr_t) + sizeof (struct tcpiphdr);
|
||||
optp = mtod(m, char *) + sizeof (struct tcpiphdr);
|
||||
}
|
||||
tiflags = ti->ti_flags;
|
||||
|
||||
|
@ -469,7 +469,7 @@ findso:
|
|||
* else do it below (after getting remote address).
|
||||
*/
|
||||
if (optp && tp->t_state != TCPS_LISTEN)
|
||||
tcp_dooptions(tp, (u_char *)optp, optlen, ti);
|
||||
tcp_dooptions(tp, (uint8_t *)optp, optlen, ti);
|
||||
|
||||
/*
|
||||
* Header prediction: check for the two common cases
|
||||
|
@ -724,7 +724,7 @@ findso:
|
|||
tcp_template(tp);
|
||||
|
||||
if (optp)
|
||||
tcp_dooptions(tp, (u_char *)optp, optlen, ti);
|
||||
tcp_dooptions(tp, (uint8_t *)optp, optlen, ti);
|
||||
|
||||
if (iss)
|
||||
tp->iss = iss;
|
||||
|
@ -1039,7 +1039,7 @@ trimthenstep6:
|
|||
tp->t_dupacks = 0;
|
||||
else if (++tp->t_dupacks == TCPREXMTTHRESH) {
|
||||
tcp_seq onxt = tp->snd_nxt;
|
||||
u_int win =
|
||||
unsigned win =
|
||||
MIN(tp->snd_wnd, tp->snd_cwnd) /
|
||||
2 / tp->t_maxseg;
|
||||
|
||||
|
@ -1108,8 +1108,8 @@ trimthenstep6:
|
|||
* (maxseg^2 / cwnd per packet).
|
||||
*/
|
||||
{
|
||||
register u_int cw = tp->snd_cwnd;
|
||||
register u_int incr = tp->t_maxseg;
|
||||
register unsigned cw = tp->snd_cwnd;
|
||||
register unsigned incr = tp->t_maxseg;
|
||||
|
||||
if (cw > tp->snd_ssthresh)
|
||||
incr = incr * incr / cw;
|
||||
|
@ -1381,7 +1381,7 @@ drop:
|
|||
}
|
||||
|
||||
static void
|
||||
tcp_dooptions(struct tcpcb *tp, u_char *cp, int cnt, struct tcpiphdr *ti)
|
||||
tcp_dooptions(struct tcpcb *tp, uint8_t *cp, int cnt, struct tcpiphdr *ti)
|
||||
{
|
||||
uint16_t mss;
|
||||
int opt, optlen;
|
||||
|
@ -1511,7 +1511,7 @@ tcp_xmit_timer(register struct tcpcb *tp, int rtt)
|
|||
*/
|
||||
|
||||
int
|
||||
tcp_mss(struct tcpcb *tp, u_int offer)
|
||||
tcp_mss(struct tcpcb *tp, unsigned offer)
|
||||
{
|
||||
struct socket *so = tp->t_socket;
|
||||
int mss;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue