]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: address a few cases of "static <type> inline foo()"
authorWilly Tarreau <w@1wt.eu>
Mon, 15 Apr 2019 19:25:03 +0000 (21:25 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 15 Apr 2019 19:55:48 +0000 (21:55 +0200)
Older compilers don't like to see "inline" placed after the type in a
function declaration, it must be "static inline <type>" only. This
patch touches various areas. The warnings were seen with gcc-3.4.

include/proto/backend.h
include/proto/proxy.h
include/proto/server.h
include/proto/stream.h
src/pipe.c
src/server.c
src/ssl_sock.c

index 54ae057fd5c6960bf10d4c9820260d60dd66abcd..e98df2b1649e41d103a13d7e3aa9c880617045a0 100644 (file)
@@ -58,7 +58,7 @@ static inline int be_usable_srv(struct proxy *be)
 }
 
 /* set the time of last session on the backend */
-static void inline be_set_sess_last(struct proxy *be)
+static inline void be_set_sess_last(struct proxy *be)
 {
        be->be_counters.last_sess = now.tv_sec;
 }
index b509dff0fbc5e47742ea784ceb739ec552308a0e..172c3d56188702a8144f02f508166b60e17a4e2a 100644 (file)
@@ -119,7 +119,7 @@ static inline void proxy_reset_timeouts(struct proxy *proxy)
 }
 
 /* increase the number of cumulated connections received on the designated frontend */
-static void inline proxy_inc_fe_conn_ctr(struct listener *l, struct proxy *fe)
+static inline void proxy_inc_fe_conn_ctr(struct listener *l, struct proxy *fe)
 {
        _HA_ATOMIC_ADD(&fe->fe_counters.cum_conn, 1);
        if (l->counters)
@@ -129,7 +129,7 @@ static void inline proxy_inc_fe_conn_ctr(struct listener *l, struct proxy *fe)
 }
 
 /* increase the number of cumulated connections accepted by the designated frontend */
-static void inline proxy_inc_fe_sess_ctr(struct listener *l, struct proxy *fe)
+static inline void proxy_inc_fe_sess_ctr(struct listener *l, struct proxy *fe)
 {
 
        _HA_ATOMIC_ADD(&fe->fe_counters.cum_sess, 1);
@@ -140,7 +140,7 @@ static void inline proxy_inc_fe_sess_ctr(struct listener *l, struct proxy *fe)
 }
 
 /* increase the number of cumulated connections on the designated backend */
-static void inline proxy_inc_be_ctr(struct proxy *be)
+static inline void proxy_inc_be_ctr(struct proxy *be)
 {
        _HA_ATOMIC_ADD(&be->be_counters.cum_conn, 1);
        HA_ATOMIC_UPDATE_MAX(&be->be_counters.sps_max,
@@ -148,7 +148,7 @@ static void inline proxy_inc_be_ctr(struct proxy *be)
 }
 
 /* increase the number of cumulated requests on the designated frontend */
-static void inline proxy_inc_fe_req_ctr(struct proxy *fe)
+static inline void proxy_inc_fe_req_ctr(struct proxy *fe)
 {
        _HA_ATOMIC_ADD(&fe->fe_counters.p.http.cum_req, 1);
        HA_ATOMIC_UPDATE_MAX(&fe->fe_counters.p.http.rps_max,
index cc6a699a86a2e9322437e9ef1309d82552ad3950..77a53128aaa6ceedd90d80ec485f011b8a9a9e5b 100644 (file)
@@ -69,7 +69,7 @@ struct task *srv_cleanup_idle_connections(struct task *task, void *ctx, unsigned
 struct task *srv_cleanup_toremove_connections(struct task *task, void *context, unsigned short state);
 
 /* increase the number of cumulated connections on the designated server */
-static void inline srv_inc_sess_ctr(struct server *s)
+static inline void srv_inc_sess_ctr(struct server *s)
 {
        _HA_ATOMIC_ADD(&s->counters.cum_sess, 1);
        HA_ATOMIC_UPDATE_MAX(&s->counters.sps_max,
@@ -77,7 +77,7 @@ static void inline srv_inc_sess_ctr(struct server *s)
 }
 
 /* set the time of last session on the designated server */
-static void inline srv_set_sess_last(struct server *s)
+static inline void srv_set_sess_last(struct server *s)
 {
        s->counters.last_sess = now.tv_sec;
 }
index 71ca8497a7242e5dea55bd69c67e10063ec68bf8..d99079ff90ca56cdbb0433716bbfcadf290e2df3 100644 (file)
@@ -202,7 +202,7 @@ static inline void stream_track_stkctr(struct stkctr *ctr, struct stktable *t, s
 }
 
 /* Increase the number of cumulated HTTP requests in the tracked counters */
-static void inline stream_inc_http_req_ctr(struct stream *s)
+static inline void stream_inc_http_req_ctr(struct stream *s)
 {
        struct stksess *ts;
        void *ptr;
@@ -240,7 +240,7 @@ static void inline stream_inc_http_req_ctr(struct stream *s)
 /* Increase the number of cumulated HTTP requests in the backend's tracked
  * counters. We don't look up the session since it cannot happen in the bakcend.
  */
-static void inline stream_inc_be_http_req_ctr(struct stream *s)
+static inline void stream_inc_be_http_req_ctr(struct stream *s)
 {
        struct stksess *ts;
        void *ptr;
@@ -280,7 +280,7 @@ static void inline stream_inc_be_http_req_ctr(struct stream *s)
  * Note that even 404 are interesting because they're generally caused by
  * vulnerability scans.
  */
-static void inline stream_inc_http_err_ctr(struct stream *s)
+static inline void stream_inc_http_err_ctr(struct stream *s)
 {
        struct stksess *ts;
        void *ptr;
@@ -315,20 +315,20 @@ static void inline stream_inc_http_err_ctr(struct stream *s)
        }
 }
 
-static void inline __stream_add_srv_conn(struct stream *sess, struct server *srv)
+static inline void __stream_add_srv_conn(struct stream *sess, struct server *srv)
 {
        sess->srv_conn = srv;
        LIST_ADD(&srv->actconns, &sess->by_srv);
 }
 
-static void inline stream_add_srv_conn(struct stream *sess, struct server *srv)
+static inline void stream_add_srv_conn(struct stream *sess, struct server *srv)
 {
        HA_SPIN_LOCK(SERVER_LOCK, &srv->lock);
        __stream_add_srv_conn(sess, srv);
        HA_SPIN_UNLOCK(SERVER_LOCK, &srv->lock);
 }
 
-static void inline stream_del_srv_conn(struct stream *sess)
+static inline void stream_del_srv_conn(struct stream *sess)
 {
        struct server *srv = sess->srv_conn;
 
@@ -341,7 +341,7 @@ static void inline stream_del_srv_conn(struct stream *sess)
        HA_SPIN_UNLOCK(SERVER_LOCK, &srv->lock);
 }
 
-static void inline stream_init_srv_conn(struct stream *sess)
+static inline void stream_init_srv_conn(struct stream *sess)
 {
        sess->srv_conn = NULL;
        LIST_INIT(&sess->by_srv);
index 89b5c9a5f97c8e26277365283eae91b4870c2d14..9190ba9bcd7bf96e3706560cd9ec8ea5043becf3 100644 (file)
@@ -71,7 +71,7 @@ struct pipe *get_pipe()
        return ret;
 }
 
-static void inline __kill_pipe(struct pipe *p)
+static inline void __kill_pipe(struct pipe *p)
 {
        close(p->prod);
        close(p->cons);
index 25a918931094f77bdc9c620d41c463043fa972d0..d2473c550f9b492df51e95edc0249b0de6f0425e 100644 (file)
@@ -531,7 +531,7 @@ static int srv_parse_no_check_send_proxy(char **args, int *cur_arg,
 }
 
 /* Disable server PROXY protocol flags. */
-static int inline srv_disable_pp_flags(struct server *srv, unsigned int flags)
+static inline int srv_disable_pp_flags(struct server *srv, unsigned int flags)
 {
        srv->pp_opts &= ~flags;
        return 0;
@@ -560,7 +560,7 @@ static int srv_parse_non_stick(char **args, int *cur_arg,
 }
 
 /* Enable server PROXY protocol flags. */
-static int inline srv_enable_pp_flags(struct server *srv, unsigned int flags)
+static inline int srv_enable_pp_flags(struct server *srv, unsigned int flags)
 {
        srv->pp_opts |= flags;
        return 0;
index 53d313251a63d5a6fe28f765bf34e09adc618165..93bf53dd6b756625911ce1a038581228ae0a3e8b 100644 (file)
@@ -521,7 +521,7 @@ static void ssl_async_fd_free(int fd)
  * function used to manage a returned SSL_ERROR_WANT_ASYNC
  * and enable/disable polling for async fds
  */
-static void inline ssl_async_process_fds(struct connection *conn, SSL *ssl)
+static inline void ssl_async_process_fds(struct connection *conn, SSL *ssl)
 {
        OSSL_ASYNC_FD add_fd[32];
        OSSL_ASYNC_FD del_fd[32];