]> git.puffer.fish Git - matthieu/frr.git/commitdiff
Fixup compiler warnings for powerpc
authorDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 27 Jul 2015 20:19:12 +0000 (13:19 -0700)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 27 Jul 2015 20:19:12 +0000 (13:19 -0700)
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.

bgpd/bgp_routemap.c
bgpd/bgp_vty.c
isisd/isis_pdu.c
ospf6d/ospf6_intra.c
ospf6d/ospf6_lsa.c

index 78c58de8e6101a12478d7b0e4fd87796a18d3533..6706c8544b6ae7a97c8c81f11b57a7dc1adf779a 100644 (file)
@@ -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)
index 5f12876b653af10cde5660d5a02fee80ad34ff8a..9ed641fadad60519aea5212534f947b2501e98fa 100644 (file)
@@ -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
index e783293a069b9ef2ca281ac9862fd6e074f58b2a..b47a8646eac38b7bf69414e3fbbf09b0106cecaf 100644 (file)
@@ -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));
index eafde433f0b38d94e0904c6e73c9c38654d061e2..5494c4a3285088905a1b3cfe99a14415134daed7 100644 (file)
@@ -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))
index 4a4fa0f9f08fcea3ef3068ff4cf3ab5cb428952d..3185aa6f798ceda06efb6c552f2a2b94750c9c25 100644 (file)
@@ -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;
 }