From: Donald Sharp Date: Mon, 27 Jul 2015 20:19:12 +0000 (-0700) Subject: Fixup compiler warnings for powerpc X-Git-Tag: frr-2.0-rc1~1292^2 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=ee046671d35c550f594c2b3c1e611cdcf7c095fe;p=matthieu%2Ffrr.git Fixup compiler warnings for powerpc The turn-on of -Werror was never run fully against powerpc. there were some powerpc specific issues that turned up. This commit fixes these issues. --- diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index 78c58de8e6..6706c8544b 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -872,11 +872,11 @@ static route_map_result_t route_match_probability (void *rule, struct prefix *prefix, route_map_object_t type, void *object) { - long r; + unsigned long r; #if _SVID_SOURCE || _BSD_SOURCE || _XOPEN_SOURCE >= 500 r = random(); #else - r = (long) rand(); + r = (unsigned long) rand(); #endif switch (*(unsigned *) rule) diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 5f12876b65..9ed641fada 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -8613,7 +8613,7 @@ bgp_show_summary (struct vty *vty, struct bgp *bgp, int afi, int safi, vty_out (vty, "4 "); - vty_out (vty, "%5u %7d %7d %8lu %4d %4ld ", + vty_out (vty, "%5u %7d %7d %8" PRIu64 " %4d %4zd ", peer->as, peer->open_in + peer->update_in + peer->keepalive_in + peer->notify_in + peer->refresh_in diff --git a/isisd/isis_pdu.c b/isisd/isis_pdu.c index e783293a06..b47a8646ea 100644 --- a/isisd/isis_pdu.c +++ b/isisd/isis_pdu.c @@ -1253,7 +1253,7 @@ out: if (isis->debugs & DEBUG_ADJ_PACKETS) { zlog_debug ("ISIS-Adj (%s): Rcvd L%d LAN IIH from %s on %s, cirType %s, " - "cirID %u, length %ld", + "cirID %u, length %zd", circuit->area->area_tag, level, snpa_print (ssnpa), circuit->interface->name, circuit_t2string (circuit->is_type), @@ -2707,7 +2707,7 @@ send_csnp (struct isis_circuit *circuit, int level) if (isis->debugs & DEBUG_SNP_PACKETS) { - zlog_debug ("ISIS-Snp (%s): Sent L%d CSNP on %s, length %ld", + zlog_debug ("ISIS-Snp (%s): Sent L%d CSNP on %s, length %zd", circuit->area->area_tag, level, circuit->interface->name, stream_get_endp (circuit->snd_stream)); for (ALL_LIST_ELEMENTS_RO (list, node, lsp)) @@ -2956,7 +2956,7 @@ send_psnp (int level, struct isis_circuit *circuit) if (isis->debugs & DEBUG_SNP_PACKETS) { - zlog_debug ("ISIS-Snp (%s): Sent L%d PSNP on %s, length %ld", + zlog_debug ("ISIS-Snp (%s): Sent L%d PSNP on %s, length %zd", circuit->area->area_tag, level, circuit->interface->name, stream_get_endp (circuit->snd_stream)); diff --git a/ospf6d/ospf6_intra.c b/ospf6d/ospf6_intra.c index eafde433f0..5494c4a328 100644 --- a/ospf6d/ospf6_intra.c +++ b/ospf6d/ospf6_intra.c @@ -243,9 +243,9 @@ ospf6_router_lsa_originate (struct thread *thread) /* Multiple Router-LSA instance according to size limit setting */ if ( (oa->router_lsa_size_limit != 0) - && ((caddr_t) lsdesc + sizeof (struct ospf6_router_lsdesc) - - /* XXX warning: comparison between signed and unsigned */ - (caddr_t) buffer > oa->router_lsa_size_limit)) + && ((size_t)((char *)lsdesc - buffer) + + sizeof (struct ospf6_router_lsdesc) + > oa->router_lsa_size_limit)) { if ((caddr_t) lsdesc == (caddr_t) router_lsa + sizeof (struct ospf6_router_lsa)) diff --git a/ospf6d/ospf6_lsa.c b/ospf6d/ospf6_lsa.c index 4a4fa0f9f0..3185aa6f79 100644 --- a/ospf6d/ospf6_lsa.c +++ b/ospf6d/ospf6_lsa.c @@ -493,8 +493,8 @@ ospf6_lsa_show_internal (struct vty *vty, struct ospf6_lsa *lsa) vty_out (vty, "Flag: %x %s", lsa->flag, VNL); vty_out (vty, "Lock: %d %s", lsa->lock, VNL); vty_out (vty, "ReTx Count: %d%s", lsa->retrans_count, VNL); - vty_out (vty, "Threads: Expire: %llx, Refresh: %llx %s", - (unsigned long long)lsa->expire, (unsigned long long)lsa->refresh, VNL); + vty_out (vty, "Threads: Expire: %p, Refresh: %p %s", + lsa->expire, lsa->refresh, VNL); vty_out (vty, "%s", VNL); return; }