[gnutls-devel] [PATCH 1/4] Explicitly marked some variables const in _gnutls_buffer_append_data().

Jaak Ristioja jaak.ristioja at cyber.ee
Wed Dec 17 12:55:07 CET 2014


Signed-off-by: Jaak Ristioja <jaak.ristioja at cyber.ee>
---
 lib/gnutls_str.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/lib/gnutls_str.c b/lib/gnutls_str.c
index 340463d..06141f4 100644
--- a/lib/gnutls_str.c
+++ b/lib/gnutls_str.c
@@ -117,20 +117,20 @@ int
 _gnutls_buffer_append_data(gnutls_buffer_st * dest, const void *data,
 			   size_t data_size)
 {
-	size_t tot_len = data_size + dest->length;
+	size_t const tot_len = data_size + dest->length;
 
 	if (data_size == 0)
 		return 0;
 
 	if (dest->max_length >= tot_len) {
-		size_t unused = MEMSUB(dest->data, dest->allocd);
+		size_t const unused = MEMSUB(dest->data, dest->allocd);
 
 		if (dest->max_length - unused <= tot_len) {
 			align_allocd_with_data(dest);
 		}
 	} else {
-		size_t unused = MEMSUB(dest->data, dest->allocd);
-		size_t new_len =
+		size_t const unused = MEMSUB(dest->data, dest->allocd);
+		size_t const new_len =
 		    MAX(data_size, MIN_CHUNK) + MAX(dest->max_length,
 						    MIN_CHUNK);
 
-- 
2.2.0




More information about the Gnutls-devel mailing list