Make parameters const pointer

This commit is contained in:
Tatsuhiro Tsujikawa 2016-08-16 10:55:51 +09:00
parent f50596e355
commit c4d36aeff7
4 changed files with 13 additions and 12 deletions

View File

@ -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

View File

@ -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;

View File

@ -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 */

View File

@ -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;