Browse code

add missing static attribute to functions

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>

Antonio Quartulli authored on 2017/08/11 18:07:42
Showing 11 changed files
... ...
@@ -185,7 +185,7 @@ lz4v2_compress(struct buffer *buf, struct buffer work,
185 185
     }
186 186
 }
187 187
 
188
-void
188
+static void
189 189
 do_lz4_decompress(size_t zlen_max,
190 190
                   struct buffer *work,
191 191
                   struct buffer *buf,
... ...
@@ -1007,7 +1007,7 @@ process_incoming_link_part2(struct context *c, struct link_socket_info *lsi, con
1007 1007
     }
1008 1008
 }
1009 1009
 
1010
-void
1010
+static void
1011 1011
 process_incoming_link(struct context *c)
1012 1012
 {
1013 1013
     perf_push(PERF_PROC_IN_LINK);
... ...
@@ -3515,7 +3515,7 @@ management_query_user_pass(struct management *man,
3515 3515
 
3516 3516
 #ifdef MANAGMENT_EXTERNAL_KEY
3517 3517
 
3518
-int
3518
+static int
3519 3519
 management_query_multiline(struct management *man,
3520 3520
                            const char *b64_data, const char *prompt, const char *cmd, int *state, struct buffer_list **input)
3521 3521
 {
... ...
@@ -3591,7 +3591,7 @@ done:
3591 3591
     return ret;
3592 3592
 }
3593 3593
 
3594
-char *
3594
+static char *
3595 3595
 /* returns allocated base64 signature */
3596 3596
 management_query_multiline_flatten_newline(struct management *man,
3597 3597
                                            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,
3620 3620
     return result;
3621 3621
 }
3622 3622
 
3623
-char *
3623
+static char *
3624 3624
 /* returns allocated base64 signature */
3625 3625
 management_query_multiline_flatten(struct management *man,
3626 3626
                                    const char *b64_data, const char *prompt, const char *cmd, int *state, struct buffer_list **input)
... ...
@@ -521,7 +521,7 @@ multi_tcp_dispatch(struct multi_context *m, struct multi_instance *mi, const int
521 521
     return touched;
522 522
 }
523 523
 
524
-int
524
+static int
525 525
 multi_tcp_post(struct multi_context *m, struct multi_instance *mi, const int action)
526 526
 {
527 527
     struct context *c = multi_tcp_context(m, mi);
... ...
@@ -485,7 +485,7 @@ multi_instance_string(const struct multi_instance *mi, bool null, struct gc_aren
485 485
     }
486 486
 }
487 487
 
488
-void
488
+static void
489 489
 generate_prefix(struct multi_instance *mi)
490 490
 {
491 491
     struct gc_arena gc = gc_new();
... ...
@@ -2967,7 +2967,7 @@ gremlin_flood_clients(struct multi_context *m)
2967 2967
 }
2968 2968
 #endif /* ifdef ENABLE_DEBUG */
2969 2969
 
2970
-bool
2970
+static bool
2971 2971
 stale_route_check_trigger(struct multi_context *m)
2972 2972
 {
2973 2973
     struct timeval null;
... ...
@@ -131,7 +131,7 @@ gen_nonce(unsigned char *nonce)
131 131
     }
132 132
 }
133 133
 
134
-void
134
+static void
135 135
 my_strupr(char *str)
136 136
 {
137 137
     /* converts string to uppercase in place */
... ...
@@ -959,7 +959,7 @@ pull_filter_type_name(int type)
959 959
 
960 960
 #endif
961 961
 
962
-void
962
+static void
963 963
 setenv_connection_entry(struct env_set *es,
964 964
                         const struct connection_entry *e,
965 965
                         const int i)
... ...
@@ -1439,7 +1439,7 @@ rol_check_alloc(struct options *options)
1439 1439
     }
1440 1440
 }
1441 1441
 
1442
-void
1442
+static void
1443 1443
 rol6_check_alloc(struct options *options)
1444 1444
 {
1445 1445
     if (!options->routes_ipv6)
... ...
@@ -1869,7 +1869,7 @@ parse_http_proxy_override(const char *server,
1869 1869
     }
1870 1870
 }
1871 1871
 
1872
-void
1872
+static void
1873 1873
 options_postprocess_http_proxy_override(struct options *o)
1874 1874
 {
1875 1875
     const struct connection_list *l = o->connection_list;
... ...
@@ -1986,7 +1986,7 @@ alloc_pull_filter(struct options *o, const int msglevel)
1986 1986
     return f;
1987 1987
 }
1988 1988
 
1989
-void
1989
+static void
1990 1990
 connection_entry_load_re(struct connection_entry *ce, const struct remote_entry *re)
1991 1991
 {
1992 1992
     if (re->remote)
... ...
@@ -549,7 +549,7 @@ http_proxy_close(struct http_proxy_info *hp)
549 549
     free(hp);
550 550
 }
551 551
 
552
-bool
552
+static bool
553 553
 add_proxy_headers(struct http_proxy_info *p,
554 554
                   socket_descriptor_t sd, /* already open to proxy */
555 555
                   const char *host,       /* openvpn server remote */
... ...
@@ -518,14 +518,14 @@ add_route_ipv6_to_option_list(struct route_ipv6_option_list *l,
518 518
     l->routes_ipv6 = ro;
519 519
 }
520 520
 
521
-void
521
+static void
522 522
 clear_route_list(struct route_list *rl)
523 523
 {
524 524
     gc_free(&rl->gc);
525 525
     CLEAR(*rl);
526 526
 }
527 527
 
528
-void
528
+static void
529 529
 clear_route_ipv6_list(struct route_ipv6_list *rl6)
530 530
 {
531 531
     gc_free(&rl6->gc);
... ...
@@ -1431,7 +1431,7 @@ set_actual_address(struct link_socket_actual *actual, struct addrinfo *ai)
1431 1431
 
1432 1432
 }
1433 1433
 
1434
-void
1434
+static void
1435 1435
 socket_connect(socket_descriptor_t *sd,
1436 1436
                const struct sockaddr *dest,
1437 1437
                const int connect_timeout,
... ...
@@ -1607,7 +1607,7 @@ key_source2_print(const struct key_source2 *k)
1607 1607
  * @param out           Output buffer
1608 1608
  * @param olen          Length of the output buffer
1609 1609
  */
1610
-void
1610
+static void
1611 1611
 tls1_P_hash(const md_kt_t *md_kt,
1612 1612
             const uint8_t *sec,
1613 1613
             int sec_len,