From: Ben Pfaff Date: Thu, 8 Jan 2009 23:25:05 +0000 (-0800) Subject: Change external functions to static functions, where possible. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=57282a2b5dae821633b3f766da1e74e6b3081361;p=openvswitch Change external functions to static functions, where possible. Found by -Wmissing-prototypes. --- diff --git a/lib/fault.c b/lib/fault.c index 76235709..5a53f15d 100644 --- a/lib/fault.c +++ b/lib/fault.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2008 The Board of Trustees of The Leland Stanford +/* Copyright (c) 2008, 2009 The Board of Trustees of The Leland Stanford * Junior University * * We are making the OpenFlow specification and associated documentation @@ -44,7 +44,7 @@ #include "vlog.h" #define THIS_MODULE VLM_fault -void +static void fault_handler(int sig_nr) { VLOG_EMER("Caught signal %d.", sig_nr); diff --git a/lib/vconn-ssl.c b/lib/vconn-ssl.c index a00906c9..5dadc363 100644 --- a/lib/vconn-ssl.c +++ b/lib/vconn-ssl.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2008 The Board of Trustees of The Leland Stanford +/* Copyright (c) 2008, 2009 The Board of Trustees of The Leland Stanford * Junior University * * We are making the OpenFlow specification and associated documentation @@ -177,7 +177,7 @@ static void ssl_tx_poll_callback(int fd, short int revents, void *vconn_); static DH *tmp_dh_callback(SSL *ssl, int is_export UNUSED, int keylength); static void log_ca_cert(const char *file_name, X509 *cert); -short int +static short int want_to_poll_events(int want) { switch (want) { @@ -1049,7 +1049,7 @@ vconn_ssl_set_certificate_file(const char *file_name) * in '*n_certs', and returns a positive errno value. * * The caller is responsible for freeing '*certs'. */ -int +static int read_cert_file(const char *file_name, X509 ***certs, size_t *n_certs) { FILE *file; diff --git a/tests/test-hmap.c b/tests/test-hmap.c index 1ef6fea0..f4871e79 100644 --- a/tests/test-hmap.c +++ b/tests/test-hmap.c @@ -89,7 +89,7 @@ make_hmap(struct hmap *hmap, struct element elements[], } } -void +static void shuffle(int *p, size_t n) { for (; n > 1; n--, p++) { diff --git a/udatapath/datapath.c b/udatapath/datapath.c index e8400459..f5de7c5e 100644 --- a/udatapath/datapath.c +++ b/udatapath/datapath.c @@ -544,7 +544,7 @@ output_all(struct datapath *dp, struct ofpbuf *buffer, int in_port, int flood) return 0; } -void +static void output_packet(struct datapath *dp, struct ofpbuf *buffer, uint16_t out_port) { struct sw_port *p = lookup_port(dp, out_port); diff --git a/utilities/vlogconf.c b/utilities/vlogconf.c index 6da0c171..c6a891a4 100644 --- a/utilities/vlogconf.c +++ b/utilities/vlogconf.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2008 The Board of Trustees of The Leland Stanford +/* Copyright (c) 2008, 2009 The Board of Trustees of The Leland Stanford * Junior University * * We are making the OpenFlow specification and associated documentation @@ -47,7 +47,7 @@ #include "util.h" #include "vlog-socket.h" -void +static void usage(char *prog_name, int exit_code) { printf("Usage: %s [TARGET] [ACTION...]\n" diff --git a/vswitchd/brcompat.c b/vswitchd/brcompat.c index 0151d1ff..4a877ffa 100644 --- a/vswitchd/brcompat.c +++ b/vswitchd/brcompat.c @@ -1,4 +1,4 @@ -/* Copyright (c) 2008 The Board of Trustees of The Leland Stanford +/* Copyright (c) 2008, 2009 The Board of Trustees of The Leland Stanford * Junior University * * We are making the OpenFlow specification and associated documentation @@ -309,7 +309,7 @@ brc_del_dp(const char *dp_name) return 0; } -int +static int brc_handle_dp_cmd(struct ofpbuf *buffer, bool add) { int dp_act_err; @@ -350,7 +350,7 @@ static const struct nl_policy brc_port_policy[] = { [BRC_GENL_A_PORT_NAME] = { .type = NL_A_STRING }, }; -int +static int brc_handle_port_cmd(struct ofpbuf *buffer, bool add) { struct nlattr *attrs[ARRAY_SIZE(brc_port_policy)]; @@ -381,7 +381,7 @@ brc_handle_port_cmd(struct ofpbuf *buffer, bool add) return 0; } -int +static int brc_recv_update(void) { int retval; diff --git a/vswitchd/bridge.c b/vswitchd/bridge.c index 8f6cc6e3..73dd3d21 100644 --- a/vswitchd/bridge.c +++ b/vswitchd/bridge.c @@ -220,6 +220,7 @@ static void bridge_reconfigure_one(struct bridge *); static void bridge_get_all_ifaces(const struct bridge *, struct svec *ifaces); static bool bridge_is_backlogged(const struct bridge *); static int bridge_fetch_dp_ifaces(struct bridge *, struct svec *iface_names); +static void bridge_flush(struct bridge *); static void bridge_process_msg(struct bridge *, struct ofpbuf *); static void revalidate_flow(struct bridge *, struct ft_flow *); @@ -438,7 +439,7 @@ bridge_wait(void) /* Forces 'br' to revalidate all of its flows. This is appropriate when 'br''s * configuration changes. */ -void +static void bridge_flush(struct bridge *br) { br->flush = true;