*: fix compiler warnings

Specifically, gcc 4.2.1 on OpenBSD 6.0 warns about these;  they're bogus
(gcc 4.2, being rather old, isn't quite as "intelligent" as newer
versions; the newer ones apply more logic and less warnings.)

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
David Lamparter 2017-08-26 01:14:25 +02:00
parent e1bd637370
commit a97986ffba
8 changed files with 67 additions and 51 deletions

View File

@ -331,8 +331,8 @@ babel_main_loop(struct thread *thread)
/* if there is no timeout, we must wait. */
if(timeval_compare(&tv, &babel_now) > 0) {
timeval_minus(&tv, &tv, &babel_now);
debugf(BABEL_DEBUG_TIMEOUT, "babel main loop : timeout: %ld msecs",
tv.tv_sec * 1000 + tv.tv_usec / 1000);
debugf(BABEL_DEBUG_TIMEOUT, "babel main loop : timeout: %lld msecs",
(long long)tv.tv_sec * 1000 + tv.tv_usec / 1000);
/* it happens often to have less than 1 ms, it's bad. */
timeval_add_msec(&tv, &tv, 300);
babel_set_timer(&tv);

View File

@ -391,7 +391,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
} else if(type == MESSAGE_HELLO) {
unsigned short seqno, interval;
int changed;
unsigned int timestamp;
unsigned int timestamp = 0;
DO_NTOHS(seqno, message + 4);
DO_NTOHS(interval, message + 6);
debugf(BABEL_DEBUG_COMMON,"Received hello %d (%d) from %s on %s.",

View File

@ -1260,8 +1260,8 @@ DEFUN (show_isis_spf_ietf,
if (area->spf_timer[level - 1]) {
struct timeval remain = thread_timer_remain(
area->spf_timer[level - 1]);
vty_out(vty, "Pending, due in %ld msec\n",
remain.tv_sec * 1000
vty_out(vty, "Pending, due in %lld msec\n",
(long long)remain.tv_sec * 1000
+ remain.tv_usec / 1000);
} else {
vty_out(vty, "Not scheduled\n");

View File

@ -42,8 +42,10 @@ static struct frrmod_info frrmod_default_info = {
.description = "libfrr core module",
};
union _frrmod_runtime_u frrmod_default = {
.r.info = &frrmod_default_info,
.r.finished_loading = 1,
.r = {
.info = &frrmod_default_info,
.finished_loading = 1,
},
};
// if defined(HAVE_SYS_WEAK_ALIAS_ATTRIBUTE)

View File

@ -226,8 +226,9 @@ void spf_backoff_show(struct spf_backoff *backoff, struct vty *vty,
if (backoff->t_holddown) {
struct timeval remain =
thread_timer_remain(backoff->t_holddown);
vty_out(vty, "%s Still runs for %ld msec\n",
prefix, remain.tv_sec * 1000 + remain.tv_usec / 1000);
vty_out(vty, "%s Still runs for %lld msec\n",
prefix, (long long)remain.tv_sec * 1000
+ remain.tv_usec / 1000);
} else {
vty_out(vty, "%s Inactive\n", prefix);
}
@ -237,8 +238,9 @@ void spf_backoff_show(struct spf_backoff *backoff, struct vty *vty,
if (backoff->t_timetolearn) {
struct timeval remain =
thread_timer_remain(backoff->t_timetolearn);
vty_out(vty, "%s Still runs for %ld msec\n",
prefix, remain.tv_sec * 1000 + remain.tv_usec / 1000);
vty_out(vty, "%s Still runs for %lld msec\n",
prefix, (long long)remain.tv_sec * 1000
+ remain.tv_usec / 1000);
} else {
vty_out(vty, "%s Inactive\n", prefix);
}

View File

@ -31,48 +31,60 @@ struct ttable_style ttable_styles[] = {
.corner = '+',
.rownums_on = false,
.indent = 1,
.border.top = '-',
.border.bottom = '-',
.border.left = '|',
.border.right = '|',
.border.top_on = true,
.border.bottom_on = true,
.border.left_on = true,
.border.right_on = true,
.cell.lpad = 1,
.cell.rpad = 1,
.cell.align = LEFT,
.cell.border.bottom = '-',
.cell.border.bottom_on = true,
.cell.border.top = '-',
.cell.border.top_on = false,
.cell.border.right = '|',
.cell.border.right_on = true,
.cell.border.left = '|',
.cell.border.left_on = false,
.border = {
.top = '-',
.bottom = '-',
.left = '|',
.right = '|',
.top_on = true,
.bottom_on = true,
.left_on = true,
.right_on = true,
},
.cell = {
.lpad = 1,
.rpad = 1,
.align = LEFT,
.border = {
.bottom = '-',
.bottom_on = true,
.top = '-',
.top_on = false,
.right = '|',
.right_on = true,
.left = '|',
.left_on = false,
},
},
}, { // blank, suitable for plaintext alignment
.corner = ' ',
.rownums_on = false,
.indent = 1,
.border.top = ' ',
.border.bottom = ' ',
.border.left = ' ',
.border.right = ' ',
.border.top_on = false,
.border.bottom_on = false,
.border.left_on = false,
.border.right_on = false,
.cell.lpad = 0,
.cell.rpad = 3,
.cell.align = LEFT,
.cell.border.bottom = ' ',
.cell.border.bottom_on = false,
.cell.border.top = ' ',
.cell.border.top_on = false,
.cell.border.right = ' ',
.cell.border.right_on = false,
.cell.border.left = ' ',
.cell.border.left_on = false,
.border = {
.top = ' ',
.bottom = ' ',
.left = ' ',
.right = ' ',
.top_on = false,
.bottom_on = false,
.left_on = false,
.right_on = false,
},
.cell = {
.lpad = 0,
.rpad = 3,
.align = LEFT,
.border = {
.bottom = ' ',
.bottom_on = false,
.top = ' ',
.top_on = false,
.right = ' ',
.right_on = false,
.left = ' ',
.left_on = false,
},
}
}
};
/* clang-format on */

View File

@ -414,7 +414,7 @@ int pim_joinprune_send(struct pim_rpf *rpf, struct list *groups)
struct pim_jp_agg_group *group;
struct pim_interface *pim_ifp = NULL;
struct pim_jp_groups *grp = NULL;
struct pim_jp *msg;
struct pim_jp *msg = NULL;
struct listnode *node, *nnode;
uint8_t pim_msg[10000];
uint8_t *curr_ptr = pim_msg;

View File

@ -1198,7 +1198,7 @@ static int zread_ipv4_add(struct zserv *client, u_short length,
ifindex_t ifindex;
safi_t safi;
int ret;
enum lsp_types_t label_type;
enum lsp_types_t label_type = ZEBRA_LSP_NONE;
mpls_label_t label;
struct nexthop *nexthop;