From 66e5cd87194ae6fdd51061a91b4698bc0a652f6b Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 9 Feb 2009 10:14:16 -0800 Subject: [cleanup] functions taking no args should be declared with void args Use Ansi-C prototypes rather than old K&R method of declaring function without arguments --- bgpd/bgp_advertise.c | 4 ++-- bgpd/bgp_attr.c | 2 +- bgpd/bgp_clist.c | 4 ++-- bgpd/bgp_community.c | 2 +- bgpd/bgp_ecommunity.c | 4 ++-- bgpd/bgp_filter.c | 12 ++++++------ bgpd/bgp_fsm.c | 2 +- bgpd/bgp_nexthop.c | 8 ++++---- bgpd/bgp_route.c | 16 ++++++++-------- bgpd/bgp_snmp.c | 2 +- bgpd/bgp_table.c | 2 +- bgpd/bgpd.c | 6 +++--- 12 files changed, 32 insertions(+), 32 deletions(-) (limited to 'bgpd') diff --git a/bgpd/bgp_advertise.c b/bgpd/bgp_advertise.c index b9f4a85b..87eb7ac7 100644 --- a/bgpd/bgp_advertise.c +++ b/bgpd/bgp_advertise.c @@ -40,7 +40,7 @@ Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA one packet. To do that we maintain attribute hash in struct peer. */ static struct bgp_advertise_attr * -baa_new () +baa_new (void) { return (struct bgp_advertise_attr *) XCALLOC (MTYPE_BGP_ADVERTISE_ATTR, sizeof (struct bgp_advertise_attr)); @@ -84,7 +84,7 @@ baa_hash_cmp (const void *p1, const void *p2) structure. This structure is referred from BGP adjacency information. */ static struct bgp_advertise * -bgp_advertise_new () +bgp_advertise_new (void) { return (struct bgp_advertise *) XCALLOC (MTYPE_BGP_ADVERTISE, sizeof (struct bgp_advertise)); diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c index 5839d3fe..edacd5db 100644 --- a/bgpd/bgp_attr.c +++ b/bgpd/bgp_attr.c @@ -274,7 +274,7 @@ transit_hash_cmp (const void *p1, const void *p2) } static void -transit_init () +transit_init (void) { transit_hash = hash_create (transit_hash_key_make, transit_hash_cmp); } diff --git a/bgpd/bgp_clist.c b/bgpd/bgp_clist.c index a8d8742f..8d8c90c4 100644 --- a/bgpd/bgp_clist.c +++ b/bgpd/bgp_clist.c @@ -49,7 +49,7 @@ community_list_master_lookup (struct community_list_handler *ch, int master) /* Allocate a new community list entry. */ static struct community_entry * -community_entry_new () +community_entry_new (void) { return XCALLOC (MTYPE_COMMUNITY_LIST_ENTRY, sizeof (struct community_entry)); } @@ -86,7 +86,7 @@ community_entry_free (struct community_entry *entry) /* Allocate a new community-list. */ static struct community_list * -community_list_new () +community_list_new (void) { return XCALLOC (MTYPE_COMMUNITY_LIST, sizeof (struct community_list)); } diff --git a/bgpd/bgp_community.c b/bgpd/bgp_community.c index 64c6810f..839927c8 100644 --- a/bgpd/bgp_community.c +++ b/bgpd/bgp_community.c @@ -617,7 +617,7 @@ community_str2com (const char *str) /* Return communities hash entry count. */ unsigned long -community_count () +community_count (void) { return comhash->count; } diff --git a/bgpd/bgp_ecommunity.c b/bgpd/bgp_ecommunity.c index 6b221e24..4d9fc708 100644 --- a/bgpd/bgp_ecommunity.c +++ b/bgpd/bgp_ecommunity.c @@ -34,7 +34,7 @@ struct hash *ecomhash; /* Allocate a new ecommunities. */ struct ecommunity * -ecommunity_new () +ecommunity_new (void) { return (struct ecommunity *) XCALLOC (MTYPE_ECOMMUNITY, sizeof (struct ecommunity)); @@ -108,7 +108,7 @@ ecommunity_uniq_sort (struct ecommunity *ecom) if (! ecom) return NULL; - new = ecommunity_new ();; + new = ecommunity_new (); for (i = 0; i < ecom->size; i++) { diff --git a/bgpd/bgp_filter.c b/bgpd/bgp_filter.c index eb4ff8ea..89e48bf8 100644 --- a/bgpd/bgp_filter.c +++ b/bgpd/bgp_filter.c @@ -47,10 +47,10 @@ struct as_list_master struct as_list_list str; /* Hook function which is executed when new access_list is added. */ - void (*add_hook) (); + void (*add_hook) (void); /* Hook function which is executed when access_list is deleted. */ - void (*delete_hook) (); + void (*delete_hook) (void); }; /* Element of AS path filter. */ @@ -97,7 +97,7 @@ static struct as_list_master as_list_master = /* Allocate new AS filter. */ static struct as_filter * -as_filter_new () +as_filter_new (void) { return XCALLOC (MTYPE_AS_FILTER, sizeof (struct as_filter)); } @@ -173,7 +173,7 @@ as_list_lookup (const char *name) } static struct as_list * -as_list_new () +as_list_new (void) { return XCALLOC (MTYPE_AS_LIST, sizeof (struct as_list)); } @@ -395,14 +395,14 @@ as_list_apply (struct as_list *aslist, void *object) /* Add hook function. */ void -as_list_add_hook (void (*func) ()) +as_list_add_hook (void (*func) (void)) { as_list_master.add_hook = func; } /* Delete hook function. */ void -as_list_delete_hook (void (*func) ()) +as_list_delete_hook (void (*func) (void)) { as_list_master.delete_hook = func; } diff --git a/bgpd/bgp_fsm.c b/bgpd/bgp_fsm.c index 15bd8a6c..92485731 100644 --- a/bgpd/bgp_fsm.c +++ b/bgpd/bgp_fsm.c @@ -902,7 +902,7 @@ bgp_ignore (struct peer *peer) /* Finite State Machine structure */ struct { - int (*func) (); + int (*func) (struct peer *); int next_state; } FSM [BGP_STATUS_MAX - 1][BGP_EVENTS_MAX - 1] = { diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c index b2ee7f3b..67a49f7a 100644 --- a/bgpd/bgp_nexthop.c +++ b/bgpd/bgp_nexthop.c @@ -96,7 +96,7 @@ bnc_nexthop_free (struct bgp_nexthop_cache *bnc) } static struct bgp_nexthop_cache * -bnc_new () +bnc_new (void) { return XCALLOC (MTYPE_BGP_NEXTHOP_CACHE, sizeof (struct bgp_nexthop_cache)); } @@ -695,7 +695,7 @@ bgp_nexthop_self (afi_t afi, struct attr *attr) } static struct bgp_nexthop_cache * -zlookup_read () +zlookup_read (void) { struct stream *s; uint16_t length; @@ -804,7 +804,7 @@ zlookup_query (struct in_addr addr) #ifdef HAVE_IPV6 static struct bgp_nexthop_cache * -zlookup_read_ipv6 () +zlookup_read_ipv6 (void) { struct stream *s; uint16_t length; @@ -1277,7 +1277,7 @@ bgp_config_write_scan_time (struct vty *vty) } void -bgp_scan_init () +bgp_scan_init (void) { zlookup = zclient_new (); zlookup->sock = -1; diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index 5177dc07..65f54e77 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -127,7 +127,7 @@ bgp_info_extra_get (struct bgp_info *ri) /* Allocate new bgp info structure. */ static struct bgp_info * -bgp_info_new () +bgp_info_new (void) { return XCALLOC (MTYPE_BGP_ROUTE, sizeof (struct bgp_info)); } @@ -2911,7 +2911,7 @@ bgp_clear_stale_route (struct peer *peer, afi_t afi, safi_t safi) /* Delete all kernel routes. */ void -bgp_cleanup_routes () +bgp_cleanup_routes (void) { struct bgp *bgp; struct listnode *node, *nnode; @@ -2942,7 +2942,7 @@ bgp_cleanup_routes () } void -bgp_reset () +bgp_reset (void) { vty_reset (); bgp_zclient_reset (); @@ -3114,7 +3114,7 @@ bgp_nlri_sanity_check (struct peer *peer, int afi, u_char *pnt, } static struct bgp_static * -bgp_static_new () +bgp_static_new (void) { return XCALLOC (MTYPE_BGP_STATIC, sizeof (struct bgp_static)); } @@ -4499,7 +4499,7 @@ struct bgp_aggregate }; static struct bgp_aggregate * -bgp_aggregate_new () +bgp_aggregate_new (void) { return XCALLOC (MTYPE_BGP_AGGREGATE, sizeof (struct bgp_aggregate)); } @@ -10846,7 +10846,7 @@ struct bgp_distance }; static struct bgp_distance * -bgp_distance_new () +bgp_distance_new (void) { return XCALLOC (MTYPE_BGP_DISTANCE, sizeof (struct bgp_distance)); } @@ -10944,7 +10944,7 @@ bgp_distance_unset (struct vty *vty, const char *distance_str, } static void -bgp_distance_reset () +bgp_distance_reset (void) { struct bgp_node *rn; struct bgp_distance *bdistance; @@ -11551,7 +11551,7 @@ bgp_config_write_distance (struct vty *vty, struct bgp *bgp) /* Allocate routing table structure and install commands. */ void -bgp_route_init () +bgp_route_init (void) { /* Init BGP distance table. */ bgp_distance_table = bgp_table_init (AFI_IP, SAFI_UNICAST); diff --git a/bgpd/bgp_snmp.c b/bgpd/bgp_snmp.c index 0f44e68d..1e37f266 100644 --- a/bgpd/bgp_snmp.c +++ b/bgpd/bgp_snmp.c @@ -882,7 +882,7 @@ bgpTrapBackwardTransition (struct peer *peer) } void -bgp_snmp_init () +bgp_snmp_init (void) { smux_init (bm->master); REGISTER_MIB("mibII/bgp", bgp_variables, variable, bgp_oid); diff --git a/bgpd/bgp_table.c b/bgpd/bgp_table.c index eb7c9f27..66332567 100644 --- a/bgpd/bgp_table.c +++ b/bgpd/bgp_table.c @@ -53,7 +53,7 @@ bgp_table_finish (struct bgp_table **rt) } static struct bgp_node * -bgp_node_create () +bgp_node_create (void) { return XCALLOC (MTYPE_BGP_NODE, sizeof (struct bgp_node)); } diff --git a/bgpd/bgpd.c b/bgpd/bgpd.c index 1712c719..3adede82 100644 --- a/bgpd/bgpd.c +++ b/bgpd/bgpd.c @@ -1321,7 +1321,7 @@ peer_group_active (struct peer *peer) /* Peer group cofiguration. */ static struct peer_group * -peer_group_new () +peer_group_new (void) { return (struct peer_group *) XCALLOC (MTYPE_PEER_GROUP, sizeof (struct peer_group)); @@ -3929,7 +3929,7 @@ peer_aslist_unset (struct peer *peer,afi_t afi, safi_t safi, int direct) } static void -peer_aslist_update () +peer_aslist_update (void) { afi_t afi; safi_t safi; @@ -5136,7 +5136,7 @@ bgp_init (void) } void -bgp_terminate () +bgp_terminate (void) { struct bgp *bgp; struct peer *peer; -- cgit v1.2.1