From: Willy Tarreau Date: Wed, 28 Apr 2021 15:44:37 +0000 (+0200) Subject: CLEANUP: freq_ctr: make arguments of freq_ctr_total() const X-Git-Tag: v2.4-dev18~17 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b4476c6a8;p=thirdparty%2Fhaproxy.git CLEANUP: freq_ctr: make arguments of freq_ctr_total() const freq_ctr_total() doesn't modify the freq counters, it should take a const argument. --- diff --git a/include/haproxy/freq_ctr.h b/include/haproxy/freq_ctr.h index 83fe90e09c..93c3eaebaf 100644 --- a/include/haproxy/freq_ctr.h +++ b/include/haproxy/freq_ctr.h @@ -29,7 +29,7 @@ #include /* exported functions from freq_ctr.c */ -ullong freq_ctr_total(struct freq_ctr *ctr, uint period, int pend); +ullong freq_ctr_total(const struct freq_ctr *ctr, uint period, int pend); /* Update a frequency counter by incremental units. It is automatically * rotated if the period is over. It is important that it correctly initializes diff --git a/src/freq_ctr.c b/src/freq_ctr.c index 974c12f9d9..747a4cc4a5 100644 --- a/src/freq_ctr.c +++ b/src/freq_ctr.c @@ -25,7 +25,7 @@ * read_freq_ctr_period() to avoid reporting ups and downs on low-frequency * events when the past value is <= 1. */ -ullong freq_ctr_total(struct freq_ctr *ctr, uint period, int pend) +ullong freq_ctr_total(const struct freq_ctr *ctr, uint period, int pend) { ullong curr, past; uint curr_tick;