]> git.puffer.fish Git - mirror/frr.git/commitdiff
general: remove inline qualifiers and move in-header functions to objects
authorPaul Jakma <paul@quagga.net>
Fri, 8 Apr 2011 11:44:43 +0000 (12:44 +0100)
committerPaul Jakma <paul@quagga.net>
Fri, 6 Jan 2012 16:18:18 +0000 (16:18 +0000)
* (general) Move functions in headers into files, to be compiled into
  shared object files. Remove inline qualifier from functions. Let the
  compiler do the work.

bgpd/bgp_aspath.c
bgpd/bgpd.c
lib/prefix.c
lib/prefix.h
lib/thread.c
lib/workqueue.c
ospfd/ospf_lsa.c
ospfd/ospf_packet.c
zebra/interface.c

index ba4f5b48b8dc1d49973b8f6d3339cec1ba58079f..776c7127e5786228ba49b6bc3b3f27192be68b8a 100644 (file)
@@ -91,13 +91,13 @@ static struct hash *ashash;
 /* Stream for SNMP. See aspath_snmp_pathseg */
 static struct stream *snmp_stream;
 \f
-static inline as_t *
+static as_t *
 assegment_data_new (int num)
 {
   return (XCALLOC (MTYPE_AS_SEG_DATA, ASSEGMENT_DATA_SIZE (num, 1)));
 }
 
-static inline void
+static void
 assegment_data_free (as_t *asdata)
 {
   XFREE (MTYPE_AS_SEG_DATA,asdata);
@@ -812,7 +812,7 @@ aspath_parse (struct stream *s, size_t length, int use32bit)
   return find;
 }
 
-static inline void
+static void
 assegment_data_put (struct stream *s, as_t *as, int num, int use32bit)
 {
   int i;
@@ -830,7 +830,7 @@ assegment_data_put (struct stream *s, as_t *as, int num, int use32bit)
       }
 }
 
-static inline size_t
+static size_t
 assegment_header_put (struct stream *s, u_char type, int length)
 {
   size_t lenp;
index a75fb9390f0694d6e020e1dbf6ad3ad2c051fe92..5dc014be9bcb37faa084d9f4e07005e7bca5b312 100644 (file)
@@ -695,7 +695,7 @@ peer_sort (struct peer *peer)
     }
 }
 
-static inline void
+static void
 peer_free (struct peer *peer)
 {
   assert (peer->status == Deleted);
index 1b1c6626717573fef1093366829b0f5de3a5d961..3ab67f3d5ab4b40f380fe765b82798ece19ae6ea 100644 (file)
@@ -2317,6 +2317,21 @@ static const char map64kto17_nbo[0xffff + 1] =
 
 #define MASKBIT(offset)  ((0xff << (PNBBY - (offset))) & 0xff)
 
+unsigned int
+prefix_bit (const u_char *prefix, const u_char prefixlen)
+{
+  unsigned int offset = prefixlen / 8;
+  unsigned int shift  = 7 - (prefixlen % 8);
+  
+  return (prefix[offset] >> shift) & 1;
+}
+
+unsigned int
+prefix6_bit (const struct in6_addr *prefix, const u_char prefixlen)
+{
+  return prefix_bit((const u_char *) &prefix->s6_addr, prefixlen);
+}
+\f
 /* Address Famiy Identifier to Address Family converter. */
 int
 afi2family (afi_t afi)
index dab4202ea817a6780f65151f8d3826d87828edbf..7f0d36070b181f32de527c12b8134c375c16fa62 100644 (file)
@@ -128,26 +128,14 @@ struct prefix_rd
 /* Prefix's family member. */
 #define PREFIX_FAMILY(p)  ((p)->family)
 
-/* Check bit of the prefix. */
-static inline unsigned int
-prefix_bit (const u_char *prefix, const u_char prefixlen)
-{
-  unsigned int offset = prefixlen / 8;
-  unsigned int shift  = 7 - (prefixlen % 8);
-
-  return (prefix[offset] >> shift) & 1;
-}
-
-static inline unsigned int
-prefix6_bit (const struct in6_addr *prefix, const u_char prefixlen)
-{
-  return prefix_bit((const u_char *) &prefix->s6_addr, prefixlen);
-}
-
 /* Prototypes. */
 extern int afi2family (afi_t);
 extern afi_t family2afi (int);
 
+/* Check bit of the prefix. */
+extern unsigned int prefix_bit (const u_char *prefix, const u_char prefixlen);
+extern unsigned int prefix6_bit (const struct in6_addr *prefix, const u_char prefixlen);
+
 extern struct prefix *prefix_new (void);
 extern void prefix_free (struct prefix *);
 extern const char *prefix_family_str (const struct prefix *);
index fd841c2153998ef386a4e0c4ceb952fdcf1f69e4..6d3c3cb38602c8a51562282e9dda80315a1e8a16 100644 (file)
@@ -248,7 +248,7 @@ cpu_record_hash_free (void *a)
   XFREE (MTYPE_THREAD_STATS, hist);
 }
 
-static inline void 
+static void 
 vty_out_cpu_thread_history(struct vty* vty,
                           struct cpu_thread_history *a)
 {
@@ -608,7 +608,7 @@ thread_master_free (struct thread_master *m)
 }
 
 /* Thread list is empty or not.  */
-static inline int
+static int
 thread_empty (struct thread_list *list)
 {
   return  list->head ? 0 : 1;
index 52b5f41c5a6aee41f976b0c1e2932411b3eecb4b..61643bf814003a1a08c8101a4d59b51e41052504 100644 (file)
@@ -103,7 +103,7 @@ work_queue_free (struct work_queue *wq)
   return;
 }
 
-static inline int
+static int
 work_queue_schedule (struct work_queue *wq, unsigned int delay)
 {
   /* if appropriate, schedule work queue thread */
index a2d400fa3a6cce5714c1f30bea3727700a1d6f05..fa36a0276684009be05e98b690791f0cb7189c36 100644 (file)
@@ -746,7 +746,7 @@ ospf_stub_router_timer (struct thread *t)
   return 0;
 }
 
-inline static void
+static void
 ospf_stub_router_check (struct ospf_area *area)
 {
   /* area must either be administratively configured to be stub
index 070508240a49f129e6323c10e8718f9d61e6a86a..b714c27de0f73e33bd95d79967d76eea2218fffb 100644 (file)
@@ -266,7 +266,7 @@ ospf_packet_dup (struct ospf_packet *op)
 }
 
 /* XXX inline */
-static inline unsigned int
+static unsigned int
 ospf_packet_authspace (struct ospf_interface *oi)
 {
   int auth = 0;
@@ -2213,7 +2213,7 @@ ospf_associate_packet_vl (struct ospf *ospf, struct interface *ifp,
   return NULL;
 }
 
-static inline int
+static int
 ospf_check_area_id (struct ospf_interface *oi, struct ospf_header *ospfh)
 {
   /* Check match the Area ID of the receiving interface. */
index 03e7ff71386695f20702ac297c6031fc0ac0542b..933d6425459d9bc50dc52673ceb66c530fa5d0c5 100644 (file)
@@ -216,7 +216,7 @@ if_subnet_delete (struct interface *ifp, struct connected *ifc)
  * interface will affect only the primary interface/address on Solaris.
  ************************End Solaris flags hacks ***********************
  */
-static inline void
+static void
 if_flags_mangle (struct interface *ifp, uint64_t *newflags)
 {
 #ifdef SUNOS_5