From ba9f03d72d415199c5383a06a2aad59aa0ba64c7 Mon Sep 17 00:00:00 2001 From: "Dusan Cervenka (nxa14949)" Date: Fri, 14 Sep 2018 14:48:58 +0200 Subject: [PATCH] Make const members which deserves it. --- lib/includes/nghttp2/nghttp2.h | 8 ++++---- lib/nghttp2_hd.c | 3 +-- lib/nghttp2_hd.h | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/includes/nghttp2/nghttp2.h b/lib/includes/nghttp2/nghttp2.h index 8c54b9c8..a5dc10dd 100644 --- a/lib/includes/nghttp2/nghttp2.h +++ b/lib/includes/nghttp2/nghttp2.h @@ -1747,8 +1747,8 @@ typedef int (*nghttp2_on_header_callback)(nghttp2_session *session, */ typedef int (*nghttp2_on_header_callback2)(nghttp2_session *session, const nghttp2_frame *frame, - nghttp2_rcbuf *name, - nghttp2_rcbuf *value, uint8_t flags, + const nghttp2_rcbuf *name, + const nghttp2_rcbuf *value, uint8_t flags, void *user_data); /** @@ -1815,8 +1815,8 @@ typedef int (*nghttp2_on_invalid_header_callback)( * :enum:`NGHTTP2_ERR_TEMPORAL_CALLBACK_FAILURE`. */ typedef int (*nghttp2_on_invalid_header_callback2)( - nghttp2_session *session, const nghttp2_frame *frame, nghttp2_rcbuf *name, - nghttp2_rcbuf *value, uint8_t flags, void *user_data); + nghttp2_session *session, const nghttp2_frame *frame, const nghttp2_rcbuf *name, + const nghttp2_rcbuf *value, uint8_t flags, void *user_data); /** * @functypedef diff --git a/lib/nghttp2_hd.c b/lib/nghttp2_hd.c index 82cc23de..e6d605bf 100644 --- a/lib/nghttp2_hd.c +++ b/lib/nghttp2_hd.c @@ -1290,8 +1290,7 @@ nghttp2_hd_nv nghttp2_hd_table_get(nghttp2_hd_context *context, size_t idx) { ->nv; } else { const nghttp2_hd_static_entry *ent = &static_table[idx]; - nghttp2_hd_nv nv = {(nghttp2_rcbuf *)&ent->name, - (nghttp2_rcbuf *)&ent->value, ent->token, + nghttp2_hd_nv nv = {&ent->name, &ent->value, ent->token, NGHTTP2_NV_FLAG_NONE}; return nv; } diff --git a/lib/nghttp2_hd.h b/lib/nghttp2_hd.h index c64a1f2b..96081d13 100644 --- a/lib/nghttp2_hd.h +++ b/lib/nghttp2_hd.h @@ -119,10 +119,10 @@ typedef struct nghttp2_hd_entry nghttp2_hd_entry; typedef struct { /* The buffer containing header field name. NULL-termination is guaranteed. */ - nghttp2_rcbuf *name; + const nghttp2_rcbuf *name; /* The buffer containing header field value. NULL-termination is guaranteed. */ - nghttp2_rcbuf *value; + const nghttp2_rcbuf *value; /* nghttp2_token value for name. It could be -1 if we have no token for that header field name. */ int32_t token; @@ -236,7 +236,7 @@ struct nghttp2_hd_inflater { nghttp2_rcbuf *namercbuf, *valuercbuf; /* Pointer to the name/value pair which are used in the current header emission. */ - nghttp2_rcbuf *nv_name_keep, *nv_value_keep; + const nghttp2_rcbuf *nv_name_keep, *nv_value_keep; /* The number of bytes to read */ size_t left; /* The index in indexed repr or indexed name */