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:
jani 2003-05-27 13:44:08 +00:00
parent b0273c9209
commit 6719f10034
4 changed files with 3 additions and 7 deletions

View File

@ -70,8 +70,6 @@ struct tcp_pcb *tcp_tw_pcbs; /* List of all TCP PCBs in TIME-WAIT. */
struct tcp_pcb *tcp_tmp_pcb;
#define LWIP_MIN(x,y) (x) < (y)? (x): (y)
static u8_t tcp_timer;
static u16_t tcp_new_port(void);

View File

@ -654,7 +654,7 @@ tcp_receive(struct tcp_pcb *pcb)
ntohl(pcb->unacked->tcphdr->seqno)));
tcp_rexmit(pcb);
/* Set ssthresh to max (FlightSize / 2, 2*SMSS) */
pcb->ssthresh = UMAX((pcb->snd_max -
pcb->ssthresh = LWIP_MAX((pcb->snd_max -
pcb->lastack) / 2,
2 * pcb->mss);

View File

@ -59,9 +59,6 @@
#include "lwip/stats.h"
#if LWIP_TCP
#define LWIP_MIN(x,y) (x) < (y)? (x): (y)
/* Forward declarations.*/
static void tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb);

View File

@ -35,7 +35,8 @@
/* this might define NULL already */
#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
#define NULL ((void *)0)