CLEANUP: Make parameters of srv_downtime and srv_getinter const

The parameters of srv_downtime and srv_getinter are not modified
and thus may be const.

Signed-off-by: Simon Horman <horms@verge.net.au>
This commit is contained in:
Simon Horman 2013-11-01 16:46:15 +09:00 committed by Willy Tarreau
parent e155ec245a
commit a360844735
2 changed files with 4 additions and 4 deletions

View File

@ -32,8 +32,8 @@
#include <proto/queue.h>
#include <proto/freq_ctr.h>
int srv_downtime(struct server *s);
int srv_getinter(struct server *s);
int srv_downtime(const struct server *s);
int srv_getinter(const struct server *s);
/* increase the number of cumulated connections on the designated server */
static void inline srv_inc_sess_ctr(struct server *s)

View File

@ -22,7 +22,7 @@ static struct srv_kw_list srv_keywords = {
.list = LIST_HEAD_INIT(srv_keywords.list)
};
int srv_downtime(struct server *s)
int srv_downtime(const struct server *s)
{
if ((s->state & SRV_RUNNING) && s->last_change < now.tv_sec) // ignore negative time
return s->down_time;
@ -30,7 +30,7 @@ int srv_downtime(struct server *s)
return now.tv_sec - s->last_change + s->down_time;
}
int srv_getinter(struct server *s)
int srv_getinter(const struct server *s)
{
if ((s->state & SRV_CHECKED) && (s->health == s->rise + s->fall - 1))
return s->inter;