]> git.ipfire.org Git - thirdparty/haproxy.git/commit
CLEANUP: ncbuf: remove ncb_blk args by value
authorAmaury Denoyelle <adenoyelle@haproxy.com>
Mon, 28 Nov 2022 10:06:42 +0000 (11:06 +0100)
committerAmaury Denoyelle <adenoyelle@haproxy.com>
Tue, 29 Nov 2022 14:12:54 +0000 (15:12 +0100)
commit17e20e8cefbdd6518f362325cd528aee2bcdb277
tree0901ef393aab5ac24a2f1235195b9fd9e9a78f4b
parent16b282f4b0ac4c24b592f9dd83177f61c90e088b
CLEANUP: ncbuf: remove ncb_blk args by value

ncb_blk structure is used to represent a block of data or a gap in a
non-contiguous buffer. This is used in several functions for ncbuf
implementation. Before this patch, ncb_blk was passed by value, which is
sub-optimal. Replace this by const pointer arguments.

This has the side-effect of suppressing a compiler warning reported in
older GCC version :
  CC      src/http_conv.o
  src/ncbuf.c: In function 'ncb_blk_next':
  src/ncbuf.c:170: warning: 'blk.end' may be used uninitialized in this function

This should be backported up to 2.6.
src/ncbuf.c