]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: h3: mark ncbuf as const on h3_b_dup
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 24 May 2022 16:14:28 +0000 (18:14 +0200)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Wed, 25 May 2022 13:41:25 +0000 (15:41 +0200)
h3_b_dup() is used to obtains a ncbuf representation into a struct
buffer. ncbuf can thus be marked as a const parameter. This will allows
function which already manipulates a const ncbuf to use it.

src/h3.c

index d61b8e3e74450726f91b74c906f38f963ae7bc9e..0fd22fe9780d687d6726f158bdcb320cc347eaa6 100644 (file)
--- a/src/h3.c
+++ b/src/h3.c
@@ -77,7 +77,7 @@ struct h3s {
 DECLARE_STATIC_POOL(pool_head_h3s, "h3s", sizeof(struct h3s));
 
 /* Simple function to duplicate a buffer */
-static inline struct buffer h3_b_dup(struct ncbuf *b)
+static inline struct buffer h3_b_dup(const struct ncbuf *b)
 {
        return b_make(ncb_orig(b), b->size, b->head, ncb_data(b, 0));
 }