Enable -Weverything, fix a ton of bugs.

This commit is contained in:
Ian Gulliver
2016-02-25 23:37:37 -08:00
parent fe2486c398
commit 19a9d498bd
40 changed files with 220 additions and 184 deletions

View File

@@ -12,7 +12,9 @@ static struct stats_state {
uint64_t total_count;
uint64_t type_count[NUM_TYPES];
struct timespec start;
} stats_state = { 0 };
} stats_state = {
.type_count = { 0 },
};
void stats_init() {
assert(!clock_gettime(CLOCK_MONOTONIC_COARSE, &stats_state.start));
@@ -31,7 +33,7 @@ void stats_serialize(struct packet *packet, struct buf *buf) {
if (i == PACKET_TYPE_NONE) {
continue;
}
json_object_set_new(counts, packet_type_names[i], json_integer(stats_state.type_count[i]));
json_object_set_new(counts, packet_type_names[i], json_integer((json_int_t) stats_state.type_count[i]));
}
struct timespec now;
assert(!clock_gettime(CLOCK_MONOTONIC_COARSE, &now));