]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: freq_ctr: make arguments of freq_ctr_total() const
authorWilly Tarreau <w@1wt.eu>
Wed, 28 Apr 2021 15:44:37 +0000 (17:44 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 28 Apr 2021 15:44:37 +0000 (17:44 +0200)
freq_ctr_total() doesn't modify the freq counters, it should take a
const argument.

include/haproxy/freq_ctr.h
src/freq_ctr.c

index 83fe90e09c6a80d923597ed625dc6311c8eacbcf..93c3eaebaf78c9419361f70c92df7d6703428231 100644 (file)
@@ -29,7 +29,7 @@
 #include <haproxy/time.h>
 
 /* 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 <inc> incremental units. It is automatically
  * rotated if the period is over. It is important that it correctly initializes
index 974c12f9d94a9aa9e414f3d2c9d9a8c1dc82ee43..747a4cc4a54b0834189403c9a9aa74920b2a7d4c 100644 (file)
@@ -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;