From e8d5499d72950b9e22d1444c1a4443574d938386 Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Wed, 1 Feb 2017 15:28:10 +0100 Subject: [PATCH] Code cleanup: add some parentheses in tcp.c and tcp_out.c --- src/core/tcp.c | 8 ++++---- src/core/tcp_out.c | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/core/tcp.c b/src/core/tcp.c index 75be86bb..afdf8bff 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -1301,7 +1301,7 @@ tcp_process_refused_data(struct tcp_pcb *pcb) TCP_EVENT_RECV(pcb, refused_data, ERR_OK, err); if (err == ERR_OK) { /* did refused_data include a FIN? */ - if (refused_flags & PBUF_FLAG_TCP_FIN + if ((refused_flags & PBUF_FLAG_TCP_FIN) #if TCP_QUEUE_OOSEQ && LWIP_WND_SCALE && (rest == NULL) #endif /* TCP_QUEUE_OOSEQ && LWIP_WND_SCALE */ @@ -1826,9 +1826,9 @@ tcp_pcb_remove(struct tcp_pcb **pcblist, struct tcp_pcb *pcb) tcp_pcb_purge(pcb); /* if there is an outstanding delayed ACKs, send it */ - if (pcb->state != TIME_WAIT && - pcb->state != LISTEN && - pcb->flags & TF_ACK_DELAY) { + if ((pcb->state != TIME_WAIT) && + (pcb->state != LISTEN) && + (pcb->flags & TF_ACK_DELAY)) { pcb->flags |= TF_ACK_NOW; tcp_output(pcb); } diff --git a/src/core/tcp_out.c b/src/core/tcp_out.c index 4928cddd..108028b2 100644 --- a/src/core/tcp_out.c +++ b/src/core/tcp_out.c @@ -1014,9 +1014,9 @@ tcp_output(struct tcp_pcb *pcb) * * If data is to be sent, we will just piggyback the ACK (see below). */ - if (pcb->flags & TF_ACK_NOW && - (seg == NULL || - lwip_ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len > wnd)) { + if ((pcb->flags & TF_ACK_NOW) && + (seg == NULL || + lwip_ntohl(seg->tcphdr->seqno) - pcb->lastack + seg->len > wnd)) { return tcp_send_empty_ack(pcb); }