From: Willy Tarreau Date: Mon, 15 Apr 2019 19:25:03 +0000 (+0200) Subject: BUILD: address a few cases of "static inline foo()" X-Git-Tag: v2.0-dev3~269 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0e492e2ad01528f24859992e48b543e0a6b4b3e7;p=thirdparty%2Fhaproxy.git BUILD: address a few cases of "static inline foo()" Older compilers don't like to see "inline" placed after the type in a function declaration, it must be "static inline " only. This patch touches various areas. The warnings were seen with gcc-3.4. --- diff --git a/include/proto/backend.h b/include/proto/backend.h index 54ae057fd5..e98df2b164 100644 --- a/include/proto/backend.h +++ b/include/proto/backend.h @@ -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; } diff --git a/include/proto/proxy.h b/include/proto/proxy.h index b509dff0fb..172c3d5618 100644 --- a/include/proto/proxy.h +++ b/include/proto/proxy.h @@ -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, diff --git a/include/proto/server.h b/include/proto/server.h index cc6a699a86..77a53128aa 100644 --- a/include/proto/server.h +++ b/include/proto/server.h @@ -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; } diff --git a/include/proto/stream.h b/include/proto/stream.h index 71ca8497a7..d99079ff90 100644 --- a/include/proto/stream.h +++ b/include/proto/stream.h @@ -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); diff --git a/src/pipe.c b/src/pipe.c index 89b5c9a5f9..9190ba9bcd 100644 --- a/src/pipe.c +++ b/src/pipe.c @@ -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); diff --git a/src/server.c b/src/server.c index 25a9189310..d2473c550f 100644 --- a/src/server.c +++ b/src/server.c @@ -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; diff --git a/src/ssl_sock.c b/src/ssl_sock.c index 53d313251a..93bf53dd6b 100644 --- a/src/ssl_sock.c +++ b/src/ssl_sock.c @@ -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];