mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-04 21:44:38 +08:00
Remove global variable used in macros, it can be declared locally.
This commit is contained in:
parent
f518c6578c
commit
3f0b1e2cdc
@ -115,9 +115,6 @@ struct tcp_pcb *tcp_tw_pcbs;
|
|||||||
struct tcp_pcb ** const tcp_pcb_lists[] = {&tcp_listen_pcbs.pcbs, &tcp_bound_pcbs,
|
struct tcp_pcb ** const tcp_pcb_lists[] = {&tcp_listen_pcbs.pcbs, &tcp_bound_pcbs,
|
||||||
&tcp_active_pcbs, &tcp_tw_pcbs};
|
&tcp_active_pcbs, &tcp_tw_pcbs};
|
||||||
|
|
||||||
/** Only used for temporary storage. */
|
|
||||||
struct tcp_pcb *tcp_tmp_pcb;
|
|
||||||
|
|
||||||
u8_t tcp_active_pcbs_changed;
|
u8_t tcp_active_pcbs_changed;
|
||||||
|
|
||||||
/** Timer counter to handle calling slow-timer from tcp_tmr() */
|
/** Timer counter to handle calling slow-timer from tcp_tmr() */
|
||||||
|
@ -360,7 +360,6 @@ extern struct tcp_pcb *tcp_active_pcbs; /* List of all TCP PCBs that are in a
|
|||||||
data. */
|
data. */
|
||||||
extern struct tcp_pcb *tcp_tw_pcbs; /* List of all TCP PCBs in TIME-WAIT. */
|
extern struct tcp_pcb *tcp_tw_pcbs; /* List of all TCP PCBs in TIME-WAIT. */
|
||||||
|
|
||||||
extern struct tcp_pcb *tcp_tmp_pcb; /* Only used for temporary storage. */
|
|
||||||
|
|
||||||
/* Axioms about the above lists:
|
/* Axioms about the above lists:
|
||||||
1) Every TCP PCB that is not CLOSED is in one of the lists.
|
1) Every TCP PCB that is not CLOSED is in one of the lists.
|
||||||
@ -375,6 +374,7 @@ extern struct tcp_pcb *tcp_tmp_pcb; /* Only used for temporary storage. */
|
|||||||
#endif
|
#endif
|
||||||
#if TCP_DEBUG_PCB_LISTS
|
#if TCP_DEBUG_PCB_LISTS
|
||||||
#define TCP_REG(pcbs, npcb) do {\
|
#define TCP_REG(pcbs, npcb) do {\
|
||||||
|
struct tcp_pcb *tcp_tmp_pcb; \
|
||||||
LWIP_DEBUGF(TCP_DEBUG, ("TCP_REG %p local port %d\n", (npcb), (npcb)->local_port)); \
|
LWIP_DEBUGF(TCP_DEBUG, ("TCP_REG %p local port %d\n", (npcb), (npcb)->local_port)); \
|
||||||
for (tcp_tmp_pcb = *(pcbs); \
|
for (tcp_tmp_pcb = *(pcbs); \
|
||||||
tcp_tmp_pcb != NULL; \
|
tcp_tmp_pcb != NULL; \
|
||||||
@ -389,6 +389,7 @@ extern struct tcp_pcb *tcp_tmp_pcb; /* Only used for temporary storage. */
|
|||||||
tcp_timer_needed(); \
|
tcp_timer_needed(); \
|
||||||
} while(0)
|
} while(0)
|
||||||
#define TCP_RMV(pcbs, npcb) do { \
|
#define TCP_RMV(pcbs, npcb) do { \
|
||||||
|
struct tcp_pcb *tcp_tmp_pcb; \
|
||||||
LWIP_ASSERT("TCP_RMV: pcbs != NULL", *(pcbs) != NULL); \
|
LWIP_ASSERT("TCP_RMV: pcbs != NULL", *(pcbs) != NULL); \
|
||||||
LWIP_DEBUGF(TCP_DEBUG, ("TCP_RMV: removing %p from %p\n", (npcb), *(pcbs))); \
|
LWIP_DEBUGF(TCP_DEBUG, ("TCP_RMV: removing %p from %p\n", (npcb), *(pcbs))); \
|
||||||
if(*(pcbs) == (npcb)) { \
|
if(*(pcbs) == (npcb)) { \
|
||||||
@ -419,6 +420,7 @@ extern struct tcp_pcb *tcp_tmp_pcb; /* Only used for temporary storage. */
|
|||||||
(*(pcbs)) = (*pcbs)->next; \
|
(*(pcbs)) = (*pcbs)->next; \
|
||||||
} \
|
} \
|
||||||
else { \
|
else { \
|
||||||
|
struct tcp_pcb *tcp_tmp_pcb; \
|
||||||
for (tcp_tmp_pcb = *pcbs; \
|
for (tcp_tmp_pcb = *pcbs; \
|
||||||
tcp_tmp_pcb != NULL; \
|
tcp_tmp_pcb != NULL; \
|
||||||
tcp_tmp_pcb = tcp_tmp_pcb->next) { \
|
tcp_tmp_pcb = tcp_tmp_pcb->next) { \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user