Initialize a few more uninitialized values.

This commit is contained in:
Petter Reinholdtsen 2013-10-13 09:49:25 +02:00
parent 6564449f49
commit 2c3c7527d3
4 changed files with 7 additions and 7 deletions

View File

@ -87,8 +87,8 @@ static int dna_helper_started = 0;
#define DECLARE_SCHED_ENT(FUNCTION, VARIABLE) \
static void FUNCTION(struct sched_ent *alarm); \
static struct profile_total VARIABLE##_timing={.name="" #FUNCTION "",}; \
static struct sched_ent VARIABLE = {.function = FUNCTION, .stats = & VARIABLE##_timing, .poll.fd = -1, };
static struct profile_total VARIABLE##_timing={.name="" #FUNCTION "",._next=NULL,._initialised=0,.max_time=0,.total_time=0,.child_time=0,.calls=0}; \
static struct sched_ent VARIABLE = {.function = FUNCTION, .stats = & VARIABLE##_timing, .poll={.fd=-1, .events=0,.revents=0}};
DECLARE_SCHED_ENT(monitor_requests, sched_requests);
DECLARE_SCHED_ENT(monitor_replies, sched_replies);

View File

@ -30,7 +30,7 @@ int fdcount=0;
struct sched_ent *fd_callbacks[MAX_WATCHED_FDS];
struct sched_ent *next_alarm=NULL;
struct sched_ent *next_deadline=NULL;
struct profile_total poll_stats={NULL,0,"Idle (in poll)",0,0,0};
struct profile_total poll_stats={NULL,0,"Idle (in poll)",0,0,0,0};
#define alloca_alarm_name(alarm) ((alarm)->stats ? alloca_str_toprint((alarm)->stats->name) : "Unnamed")

View File

@ -37,14 +37,14 @@ static struct profile_total mdp_stats = { .name="overlay_mdp_poll" };
static struct sched_ent mdp_sock = {
.function = overlay_mdp_poll,
.stats = &mdp_stats,
.poll.fd = -1,
.poll={.fd = -1,.events=0,.revents=0},
};
static struct profile_total mdp_stats2 = { .name="mdp_poll2" };
static struct sched_ent mdp_sock2 = {
.function = mdp_poll2,
.stats = &mdp_stats2,
.poll.fd = -1,
.poll={.fd = -1,.events=0,.revents=0},
};
static int overlay_saw_mdp_frame(struct overlay_frame *frame, overlay_mdp_frame *mdp, time_ms_t now);
@ -893,6 +893,7 @@ static void overlay_mdp_scan(struct sched_ent *alarm)
struct sockaddr_in addr={
.sin_family=AF_INET,
.sin_port=htons(PORT_DNA),
.sin_addr={0},
};
struct scan_state *state = (struct scan_state *)alarm;
uint32_t stop = state->last;

View File

@ -48,8 +48,7 @@ static struct profile_total read_timing={
static struct sched_ent read_watch={
.function=olsr_read,
.stats=&read_timing,
.poll.fd=-1,
.poll.events=POLLIN,
.poll={.fd=-1,.events=POLLIN,.revents=0},
};
int olsr_init_socket(void){