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

Jaak Ristioja jaak.ristioja at cyber.ee
Tue Dec 16 17:18:34 CET 2014


---
 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 250206b..13222f0 100644
--- a/lib/gnutls_str.c
+++ b/lib/gnutls_str.c
@@ -110,13 +110,13 @@ 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) {
 			if (dest->length && dest->data)
@@ -130,8 +130,8 @@ _gnutls_buffer_append_data(gnutls_buffer_st * dest, const void *data,
 
 		return tot_len;
 	} 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