Code cleanup: add some parentheses in tcp.c and tcp_out.c

This commit is contained in:
Dirk Ziegelmeier 2017-02-01 15:28:10 +01:00
parent 4b091cfc2a
commit e8d5499d72
2 changed files with 7 additions and 7 deletions

View File

@ -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);
}

View File

@ -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);
}