]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
add missing static attribute to functions
authorAntonio Quartulli <antonio@openvpn.net>
Fri, 11 Aug 2017 09:07:42 +0000 (17:07 +0800)
committerDavid Sommerseth <davids@openvpn.net>
Mon, 14 Aug 2017 10:52:32 +0000 (12:52 +0200)
Functions used only in the file where they are
defined and not exported in any header, should
always defined as static in order to make the scope
clear to the compiler and the developers.

Add the static attribute where missing.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
Acked-by: Steffan Karger <steffan@karger.me>
Message-Id: <20170811090744.31750-4-a@unstable.cc>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg15202.html
Signed-off-by: David Sommerseth <davids@openvpn.net>
src/openvpn/comp-lz4.c
src/openvpn/forward.c
src/openvpn/manage.c
src/openvpn/mtcp.c
src/openvpn/multi.c
src/openvpn/ntlm.c
src/openvpn/options.c
src/openvpn/proxy.c
src/openvpn/route.c
src/openvpn/socket.c
src/openvpn/ssl.c

index 6e40c325cfd5f8fbbdc5dcbd30979d4d5f78bdc5..e056caa8a8c0e13b9052fa9c56ae8864572ae07a 100644 (file)
@@ -185,7 +185,7 @@ lz4v2_compress(struct buffer *buf, struct buffer work,
     }
 }
 
-void
+static void
 do_lz4_decompress(size_t zlen_max,
                   struct buffer *work,
                   struct buffer *buf,
index c45d1259c4319099113078165e67ef6d784e6a1b..6cc593838cb736f7c2627dde523b425a592b7eb5 100644 (file)
@@ -1007,7 +1007,7 @@ process_incoming_link_part2(struct context *c, struct link_socket_info *lsi, con
     }
 }
 
-void
+static void
 process_incoming_link(struct context *c)
 {
     perf_push(PERF_PROC_IN_LINK);
index 3bbe972e5aa7775caf2b5bd4618112cb2b9269de..88121a388834d8c21e1dd655344b60ee32c52b78 100644 (file)
@@ -3515,7 +3515,7 @@ management_query_user_pass(struct management *man,
 
 #ifdef MANAGMENT_EXTERNAL_KEY
 
-int
+static int
 management_query_multiline(struct management *man,
                            const char *b64_data, const char *prompt, const char *cmd, int *state, struct buffer_list **input)
 {
@@ -3591,7 +3591,7 @@ done:
     return ret;
 }
 
-char *
+static char *
 /* returns allocated base64 signature */
 management_query_multiline_flatten_newline(struct management *man,
                                            const char *b64_data, const char *prompt, const char *cmd, int *state, struct buffer_list **input)
@@ -3620,7 +3620,7 @@ management_query_multiline_flatten_newline(struct management *man,
     return result;
 }
 
-char *
+static char *
 /* returns allocated base64 signature */
 management_query_multiline_flatten(struct management *man,
                                    const char *b64_data, const char *prompt, const char *cmd, int *state, struct buffer_list **input)
index 851643a99d4e4335e8a254947735a918ce42470b..3cb5211373ef341b4f5a016e3dc3a6aa54cd6df1 100644 (file)
@@ -521,7 +521,7 @@ multi_tcp_dispatch(struct multi_context *m, struct multi_instance *mi, const int
     return touched;
 }
 
-int
+static int
 multi_tcp_post(struct multi_context *m, struct multi_instance *mi, const int action)
 {
     struct context *c = multi_tcp_context(m, mi);
index 7edfee1b136f21168a1d0ab245b77c53ca50cfe3..c798c438519fc43b1be335603139bf3832824a7b 100644 (file)
@@ -485,7 +485,7 @@ multi_instance_string(const struct multi_instance *mi, bool null, struct gc_aren
     }
 }
 
-void
+static void
 generate_prefix(struct multi_instance *mi)
 {
     struct gc_arena gc = gc_new();
@@ -2967,7 +2967,7 @@ gremlin_flood_clients(struct multi_context *m)
 }
 #endif /* ifdef ENABLE_DEBUG */
 
-bool
+static bool
 stale_route_check_trigger(struct multi_context *m)
 {
     struct timeval null;
index 65c1cbf5d9848408c181bc348aef5262bac4ee7f..167c10b8042083df70a8f24a04e1e5e23ebe7564 100644 (file)
@@ -131,7 +131,7 @@ gen_nonce(unsigned char *nonce)
     }
 }
 
-void
+static void
 my_strupr(char *str)
 {
     /* converts string to uppercase in place */
index 1d5b62ca045e4e162f5f6abe05e8328a410efa44..c4bd8cbafb3aeff424fef28c931e94d4dd23bab5 100644 (file)
@@ -959,7 +959,7 @@ pull_filter_type_name(int type)
 
 #endif
 
-void
+static void
 setenv_connection_entry(struct env_set *es,
                         const struct connection_entry *e,
                         const int i)
@@ -1439,7 +1439,7 @@ rol_check_alloc(struct options *options)
     }
 }
 
-void
+static void
 rol6_check_alloc(struct options *options)
 {
     if (!options->routes_ipv6)
@@ -1869,7 +1869,7 @@ parse_http_proxy_override(const char *server,
     }
 }
 
-void
+static void
 options_postprocess_http_proxy_override(struct options *o)
 {
     const struct connection_list *l = o->connection_list;
@@ -1986,7 +1986,7 @@ alloc_pull_filter(struct options *o, const int msglevel)
     return f;
 }
 
-void
+static void
 connection_entry_load_re(struct connection_entry *ce, const struct remote_entry *re)
 {
     if (re->remote)
index 1ae93ad5df4408135dd197ea50a352e4b139dc8b..fdc73b4a707d636d2402edfac32819afa45b3c3a 100644 (file)
@@ -549,7 +549,7 @@ http_proxy_close(struct http_proxy_info *hp)
     free(hp);
 }
 
-bool
+static bool
 add_proxy_headers(struct http_proxy_info *p,
                   socket_descriptor_t sd, /* already open to proxy */
                   const char *host,       /* openvpn server remote */
index a8a4c66deaa5d1b8d7dacb8762c88bb032aab854..1d8bb001541cfdf92e20e92eebf933af8b8636dd 100644 (file)
@@ -518,14 +518,14 @@ add_route_ipv6_to_option_list(struct route_ipv6_option_list *l,
     l->routes_ipv6 = ro;
 }
 
-void
+static void
 clear_route_list(struct route_list *rl)
 {
     gc_free(&rl->gc);
     CLEAR(*rl);
 }
 
-void
+static void
 clear_route_ipv6_list(struct route_ipv6_list *rl6)
 {
     gc_free(&rl6->gc);
index 6e01fe10959d1303b3dec7010022d157d5be38f1..3d4f881e67e2731c8b6207248579e0b75532d461 100644 (file)
@@ -1431,7 +1431,7 @@ set_actual_address(struct link_socket_actual *actual, struct addrinfo *ai)
 
 }
 
-void
+static void
 socket_connect(socket_descriptor_t *sd,
                const struct sockaddr *dest,
                const int connect_timeout,
index ff311d8e69a60c2e5c8c76679c4559110af32d5b..4ccc50c0f3a7e699233eff31600554b19e2ffc31 100644 (file)
@@ -1607,7 +1607,7 @@ key_source2_print(const struct key_source2 *k)
  * @param out           Output buffer
  * @param olen          Length of the output buffer
  */
-void
+static void
 tls1_P_hash(const md_kt_t *md_kt,
             const uint8_t *sec,
             int sec_len,