]> git.puffer.fish Git - mirror/frr.git/commitdiff
[bgpd] Fix warnings: hash callbacks should match hash API declarations
authorPaul Jakma <paul.jakma@sun.com>
Sun, 29 Apr 2007 18:25:17 +0000 (18:25 +0000)
committerPaul Jakma <paul.jakma@sun.com>
Sun, 29 Apr 2007 18:25:17 +0000 (18:25 +0000)
2007-04-22 Sebastien Tandel <sebastien@tandel.be>

* bgp_advertise.c : (baa_hash_alloc, baa_hash_key, baa_hash_cmp)
  conforms to quagga hash API. Defines _hash_[alloc|key|cmp] with
  void * arguments as defined by the API.
* bgp_aspath.c,h : (aspath_key_make) conforms to quagga hash API.
  Defines _hash_[alloc|key|cmp] with void * arguments as defined by
  the API.
* bgp_attr.c,h : (cluster_hash_alloc, cluster_hash_key_make,
  cluster_hash_cmp, transit_hash_alloc, transit_hash_key_make,
  transit_hash_cmp, attrhash_key_make, attrhash_cmp,
  bgp_attr_hash_alloc) conforms to quagga hash API. Defines
  _hash_[alloc|key|cmp] with void * arguments as defined by the API.

bgpd/ChangeLog
bgpd/bgp_advertise.c
bgpd/bgp_aspath.c
bgpd/bgp_aspath.h
bgpd/bgp_attr.c
bgpd/bgp_attr.h

index 37ca2fb40b50102c66a19e7f14f30bb9cc79cc27..2267e0fac517dbdd24cbf76eeadaf537867936d9 100644 (file)
@@ -1,3 +1,17 @@
+2007-04-22 Sebastien Tandel <sebastien@tandel.be>
+
+       * bgp_advertise.c : (baa_hash_alloc, baa_hash_key, baa_hash_cmp)
+         conforms to quagga hash API. Defines _hash_[alloc|key|cmp] with
+         void * arguments as defined by the API.
+       * bgp_aspath.c,h : (aspath_key_make) conforms to quagga hash API.
+         Defines _hash_[alloc|key|cmp] with void * arguments as defined by
+         the API.
+       * bgp_attr.c,h : (cluster_hash_alloc, cluster_hash_key_make,
+         cluster_hash_cmp, transit_hash_alloc, transit_hash_key_make,
+         transit_hash_cmp, attrhash_key_make, attrhash_cmp,
+         bgp_attr_hash_alloc) conforms to quagga hash API. Defines
+         _hash_[alloc|key|cmp] with void * arguments as defined by the API.
+
 2007-04-15 Sebastien Tandel <sebastien@tandel.be>
 
        * bgp_aspath.c: (aspath_as_add, aspath_segment_add) Minor performance
index 3a40b1a729153d4d687f1dd0cdaaa32f4b809f2a..73b868a82b0218f72e6705ada8564c7006ef17ef 100644 (file)
@@ -53,8 +53,9 @@ baa_free (struct bgp_advertise_attr *baa)
 }
 
 static void *
-baa_hash_alloc (struct bgp_advertise_attr *ref)
+baa_hash_alloc (void *p)
 {
+  struct bgp_advertise_attr * ref = (struct bgp_advertise_attr *) p;
   struct bgp_advertise_attr *baa;
 
   baa = baa_new ();
@@ -63,14 +64,19 @@ baa_hash_alloc (struct bgp_advertise_attr *ref)
 }
 
 static unsigned int
-baa_hash_key (struct bgp_advertise_attr *baa)
+baa_hash_key (void *p)
 {
+  struct bgp_advertise_attr * baa = (struct bgp_advertise_attr *) p;
+
   return attrhash_key_make (baa->attr);
 }
 
 static int
-baa_hash_cmp (struct bgp_advertise_attr *baa1, struct bgp_advertise_attr *baa2)
+baa_hash_cmp (void *p1, void *p2)
 {
+  struct bgp_advertise_attr * baa1 = (struct bgp_advertise_attr *) p1;
+  struct bgp_advertise_attr * baa2 = (struct bgp_advertise_attr *) p2;
+
   return attrhash_cmp (baa1->attr, baa2->attr);
 }
 \f
index 1f522d79ca4ac6edd843f26efcde7bb9d831034a..b328e38a5b2c324327ab96dd54c1be363ad38570 100644 (file)
@@ -1447,8 +1447,9 @@ aspath_str2aspath (const char *str)
 \f
 /* Make hash value by raw aspath data. */
 unsigned int
-aspath_key_make (struct aspath *aspath)
+aspath_key_make (void *p)
 {
+  struct aspath * aspath = (struct aspath *) p;
   unsigned int key = 0;
   unsigned int i;
   struct assegment *seg = aspath->segments;
index 5400c57c1cb7a9db0ec0ddef909f0cc460d14da8..efec24c2e985c92c62ed963f0b1c2c6ccdd97e42 100644 (file)
@@ -79,7 +79,7 @@ extern void aspath_unintern (struct aspath *);
 extern const char *aspath_print (struct aspath *);
 extern void aspath_print_vty (struct vty *, const char *, struct aspath *);
 extern void aspath_print_all_vty (struct vty *);
-extern unsigned int aspath_key_make (struct aspath *);
+extern unsigned int aspath_key_make (void *);
 extern int aspath_loop_check (struct aspath *, as_t);
 extern int aspath_private_as_check (struct aspath *);
 extern int aspath_firstas_check (struct aspath *, as_t);
index fc25d213079eacaa90f42f55295f1d1d73d00d82..b30c86ae1ed6ce9390a2da145b34b5aee97ae92b 100644 (file)
@@ -63,8 +63,9 @@ int attr_str_max = sizeof(attr_str)/sizeof(attr_str[0]);
 struct hash *cluster_hash;
 
 static void *
-cluster_hash_alloc (struct cluster_list *val)
+cluster_hash_alloc (void *p)
 {
+  struct cluster_list * val = (struct cluster_list *) p;
   struct cluster_list *cluster;
 
   cluster = XMALLOC (MTYPE_CLUSTER, sizeof (struct cluster_list));
@@ -110,8 +111,9 @@ cluster_loop_check (struct cluster_list *cluster, struct in_addr originator)
 }
 
 static unsigned int
-cluster_hash_key_make (struct cluster_list *cluster)
+cluster_hash_key_make (void *p)
 {
+  struct cluster_list * cluster = (struct cluster_list *) p;
   unsigned int key = 0;
   int length;
   caddr_t pnt;
@@ -126,8 +128,11 @@ cluster_hash_key_make (struct cluster_list *cluster)
 }
 
 static int
-cluster_hash_cmp (struct cluster_list *cluster1, struct cluster_list *cluster2)
+cluster_hash_cmp (void *p1, void *p2)
 {
+  struct cluster_list * cluster1 = (struct cluster_list *) p1;
+  struct cluster_list * cluster2 = (struct cluster_list *) p2;
+
   if (cluster1->length == cluster2->length &&
       memcmp (cluster1->list, cluster2->list, cluster1->length) == 0)
     return 1;
@@ -205,11 +210,12 @@ transit_free (struct transit *transit)
   XFREE (MTYPE_TRANSIT, transit);
 }
 
+
 static void *
-transit_hash_alloc (struct transit *transit)
+transit_hash_alloc (void *p)
 {
   /* Transit structure is already allocated.  */
-  return transit;
+  return p;
 }
 
 static struct transit *
@@ -241,8 +247,9 @@ transit_unintern (struct transit *transit)
 }
 
 static unsigned int
-transit_hash_key_make (struct transit *transit)
+transit_hash_key_make (void *p)
 {
+  struct transit * transit = (struct transit *) p;
   unsigned int key = 0;
   int length;
   caddr_t pnt;
@@ -257,8 +264,11 @@ transit_hash_key_make (struct transit *transit)
 }
 
 static int
-transit_hash_cmp (struct transit *transit1, struct transit *transit2)
+transit_hash_cmp (void *p1, void *p2)
 {
+  struct transit * transit1 = (struct transit *) p1;
+  struct transit * transit2 = (struct transit *) p2;
+
   if (transit1->length == transit2->length &&
       memcmp (transit1->val, transit2->val, transit1->length) == 0)
     return 1;
@@ -288,8 +298,9 @@ attr_unknown_count (void)
 }
 
 unsigned int
-attrhash_key_make (struct attr *attr)
+attrhash_key_make (void *p)
 {
+  struct attr * attr = (struct attr *) p;
   unsigned int key = 0;
 
   key += attr->origin;
@@ -328,8 +339,11 @@ attrhash_key_make (struct attr *attr)
 }
 
 int
-attrhash_cmp (struct attr *attr1, struct attr *attr2)
+attrhash_cmp (void *p1, void *p2)
 {
+  struct attr * attr1 = (struct attr *) p1;
+  struct attr * attr2 = (struct attr *) p2;
+
   if (attr1->flag == attr2->flag
       && attr1->origin == attr2->origin
       && attr1->nexthop.s_addr == attr2->nexthop.s_addr
@@ -379,8 +393,9 @@ attr_show_all (struct vty *vty)
 }
 
 static void *
-bgp_attr_hash_alloc (struct attr *val)
+bgp_attr_hash_alloc (void *p)
 {
+  struct attr * val = (struct attr *) p;
   struct attr *attr;
 
   attr = XMALLOC (MTYPE_ATTR, sizeof (struct attr));
index 777869ceb001c24c297228ae739a87cc923dbb48..124c450e35c5276d4a3f9006a1751e94f8ab2747 100644 (file)
@@ -129,8 +129,8 @@ extern bgp_size_t bgp_packet_withdraw (struct peer *peer, struct stream *s,
                                 struct prefix_rd *, u_char *);
 extern void bgp_dump_routes_attr (struct stream *, struct attr *,
                                  struct prefix *);
-extern unsigned int attrhash_key_make (struct attr *);
-extern int attrhash_cmp (struct attr *, struct attr *);
+extern int attrhash_cmp (void *, void *);
+extern unsigned int attrhash_key_make (void *);
 extern void attr_show_all (struct vty *);
 extern unsigned long int attr_count (void);
 extern unsigned long int attr_unknown_count (void);