Skip to content

Commit

Permalink
Treewide: use ANSI function definitions
Browse files Browse the repository at this point in the history
Signed-off-by: Ruben Kerkhof <[email protected]>
  • Loading branch information
rubenk committed Jan 24, 2019
1 parent 262d4dd commit 4d762f2
Show file tree
Hide file tree
Showing 78 changed files with 121 additions and 127 deletions.
2 changes: 1 addition & 1 deletion babeld/babel_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1262,7 +1262,7 @@ DEFUN (show_babel_parameters,
}

void
babel_if_init ()
babel_if_init(void)
{
/* initialize interface list */
hook_register_prio(if_add, 0, babel_if_new_hook);
Expand Down
2 changes: 1 addition & 1 deletion babeld/babeld.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ babel_initial_noise(void)

/* Delete all the added babel routes, make babeld only speak to zebra. */
static void
babel_clean_routing_process()
babel_clean_routing_process(void)
{
flush_all_routes();
babel_interface_close_all();
Expand Down
2 changes: 1 addition & 1 deletion babeld/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -1430,7 +1430,7 @@ send_wildcard_retraction(struct interface *ifp)
}

void
update_myseqno()
update_myseqno(void)
{
myseqno = seqno_plus(myseqno, 1);
}
Expand Down
2 changes: 1 addition & 1 deletion babeld/neighbour.c
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ neighbour_txcost(struct neighbour *neigh)
}

unsigned
check_neighbours()
check_neighbours(void)
{
struct neighbour *neigh;
int changed, rc;
Expand Down
6 changes: 3 additions & 3 deletions babeld/resend.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ satisfy_request(const unsigned char *prefix, unsigned char plen,
}

void
expire_resend()
expire_resend(void)
{
struct resend *current, *previous;
int recompute = 0;
Expand Down Expand Up @@ -267,7 +267,7 @@ expire_resend()
}

void
recompute_resend_time()
recompute_resend_time(void)
{
struct resend *request;
struct timeval resend = {0, 0};
Expand All @@ -286,7 +286,7 @@ recompute_resend_time()
}

void
do_resend()
do_resend(void)
{
struct resend *resend;

Expand Down
2 changes: 1 addition & 1 deletion babeld/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ flush_route(struct babel_route *route)
}

void
flush_all_routes()
flush_all_routes(void)
{
int i;

Expand Down
2 changes: 1 addition & 1 deletion babeld/source.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ update_source(struct source *src,
}

void
expire_sources()
expire_sources(void)
{
struct source *src;

Expand Down
2 changes: 1 addition & 1 deletion babeld/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ uchar_to_in6addr(struct in6_addr *dest, const unsigned char *src)
}

int
daemonise()
daemonise(void)
{
int rc;

Expand Down
2 changes: 1 addition & 1 deletion babeld/xroute.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ add_xroute(unsigned char prefix[16], unsigned char plen,

/* Returns an overestimate of the number of xroutes. */
int
xroutes_estimate()
xroutes_estimate(void)
{
return numxroutes;
}
Expand Down
2 changes: 1 addition & 1 deletion bgpd/bgp_keepalives.c
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ void bgp_keepalives_off(struct peer *peer)
pthread_mutex_unlock(peerhash_mtx);
}

void bgp_keepalives_wake()
void bgp_keepalives_wake(void)
{
pthread_mutex_lock(peerhash_mtx);
{
Expand Down
2 changes: 1 addition & 1 deletion bgpd/bgp_updgrp_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
/********************
* PUBLIC FUNCTIONS
********************/
struct bpacket *bpacket_alloc()
struct bpacket *bpacket_alloc(void)
{
struct bpacket *pkt;

Expand Down
6 changes: 3 additions & 3 deletions bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -7839,7 +7839,7 @@ static const struct cmd_variable_handler bgp_viewvrf_var_handlers[] = {
struct frr_pthread *bgp_pth_io;
struct frr_pthread *bgp_pth_ka;

static void bgp_pthreads_init()
static void bgp_pthreads_init(void)
{
assert(!bgp_pth_io);
assert(!bgp_pth_ka);
Expand All @@ -7858,7 +7858,7 @@ static void bgp_pthreads_init()
bgp_pth_ka = frr_pthread_new(&ka, "BGP Keepalives thread", "bgpd_ka");
}

void bgp_pthreads_run()
void bgp_pthreads_run(void)
{
frr_pthread_run(bgp_pth_io, NULL);
frr_pthread_run(bgp_pth_ka, NULL);
Expand All @@ -7868,7 +7868,7 @@ void bgp_pthreads_run()
frr_pthread_wait_running(bgp_pth_ka);
}

void bgp_pthreads_finish()
void bgp_pthreads_finish(void)
{
frr_pthread_stop_all();
frr_pthread_finish();
Expand Down
4 changes: 2 additions & 2 deletions bgpd/rfapi/bgp_rfapi_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,7 +575,7 @@ static struct rfapi_l2_group_cfg *rfapi_l2_group_lookup_byname(struct bgp *bgp,
return NULL;
}

static struct rfapi_l2_group_cfg *rfapi_l2_group_new()
static struct rfapi_l2_group_cfg *rfapi_l2_group_new(void)
{
struct rfapi_l2_group_cfg *rfg;

Expand Down Expand Up @@ -1396,7 +1396,7 @@ DEFUN (vnc_export_mode,
return CMD_SUCCESS;
}

static struct rfapi_rfg_name *rfgn_new()
static struct rfapi_rfg_name *rfgn_new(void)
{
return XCALLOC(MTYPE_RFAPI_RFG_NAME, sizeof(struct rfapi_rfg_name));
}
Expand Down
2 changes: 1 addition & 1 deletion bgpd/rfapi/rfapi_import.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ void rfapiDebugBacktrace(void)
* Count remote routes and compare with actively-maintained values.
* Abort if they disagree.
*/
void rfapiCheckRouteCount()
void rfapiCheckRouteCount(void)
{
struct bgp *bgp = bgp_get_default();
struct rfapi *h;
Expand Down
2 changes: 1 addition & 1 deletion bgpd/rfapi/rfapi_rib.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ void rfapiRibCheckCounts(
assert(t_ri_active + t_ri_deleted + t_ri_pend + offset == alloc_count);
}

static struct rfapi_info *rfapi_info_new()
static struct rfapi_info *rfapi_info_new(void)
{
return XCALLOC(MTYPE_RFAPI_INFO, sizeof(struct rfapi_info));
}
Expand Down
2 changes: 1 addition & 1 deletion bgpd/rfapi/rfapi_vty.c
Original file line number Diff line number Diff line change
Expand Up @@ -4964,7 +4964,7 @@ DEFUN (clear_vrf_all,
return vnc_clear_vrf(vty, NULL, arg_vrf, NULL, NULL);
}

void rfapi_vty_init()
void rfapi_vty_init(void)
{
install_element(ENABLE_NODE, &add_vnc_prefix_cost_life_lnh_cmd);
install_element(ENABLE_NODE, &add_vnc_prefix_life_cost_lnh_cmd);
Expand Down
2 changes: 1 addition & 1 deletion bgpd/rfp-example/librfp/rfp_example.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ DEFUN (rfp_full_table_download,
return CMD_SUCCESS;
}

static void rfp_vty_install()
static void rfp_vty_install(void)
{
static int installed = 0;
if (installed) /* do this only once */
Expand Down
2 changes: 1 addition & 1 deletion bgpd/rfp-example/rfptest/rfptest.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include <stdio.h>
#include <stdlib.h>
#include "rfptest.h"
int main()
int main(void)
{
printf("Your test code goes here.\n");
exit(1);
Expand Down
2 changes: 1 addition & 1 deletion eigrpd/eigrp_dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ static struct cmd_node eigrp_debug_node = {
};

/* Initialize debug commands. */
void eigrp_debug_init()
void eigrp_debug_init(void)
{
install_node(&eigrp_debug_node, config_write_debug);

Expand Down
2 changes: 1 addition & 1 deletion eigrpd/eigrp_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ int eigrp_if_delete_hook(struct interface *ifp)

struct list *eigrp_iflist;

void eigrp_if_init()
void eigrp_if_init(void)
{
/* Initialize Zebra interface data structure. */
// hook_register_prio(if_add, 0, eigrp_if_new);
Expand Down
8 changes: 4 additions & 4 deletions eigrpd/eigrp_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ struct eigrp_packet *eigrp_packet_duplicate(struct eigrp_packet *old,
return new;
}

static struct TLV_IPv4_Internal_type *eigrp_IPv4_InternalTLV_new()
static struct TLV_IPv4_Internal_type *eigrp_IPv4_InternalTLV_new(void)
{
struct TLV_IPv4_Internal_type *new;

Expand Down Expand Up @@ -1327,7 +1327,7 @@ uint16_t eigrp_add_authTLV_SHA256_to_stream(struct stream *s,
return 0;
}

struct TLV_MD5_Authentication_Type *eigrp_authTLV_MD5_new()
struct TLV_MD5_Authentication_Type *eigrp_authTLV_MD5_new(void)
{
struct TLV_MD5_Authentication_Type *new;

Expand All @@ -1342,7 +1342,7 @@ void eigrp_authTLV_MD5_free(struct TLV_MD5_Authentication_Type *authTLV)
XFREE(MTYPE_EIGRP_AUTH_TLV, authTLV);
}

struct TLV_SHA256_Authentication_Type *eigrp_authTLV_SHA256_new()
struct TLV_SHA256_Authentication_Type *eigrp_authTLV_SHA256_new(void)
{
struct TLV_SHA256_Authentication_Type *new;

Expand All @@ -1363,7 +1363,7 @@ void eigrp_IPv4_InternalTLV_free(
XFREE(MTYPE_EIGRP_IPV4_INT_TLV, IPv4_InternalTLV);
}

struct TLV_Sequence_Type *eigrp_SequenceTLV_new()
struct TLV_Sequence_Type *eigrp_SequenceTLV_new(void)
{
struct TLV_Sequence_Type *new;

Expand Down
6 changes: 3 additions & 3 deletions eigrpd/eigrp_topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static int eigrp_nexthop_entry_cmp(struct eigrp_nexthop_entry *,
* del - assigned function executed before deleting topology node by list
* function
*/
struct route_table *eigrp_topology_new()
struct route_table *eigrp_topology_new(void)
{
return route_table_init();
}
Expand All @@ -70,7 +70,7 @@ struct route_table *eigrp_topology_new()
* Returns new created toplogy node
* cmp - assigned function for comparing topology entry
*/
struct eigrp_prefix_entry *eigrp_prefix_entry_new()
struct eigrp_prefix_entry *eigrp_prefix_entry_new(void)
{
struct eigrp_prefix_entry *new;
new = XCALLOC(MTYPE_EIGRP_PREFIX_ENTRY,
Expand Down Expand Up @@ -102,7 +102,7 @@ static int eigrp_nexthop_entry_cmp(struct eigrp_nexthop_entry *entry1,
* Returns new topology entry
*/

struct eigrp_nexthop_entry *eigrp_nexthop_entry_new()
struct eigrp_nexthop_entry *eigrp_nexthop_entry_new(void)
{
struct eigrp_nexthop_entry *new;

Expand Down
2 changes: 1 addition & 1 deletion eigrpd/eigrpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ void eigrp_router_id_update(struct eigrp *eigrp)
}
}

void eigrp_master_init()
void eigrp_master_init(void)
{
struct timeval tv;

Expand Down
4 changes: 2 additions & 2 deletions isisd/isis_circuit.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ int isis_interface_config_write(struct vty *);
int isis_if_new_hook(struct interface *);
int isis_if_delete_hook(struct interface *);

struct isis_circuit *isis_circuit_new()
struct isis_circuit *isis_circuit_new(void)
{
struct isis_circuit *circuit;
int i;
Expand Down Expand Up @@ -1393,7 +1393,7 @@ int isis_if_delete_hook(struct interface *ifp)
return 0;
}

void isis_circuit_init()
void isis_circuit_init(void)
{
/* Initialize Zebra interface data structure */
hook_register_prio(if_add, 0, isis_if_new_hook);
Expand Down
2 changes: 1 addition & 1 deletion isisd/isis_spf.c
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,7 @@ DEFUN (show_isis_topology,
return CMD_SUCCESS;
}

void isis_spf_cmds_init()
void isis_spf_cmds_init(void)
{
install_element(VIEW_NODE, &show_isis_topology_cmd);
}
Expand Down
2 changes: 1 addition & 1 deletion isisd/isis_te.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const char *mode2text[] = {"Disable", "Area", "AS", "Emulate"};
*------------------------------------------------------------------------*/

/* Create new MPLS TE Circuit context */
struct mpls_te_circuit *mpls_te_circuit_new()
struct mpls_te_circuit *mpls_te_circuit_new(void)
{
struct mpls_te_circuit *mtc;

Expand Down
2 changes: 1 addition & 1 deletion isisd/isisd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2161,7 +2161,7 @@ int isis_config_write(struct vty *vty)

struct cmd_node router_node = {ROUTER_NODE, "%s(config-router)# ", 1};

void isis_init()
void isis_init(void)
{
/* Install IS-IS top node */
install_node(&router_node, isis_config_write);
Expand Down
2 changes: 1 addition & 1 deletion lib/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -2883,7 +2883,7 @@ void cmd_init(int terminal)
#endif
}

void cmd_terminate()
void cmd_terminate(void)
{
struct cmd_node *cmd_node;

Expand Down
4 changes: 2 additions & 2 deletions lib/filter.c
Original file line number Diff line number Diff line change
Expand Up @@ -2212,14 +2212,14 @@ static void access_list_init_ipv6(void)
install_element(CONFIG_NODE, &no_ipv6_access_list_remark_comment_cmd);
}

void access_list_init()
void access_list_init(void)
{
access_list_init_ipv4();
access_list_init_ipv6();
access_list_init_mac();
}

void access_list_reset()
void access_list_reset(void)
{
access_list_reset_ipv4();
access_list_reset_ipv6();
Expand Down
6 changes: 3 additions & 3 deletions lib/frr_pthread.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ static struct list *frr_pthread_list;

/* ------------------------------------------------------------------------ */

void frr_pthread_init()
void frr_pthread_init(void)
{
pthread_mutex_lock(&frr_pthread_list_mtx);
{
Expand All @@ -57,7 +57,7 @@ void frr_pthread_init()
pthread_mutex_unlock(&frr_pthread_list_mtx);
}

void frr_pthread_finish()
void frr_pthread_finish(void)
{
pthread_mutex_lock(&frr_pthread_list_mtx);
{
Expand Down Expand Up @@ -178,7 +178,7 @@ int frr_pthread_stop(struct frr_pthread *fpt, void **result)
return ret;
}

void frr_pthread_stop_all()
void frr_pthread_stop_all(void)
{
pthread_mutex_lock(&frr_pthread_list_mtx);
{
Expand Down
Loading

0 comments on commit 4d762f2

Please sign in to comment.