Skip to content

Commit 498a31a

Browse files
authored
MONGOCRYPT-750 change mc_#Token_new_from_buffer{_copy} arguments to const (#917)
* change function arguments to const * fix formatting error * fix another formatting error
1 parent 6910440 commit 498a31a

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/mc-tokens-private.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,9 @@
9090
/* Destructor */ \
9191
extern void BSON_CONCAT(Prefix, _destroy)(T * t); \
9292
/* Constructor for server to shallow copy tokens from raw buffer */ \
93-
extern T *BSON_CONCAT(Prefix, _new_from_buffer)(_mongocrypt_buffer_t * buf); \
93+
extern T *BSON_CONCAT(Prefix, _new_from_buffer)(const _mongocrypt_buffer_t *buf); \
9494
/* Constructor for server to deep copy tokens from raw buffer */ \
95-
extern T *BSON_CONCAT(Prefix, _new_from_buffer_copy)(_mongocrypt_buffer_t * buf); \
95+
extern T *BSON_CONCAT(Prefix, _new_from_buffer_copy)(const _mongocrypt_buffer_t *buf); \
9696
/* Constructor. Parameter list given as variadic args */ \
9797
extern T *BSON_CONCAT(Prefix, _new)(_mongocrypt_crypto_t * crypto, __VA_ARGS__, mongocrypt_status_t * status)
9898

src/mc-tokens.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,14 @@
3939
bson_free(self); \
4040
} \
4141
/* Constructor. Shallow copy from raw buffer */ \
42-
T *BSON_CONCAT(Prefix, _new_from_buffer)(_mongocrypt_buffer_t * buf) { \
42+
T *BSON_CONCAT(Prefix, _new_from_buffer)(const _mongocrypt_buffer_t *buf) { \
4343
BSON_ASSERT(buf->len == MONGOCRYPT_HMAC_SHA256_LEN); \
4444
T *t = bson_malloc(sizeof(T)); \
4545
_mongocrypt_buffer_set_to(buf, &t->data); \
4646
return t; \
4747
} \
4848
/* Constructor. Deep copy from raw buffer */ \
49-
T *BSON_CONCAT(Prefix, _new_from_buffer_copy)(_mongocrypt_buffer_t * buf) { \
49+
T *BSON_CONCAT(Prefix, _new_from_buffer_copy)(const _mongocrypt_buffer_t *buf) { \
5050
BSON_ASSERT(buf->len == MONGOCRYPT_HMAC_SHA256_LEN); \
5151
T *t = bson_malloc(sizeof(T)); \
5252
_mongocrypt_buffer_init(&t->data); \

0 commit comments

Comments
 (0)