Changed initialization: many init functions are not needed any more since we now rely on the compiler initializing global and static variables to zero!

This commit is contained in:
goldsimon
2007-10-09 19:59:56 +00:00
parent 536f2e42d2
commit 199648ff37
23 changed files with 35 additions and 117 deletions

View File

@@ -113,8 +113,6 @@ igmp_init(void)
IP4_ADDR(&allsystems, 224, 0, 0, 1);
IP4_ADDR(&allrouters, 224, 0, 0, 2);
igmp_group_list = NULL;
}
#ifdef LWIP_DEBUG

View File

@@ -55,17 +55,6 @@
#include "lwip/stats.h"
#include "arch/perf.h"
/**
* Initializes the IP layer.
*/
void
ip_init(void)
{
#if IP_REASSEMBLY
ip_reass_init();
#endif
}
/**
* Finds the appropriate network interface for a given IP address. It
* searches the list of network interfaces linearly. A match is found

View File

@@ -85,14 +85,6 @@ static u16_t ip_reass_pbufcount;
/* function prototypes */
static void dequeue_packet(struct ip_reassdata *ipr, struct ip_reassdata *prev);
/**
* Initializes IP reassembly states.
*/
void
ip_reass_init(void)
{
}
/**
* Reassembly timer base function
* for both NO_SYS == 0 and 1 (!).

View File

@@ -206,7 +206,6 @@ mem_init(void)
(SIZEOF_STRUCT_MEM & (MEM_ALIGNMENT-1)) == 0);
/* align the heap */
memset(ram_heap, 0, sizeof(ram_heap));
ram = LWIP_MEM_ALIGN(ram_heap);
/* initialize the start of the heap */
mem = (struct mem *)ram;

View File

@@ -61,15 +61,6 @@
struct netif *netif_list = NULL;
struct netif *netif_default = NULL;
/**
* Initialize this module
*/
void
netif_init(void)
{
netif_list = netif_default = NULL;
}
/**
* Add a network interface to the list of lwIP netifs.
*

View File

@@ -55,16 +55,7 @@
#include <string.h>
/** The list of RAW PCBs */
static struct raw_pcb *raw_pcbs = NULL;
/**
* Initialize this module
*/
void
raw_init(void)
{
raw_pcbs = NULL;
}
static struct raw_pcb *raw_pcbs;
/**
* Determine if in incoming IP packet is covered by a RAW PCB

View File

@@ -53,7 +53,7 @@ struct nse
/** right child next level */
u8_t r_nl;
};
static u8_t node_stack_cnt = 0;
static u8_t node_stack_cnt;
static struct nse node_stack[NODE_STACK_SIZE];
/**

View File

@@ -56,7 +56,7 @@ const char snmp_publiccommunity[7] = "public";
/* statically allocated buffers for SNMP_CONCURRENT_REQUESTS */
struct snmp_msg_pstat msg_input_list[SNMP_CONCURRENT_REQUESTS];
/* UDP Protocol Control Block */
struct udp_pcb *snmp1_pcb = NULL;
struct udp_pcb *snmp1_pcb;
static void snmp_recv(void *arg, struct udp_pcb *pcb, struct pbuf *p, struct ip_addr *addr, u16_t port);
static err_t snmp_pdu_header_check(struct pbuf *p, u16_t ofs, u16_t pdu_len, u16_t *ofs_ret, struct snmp_msg_pstat *m_stat);

View File

@@ -48,11 +48,6 @@
struct stats_ lwip_stats;
void
stats_init(void)
{
memset(&lwip_stats, 0, sizeof(struct stats_));
}
#if LWIP_STATS_DISPLAY
void
stats_display_proto(struct stats_proto *proto, char *name)

View File

@@ -74,25 +74,6 @@ struct tcp_pcb *tcp_tmp_pcb;
static u8_t tcp_timer;
static u16_t tcp_new_port(void);
/**
* Initializes the TCP layer.
*/
void
tcp_init(void)
{
/* Clear globals. */
tcp_bound_pcbs = NULL;
tcp_listen_pcbs.listen_pcbs = NULL;
tcp_active_pcbs = NULL;
tcp_tw_pcbs = NULL;
tcp_tmp_pcb = NULL;
/* initialize timer */
tcp_ticks = 0;
tcp_timer = 0;
}
/**
* Called periodically to dispatch TCP timers.
*

View File

@@ -65,16 +65,7 @@
/* The list of UDP PCBs */
/* exported in udp.h (was static) */
struct udp_pcb *udp_pcbs = NULL;
/**
* Initialize the UDP module
*/
void
udp_init(void)
{
udp_pcbs = NULL;
}
struct udp_pcb *udp_pcbs;
/**
* Process an incoming UDP datagram.