]> git.puffer.fish Git - mirror/frr.git/commitdiff
[cleanup] Fix compile warnings
authorStephen Hemminger <stephen.hemminger@vyatta.com>
Fri, 15 May 2009 16:48:55 +0000 (09:48 -0700)
committerPaul Jakma <paul@quagga.net>
Thu, 18 Jun 2009 19:18:29 +0000 (20:18 +0100)
Fix printf format warning and make capability table 'const static'

bgpd/bgp_open.c

index 84d8191eab76f9642c25cc4350481c960ae7f645..540edad0efeffd5e0cc5737725cb51bbabc7992f 100644 (file)
@@ -441,7 +441,7 @@ bgp_capability_as4 (struct peer *peer, struct capability_header *hdr)
   return as4;
 }
 
-static struct message capcode_str[] =
+static const struct message capcode_str[] =
 {
   { CAPABILITY_CODE_MP,                        "MultiProtocol Extensions"      },
   { CAPABILITY_CODE_REFRESH,           "Route Refresh"                 },
@@ -452,10 +452,10 @@ static struct message capcode_str[] =
   { CAPABILITY_CODE_REFRESH_OLD,       "Route Refresh (Old)"           },
   { CAPABILITY_CODE_ORF_OLD,           "ORF (Old)"                     },
 };
-int capcode_str_max = sizeof(capcode_str)/sizeof(capcode_str[0]);
+static const int capcode_str_max = sizeof(capcode_str)/sizeof(capcode_str[0]);
 
 /* Minimum sizes for length field of each cap (so not inc. the header) */
-static size_t cap_minsizes[] = 
+static const size_t cap_minsizes[] = 
 {
   [CAPABILITY_CODE_MP]         = sizeof (struct capability_mp_data),
   [CAPABILITY_CODE_REFRESH]    = CAPABILITY_CODE_REFRESH_LEN,
@@ -529,7 +529,8 @@ bgp_capability_parse (struct peer *peer, size_t length, u_char **error)
                              " expected at least %u",
                              peer->host, 
                              LOOKUP (capcode_str, caphdr.code),
-                             caphdr.length, cap_minsizes[caphdr.code]);
+                             caphdr.length, 
+                            (unsigned) cap_minsizes[caphdr.code]);
                   bgp_notify_send (peer, BGP_NOTIFY_CEASE, 0);
                   return -1;
                 }