From 2c3c7527d395be13c577c1251367f2fc4ab71263 Mon Sep 17 00:00:00 2001 From: Petter Reinholdtsen <pere@hungry.com> Date: Sun, 13 Oct 2013 09:49:25 +0200 Subject: [PATCH] Initialize a few more uninitialized values. --- dna_helper.c | 4 ++-- fdqueue.c | 2 +- overlay_mdp.c | 5 +++-- overlay_olsr.c | 3 +-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/dna_helper.c b/dna_helper.c index d1d18b42..a2962978 100644 --- a/dna_helper.c +++ b/dna_helper.c @@ -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); diff --git a/fdqueue.c b/fdqueue.c index 1ef8aea4..8f8a002b 100644 --- a/fdqueue.c +++ b/fdqueue.c @@ -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") diff --git a/overlay_mdp.c b/overlay_mdp.c index d18800b1..18cdbf27 100644 --- a/overlay_mdp.c +++ b/overlay_mdp.c @@ -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; diff --git a/overlay_olsr.c b/overlay_olsr.c index 6eec98cd..cff3b420 100644 --- a/overlay_olsr.c +++ b/overlay_olsr.c @@ -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){