diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2017-07-31 12:21:48 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2017-07-31 12:21:48 +0000 |
commit | a28a432f7823cf2173d6f1e54c99438503d3174f (patch) | |
tree | c278f7343cd2cd40f3071a25c10c5da01484a0bc /src/include | |
parent | 3c5f5aea891c85dbdfc4d287d7ebf2bb813d6405 (diff) | |
download | skalibs-a28a432f7823cf2173d6f1e54c99438503d3174f.tar.xz |
Make cbuffer_?peek take a const; make *_init not leak when misused
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/skalibs/cbuffer.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/include/skalibs/cbuffer.h b/src/include/skalibs/cbuffer.h index c29af5d..45d2e69 100644 --- a/src/include/skalibs/cbuffer.h +++ b/src/include/skalibs/cbuffer.h @@ -34,7 +34,7 @@ extern size_t cbuffer_putv (cbuffer_t *, struct iovec const *, unsigned int) ; #define cbuffer_UNPUT(b, w) ((b)->n = ((b)->a + (b)->n - w) % (b)->a, w) ; extern size_t cbuffer_unput (cbuffer_t *, size_t) ; -extern void cbuffer_wpeek (cbuffer_t *, struct iovec *) ; +extern void cbuffer_wpeek (cbuffer_t const *, struct iovec *) ; #define cbuffer_WSEEK(b, w) ((b)->n = ((b)->n + (w)) % (b)->a, w) extern size_t cbuffer_wseek (cbuffer_t *, size_t) ; @@ -46,7 +46,7 @@ extern size_t cbuffer_getv (cbuffer_t *, struct iovec const *, unsigned int) ; #define cbuffer_UNGET(b, n) ((b)->p = ((b)->a + (b)->p - n) % (b)->a, n) ; extern size_t cbuffer_unget (cbuffer_t *, size_t) ; -extern void cbuffer_rpeek (cbuffer_t *, struct iovec *) ; +extern void cbuffer_rpeek (cbuffer_t const *, struct iovec *) ; #define cbuffer_RSEEK(b, n) ((b)->p = ((b)->p + (n)) % (b)->a, n) extern size_t cbuffer_rseek (cbuffer_t *, size_t) ; |