diff options
author | Francois Perrad <francois.perrad@gadz.org> | 2017-08-19 17:16:13 +0200 |
---|---|---|
committer | Francois Perrad <francois.perrad@gadz.org> | 2017-08-19 17:16:13 +0200 |
commit | 89e64c631ec8dee41ec4de888548d36887b6ec98 (patch) | |
tree | 91fc3aee54e9b9cac7ec893ddf91cb944e3fc220 /buffer.c | |
parent | 468656b4aab5bc0040e3ecbfd7f66f52a15da76d (diff) |
Pointer parameter could be declared as pointing to const
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -67,7 +67,7 @@ void buf_free(buffer* buf) { } /* overwrite the contents of the buffer to clear it */ -void buf_burn(buffer* buf) { +void buf_burn(const buffer* buf) { m_burn(buf->data, buf->size); @@ -91,7 +91,7 @@ buffer* buf_resize(buffer *buf, unsigned int newsize) { /* Create a copy of buf, allocating required memory etc. */ /* The new buffer is sized the same as the length of the source buffer. */ -buffer* buf_newcopy(buffer* buf) { +buffer* buf_newcopy(const buffer* buf) { buffer* ret; @@ -184,7 +184,7 @@ void buf_putbyte(buffer* buf, unsigned char val) { /* returns an in-place pointer to the buffer, checking that * the next len bytes from that position can be used */ -unsigned char* buf_getptr(buffer* buf, unsigned int len) { +unsigned char* buf_getptr(const buffer* buf, unsigned int len) { if (len > BUF_MAX_INCR || buf->pos + len > buf->len) { dropbear_exit("Bad buf_getptr"); @@ -194,7 +194,7 @@ unsigned char* buf_getptr(buffer* buf, unsigned int len) { /* like buf_getptr, but checks against total size, not used length. * This allows writing past the used length, but not past the size */ -unsigned char* buf_getwriteptr(buffer* buf, unsigned int len) { +unsigned char* buf_getwriteptr(const buffer* buf, unsigned int len) { if (len > BUF_MAX_INCR || buf->pos + len > buf->size) { dropbear_exit("Bad buf_getwriteptr"); |