Make code to avoid compiler warnings about uninitialized variables simpler. Fix some more.

This commit is contained in:
Petter Reinholdtsen 2013-10-13 22:55:24 +02:00
parent 3fd6cafe9f
commit fde6dc210f
4 changed files with 11 additions and 9 deletions

View File

@ -88,7 +88,7 @@ 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 "",._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}};
static struct sched_ent VARIABLE = {.function = FUNCTION, .stats = & VARIABLE##_timing, .poll={.fd=-1}};
DECLARE_SCHED_ENT(monitor_requests, sched_requests);
DECLARE_SCHED_ENT(monitor_replies, sched_replies);

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,.events=0,.revents=0},
.poll={.fd = -1},
};
static struct profile_total mdp_stats2 = { .name="mdp_poll2" };
static struct sched_ent mdp_sock2 = {
.function = mdp_poll2,
.stats = &mdp_stats2,
.poll={.fd = -1,.events=0,.revents=0},
.poll={.fd = -1},
};
static int overlay_saw_mdp_frame(struct overlay_frame *frame, overlay_mdp_frame *mdp, time_ms_t now);

View File

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

View File

@ -330,17 +330,19 @@ int app_vomp_console(const struct cli_parsed *parsed, struct cli_context *contex
.name="read_lines",
};
struct line_state stdin_state={
.alarm.poll.fd = STDIN_FILENO,
.alarm.poll.events = POLLIN,
.alarm.function = read_lines,
.alarm.stats=&stdin_profile,
.alarm = {
.poll = {.fd = STDIN_FILENO,.events = POLLIN},
.function = read_lines,
.stats=&stdin_profile
},
.fd=0,
.process_line=console_command,
};
static struct profile_total monitor_profile={
.name="monitor_read",
};
struct sched_ent monitor_alarm={
.poll.events = POLLIN,
.poll = {.fd = STDIN_FILENO,.events = POLLIN},
.function = monitor_read,
.stats=&monitor_profile,
};