From c4d36aeff7d88b4bfff087e61b120bdb0c64a46b Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Tue, 16 Aug 2016 10:55:51 +0900 Subject: [PATCH] Make parameters const pointer --- lib/includes/nghttp2/nghttp2.h | 6 +++--- lib/nghttp2_buf.c | 6 +++--- lib/nghttp2_buf.h | 6 +++--- lib/nghttp2_hd.c | 7 ++++--- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/lib/includes/nghttp2/nghttp2.h b/lib/includes/nghttp2/nghttp2.h index 51d003fc..bf814edd 100644 --- a/lib/includes/nghttp2/nghttp2.h +++ b/lib/includes/nghttp2/nghttp2.h @@ -4628,9 +4628,9 @@ nghttp2_hd_deflate_hd(nghttp2_hd_deflater *deflater, uint8_t *buf, * The provided |buflen| size is too small to hold the output. */ NGHTTP2_EXTERN ssize_t -nghttp2_hd_deflate_hd_vec(nghttp2_hd_deflater *deflater, uint8_t **bufsin, - size_t inlen, size_t buflen, size_t *buflens, - const nghttp2_nv *nva, size_t nvlen); +nghttp2_hd_deflate_hd_vec(nghttp2_hd_deflater *deflater, uint8_t *const *bufsin, + size_t inlen, size_t buflen, size_t *const buflens, + const nghttp2_nv *nva, size_t nvlen); /** * @function diff --git a/lib/nghttp2_buf.c b/lib/nghttp2_buf.c index afe54464..490cae67 100644 --- a/lib/nghttp2_buf.c +++ b/lib/nghttp2_buf.c @@ -223,8 +223,8 @@ int nghttp2_bufs_wrap_init(nghttp2_bufs *bufs, uint8_t *begin, size_t len, return 0; } -int nghttp2_bufs_wrap_init2(nghttp2_bufs *bufs, uint8_t **bufs_in, size_t in_len, - size_t buf_len, nghttp2_mem *mem) { +int nghttp2_bufs_wrap_init2(nghttp2_bufs *bufs, uint8_t *const *bufs_in, + size_t in_len, size_t buf_len, nghttp2_mem *mem) { size_t i = 0; nghttp2_buf_chain *cur_chain; nghttp2_buf_chain *pre_chain = NULL; @@ -305,7 +305,7 @@ size_t nghttp2_bufs_len(nghttp2_bufs *bufs) { return len; } -size_t nghttp2_bufs_len_vec(nghttp2_bufs *bufs, size_t *buflens) { +size_t nghttp2_bufs_len_vec(nghttp2_bufs *bufs, size_t *const buflens) { nghttp2_buf_chain *ci; size_t len, total_len = 0; int i = 0; diff --git a/lib/nghttp2_buf.h b/lib/nghttp2_buf.h index c7259c03..36e8df95 100644 --- a/lib/nghttp2_buf.h +++ b/lib/nghttp2_buf.h @@ -223,8 +223,8 @@ int nghttp2_bufs_wrap_init(nghttp2_bufs *bufs, uint8_t *begin, size_t len, * NGHTTP2_ERR_NOMEM * Out of memory. */ -int nghttp2_bufs_wrap_init2(nghttp2_bufs *bufs, uint8_t **bufs_in, size_t in_len, - size_t buf_len, nghttp2_mem *mem); +int nghttp2_bufs_wrap_init2(nghttp2_bufs *bufs, uint8_t *const *bufs_in, + size_t in_len, size_t buf_len, nghttp2_mem *mem); /* * Frees any related resource to the |bufs|. This function does not @@ -404,6 +404,6 @@ size_t nghttp2_bufs_len(nghttp2_bufs *bufs); /* * Returns the total buffer length of |bufs|, and each buffer length in |buflens|. */ -size_t nghttp2_bufs_len_vec(nghttp2_bufs *bufs, size_t *buflens); +size_t nghttp2_bufs_len_vec(nghttp2_bufs *bufs, size_t *const buflens); #endif /* NGHTTP2_BUF_H */ diff --git a/lib/nghttp2_hd.c b/lib/nghttp2_hd.c index 49c23245..acdbc874 100644 --- a/lib/nghttp2_hd.c +++ b/lib/nghttp2_hd.c @@ -1503,9 +1503,10 @@ ssize_t nghttp2_hd_deflate_hd(nghttp2_hd_deflater *deflater, uint8_t *buf, return (ssize_t)buflen; } -ssize_t nghttp2_hd_deflate_hd_vec(nghttp2_hd_deflater *deflater, uint8_t **bufsin, - size_t inlen, size_t buflen, size_t *buflens, - const nghttp2_nv *nv, size_t nvlen) { +ssize_t nghttp2_hd_deflate_hd_vec(nghttp2_hd_deflater *deflater, + uint8_t *const *bufsin, size_t inlen, + size_t buflen, size_t *const buflens, + const nghttp2_nv *nv, size_t nvlen) { nghttp2_bufs bufs; int rv; nghttp2_mem *mem;