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

View File

@ -391,7 +391,7 @@ parse_packet(const unsigned char *from, struct interface *ifp,
} else if(type == MESSAGE_HELLO) { } else if(type == MESSAGE_HELLO) {
unsigned short seqno, interval; unsigned short seqno, interval;
int changed; int changed;
unsigned int timestamp; unsigned int timestamp = 0;
DO_NTOHS(seqno, message + 4); DO_NTOHS(seqno, message + 4);
DO_NTOHS(interval, message + 6); DO_NTOHS(interval, message + 6);
debugf(BABEL_DEBUG_COMMON,"Received hello %d (%d) from %s on %s.", 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]) { if (area->spf_timer[level - 1]) {
struct timeval remain = thread_timer_remain( struct timeval remain = thread_timer_remain(
area->spf_timer[level - 1]); area->spf_timer[level - 1]);
vty_out(vty, "Pending, due in %ld msec\n", vty_out(vty, "Pending, due in %lld msec\n",
remain.tv_sec * 1000 (long long)remain.tv_sec * 1000
+ remain.tv_usec / 1000); + remain.tv_usec / 1000);
} else { } else {
vty_out(vty, "Not scheduled\n"); vty_out(vty, "Not scheduled\n");

View File

@ -42,8 +42,10 @@ static struct frrmod_info frrmod_default_info = {
.description = "libfrr core module", .description = "libfrr core module",
}; };
union _frrmod_runtime_u frrmod_default = { union _frrmod_runtime_u frrmod_default = {
.r.info = &frrmod_default_info, .r = {
.r.finished_loading = 1, .info = &frrmod_default_info,
.finished_loading = 1,
},
}; };
// if defined(HAVE_SYS_WEAK_ALIAS_ATTRIBUTE) // 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) { if (backoff->t_holddown) {
struct timeval remain = struct timeval remain =
thread_timer_remain(backoff->t_holddown); thread_timer_remain(backoff->t_holddown);
vty_out(vty, "%s Still runs for %ld msec\n", vty_out(vty, "%s Still runs for %lld msec\n",
prefix, remain.tv_sec * 1000 + remain.tv_usec / 1000); prefix, (long long)remain.tv_sec * 1000
+ remain.tv_usec / 1000);
} else { } else {
vty_out(vty, "%s Inactive\n", prefix); 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) { if (backoff->t_timetolearn) {
struct timeval remain = struct timeval remain =
thread_timer_remain(backoff->t_timetolearn); thread_timer_remain(backoff->t_timetolearn);
vty_out(vty, "%s Still runs for %ld msec\n", vty_out(vty, "%s Still runs for %lld msec\n",
prefix, remain.tv_sec * 1000 + remain.tv_usec / 1000); prefix, (long long)remain.tv_sec * 1000
+ remain.tv_usec / 1000);
} else { } else {
vty_out(vty, "%s Inactive\n", prefix); vty_out(vty, "%s Inactive\n", prefix);
} }

View File

@ -31,48 +31,60 @@ struct ttable_style ttable_styles[] = {
.corner = '+', .corner = '+',
.rownums_on = false, .rownums_on = false,
.indent = 1, .indent = 1,
.border.top = '-', .border = {
.border.bottom = '-', .top = '-',
.border.left = '|', .bottom = '-',
.border.right = '|', .left = '|',
.border.top_on = true, .right = '|',
.border.bottom_on = true, .top_on = true,
.border.left_on = true, .bottom_on = true,
.border.right_on = true, .left_on = true,
.cell.lpad = 1, .right_on = true,
.cell.rpad = 1, },
.cell.align = LEFT, .cell = {
.cell.border.bottom = '-', .lpad = 1,
.cell.border.bottom_on = true, .rpad = 1,
.cell.border.top = '-', .align = LEFT,
.cell.border.top_on = false, .border = {
.cell.border.right = '|', .bottom = '-',
.cell.border.right_on = true, .bottom_on = true,
.cell.border.left = '|', .top = '-',
.cell.border.left_on = false, .top_on = false,
.right = '|',
.right_on = true,
.left = '|',
.left_on = false,
},
},
}, { // blank, suitable for plaintext alignment }, { // blank, suitable for plaintext alignment
.corner = ' ', .corner = ' ',
.rownums_on = false, .rownums_on = false,
.indent = 1, .indent = 1,
.border.top = ' ', .border = {
.border.bottom = ' ', .top = ' ',
.border.left = ' ', .bottom = ' ',
.border.right = ' ', .left = ' ',
.border.top_on = false, .right = ' ',
.border.bottom_on = false, .top_on = false,
.border.left_on = false, .bottom_on = false,
.border.right_on = false, .left_on = false,
.cell.lpad = 0, .right_on = false,
.cell.rpad = 3, },
.cell.align = LEFT, .cell = {
.cell.border.bottom = ' ', .lpad = 0,
.cell.border.bottom_on = false, .rpad = 3,
.cell.border.top = ' ', .align = LEFT,
.cell.border.top_on = false, .border = {
.cell.border.right = ' ', .bottom = ' ',
.cell.border.right_on = false, .bottom_on = false,
.cell.border.left = ' ', .top = ' ',
.cell.border.left_on = false, .top_on = false,
.right = ' ',
.right_on = false,
.left = ' ',
.left_on = false,
},
}
} }
}; };
/* clang-format on */ /* 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_jp_agg_group *group;
struct pim_interface *pim_ifp = NULL; struct pim_interface *pim_ifp = NULL;
struct pim_jp_groups *grp = NULL; struct pim_jp_groups *grp = NULL;
struct pim_jp *msg; struct pim_jp *msg = NULL;
struct listnode *node, *nnode; struct listnode *node, *nnode;
uint8_t pim_msg[10000]; uint8_t pim_msg[10000];
uint8_t *curr_ptr = pim_msg; 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; ifindex_t ifindex;
safi_t safi; safi_t safi;
int ret; int ret;
enum lsp_types_t label_type; enum lsp_types_t label_type = ZEBRA_LSP_NONE;
mpls_label_t label; mpls_label_t label;
struct nexthop *nexthop; struct nexthop *nexthop;