Mercurial > libjeffpc
changeset 704:2735e0d2f0b1
cbor: remove const from cbor_unpack_blob data argument's type
Since we will be "returning" a newly malloc'd buffer, there is no reason for
us prevent the caller from modifying it. Therefore, we should be using a
void * instead of const void *.
Signed-off-by: Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
author | Josef 'Jeff' Sipek <jeffpc@josefsipek.net> |
---|---|
date | Mon, 18 Mar 2019 17:50:35 -0400 |
parents | 7cd40d019de4 |
children | 4f2c0ba43681 |
files | fmt_cbor.c include/jeffpc/cbor.h |
diffstat | 2 files changed, 2 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/fmt_cbor.c Tue Mar 19 11:48:47 2019 -0400 +++ b/fmt_cbor.c Mon Mar 18 17:50:35 2019 -0400 @@ -585,8 +585,7 @@ return ret; } -int cbor_unpack_blob(struct buffer *buffer, const void **data, - size_t *size) +int cbor_unpack_blob(struct buffer *buffer, void **data, size_t *size) { return -ENOTSUP; }
--- a/include/jeffpc/cbor.h Tue Mar 19 11:48:47 2019 -0400 +++ b/include/jeffpc/cbor.h Mon Mar 18 17:50:35 2019 -0400 @@ -65,8 +65,7 @@ extern int cbor_unpack_uint(struct buffer *buffer, uint64_t *v); extern int cbor_unpack_nint(struct buffer *buffer, uint64_t *v); extern int cbor_unpack_int(struct buffer *buffer, int64_t *v); -extern int cbor_unpack_blob(struct buffer *buffer, const void **data, - size_t *size); +extern int cbor_unpack_blob(struct buffer *buffer, void **data, size_t *size); extern int cbor_unpack_cstr_len(struct buffer *buffer, char **str, size_t *len); extern int cbor_unpack_str(struct buffer *buffer, struct str **str);