mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-02-04 21:39:49 +00:00
put LWIP_MAX and LWIP_MIN macros in def.h and use these instead of locally declaring them in .c files
This commit is contained in:
parent
b0273c9209
commit
6719f10034
@ -70,8 +70,6 @@ struct tcp_pcb *tcp_tw_pcbs; /* List of all TCP PCBs in TIME-WAIT. */
|
|||||||
|
|
||||||
struct tcp_pcb *tcp_tmp_pcb;
|
struct tcp_pcb *tcp_tmp_pcb;
|
||||||
|
|
||||||
#define LWIP_MIN(x,y) (x) < (y)? (x): (y)
|
|
||||||
|
|
||||||
static u8_t tcp_timer;
|
static u8_t tcp_timer;
|
||||||
|
|
||||||
static u16_t tcp_new_port(void);
|
static u16_t tcp_new_port(void);
|
||||||
|
@ -654,7 +654,7 @@ tcp_receive(struct tcp_pcb *pcb)
|
|||||||
ntohl(pcb->unacked->tcphdr->seqno)));
|
ntohl(pcb->unacked->tcphdr->seqno)));
|
||||||
tcp_rexmit(pcb);
|
tcp_rexmit(pcb);
|
||||||
/* Set ssthresh to max (FlightSize / 2, 2*SMSS) */
|
/* Set ssthresh to max (FlightSize / 2, 2*SMSS) */
|
||||||
pcb->ssthresh = UMAX((pcb->snd_max -
|
pcb->ssthresh = LWIP_MAX((pcb->snd_max -
|
||||||
pcb->lastack) / 2,
|
pcb->lastack) / 2,
|
||||||
2 * pcb->mss);
|
2 * pcb->mss);
|
||||||
|
|
||||||
|
@ -59,9 +59,6 @@
|
|||||||
#include "lwip/stats.h"
|
#include "lwip/stats.h"
|
||||||
|
|
||||||
#if LWIP_TCP
|
#if LWIP_TCP
|
||||||
#define LWIP_MIN(x,y) (x) < (y)? (x): (y)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* Forward declarations.*/
|
/* Forward declarations.*/
|
||||||
static void tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb);
|
static void tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb);
|
||||||
|
@ -35,7 +35,8 @@
|
|||||||
/* this might define NULL already */
|
/* this might define NULL already */
|
||||||
#include "arch/cc.h"
|
#include "arch/cc.h"
|
||||||
|
|
||||||
#define UMAX(a, b) ((a) > (b) ? (a) : (b))
|
#define LWIP_MAX(x , y) (x) > (y) ? (x) : (y)
|
||||||
|
#define LWIP_MIN(x , y) (x) < (y) ? (x) : (y)
|
||||||
|
|
||||||
#ifndef NULL
|
#ifndef NULL
|
||||||
#define NULL ((void *)0)
|
#define NULL ((void *)0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user