]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: hdr_idx: make some function arguments const where possible
authorWilly Tarreau <w@1wt.eu>
Mon, 17 Jul 2017 18:46:05 +0000 (20:46 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 17 Jul 2017 19:11:30 +0000 (21:11 +0200)
Functions hdr_idx_first_idx() and hdr_idx_first_pos() were missing a
"const" qualifier on their arguments which are not modified, causing
a warning in some experimental H2 code.

include/proto/hdr_idx.h

index 3de4361178e97cbf26ecaa046ee2b1bc4e481611..0536444f268853a6b500724a721a48d653a3479e 100644 (file)
@@ -47,7 +47,7 @@ static inline void hdr_idx_init(struct hdr_idx *list)
  * the first header just after the request or response. If zero is returned, it
  * means that the list is empty.
  */
-static inline int hdr_idx_first_idx(struct hdr_idx *list)
+static inline int hdr_idx_first_idx(const struct hdr_idx *list)
 {
        return list->v[0].next;
 }
@@ -58,7 +58,7 @@ static inline int hdr_idx_first_idx(struct hdr_idx *list)
  * end of the headers if the request has no header. hdr_idx_start_idx() should
  * be checked before to ensure there is a valid header.
  */
-static inline int hdr_idx_first_pos(struct hdr_idx *list)
+static inline int hdr_idx_first_pos(const struct hdr_idx *list)
 {
        return list->v[0].len + list->v[0].cr + 1;
 }