diff options
author | Frediano Ziglio <fziglio@redhat.com> | 2015-08-17 11:38:08 +0100 |
---|---|---|
committer | Frediano Ziglio <fziglio@redhat.com> | 2016-01-27 18:38:43 +0000 |
commit | 07b3150cb1c3a028a0b2631f6a1aa6605372a99a (patch) | |
tree | 868008bc158a23370305b35ce691261892347bcc /common/marshaller.c | |
parent | 7790dacfd3fe0b6624f64260ed5e7375dcf06aae (diff) | |
download | spice-common-07b3150cb1c3a028a0b2631f6a1aa6605372a99a.tar.gz spice-common-07b3150cb1c3a028a0b2631f6a1aa6605372a99a.tar.xz spice-common-07b3150cb1c3a028a0b2631f6a1aa6605372a99a.zip |
common: constify some declarations
Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
Diffstat (limited to 'common/marshaller.c')
-rw-r--r-- | common/marshaller.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/common/marshaller.c b/common/marshaller.c index c967371..c1d208e 100644 --- a/common/marshaller.c +++ b/common/marshaller.c @@ -347,9 +347,12 @@ uint8_t *spice_marshaller_add(SpiceMarshaller *m, const uint8_t *data, size_t si return ptr; } -uint8_t *spice_marshaller_add_ref(SpiceMarshaller *m, uint8_t *data, size_t size) +uint8_t *spice_marshaller_add_ref(SpiceMarshaller *m, const uint8_t *data, size_t size) { - return spice_marshaller_add_ref_full(m, data, size, NULL, NULL); + /* the cast to no-const here is safe as data is used for writing only if + * free_data pointer is not NULL + */ + return spice_marshaller_add_ref_full(m, (uint8_t *) data, size, NULL, NULL); } void spice_marshaller_add_ref_chunks(SpiceMarshaller *m, SpiceChunks *chunks) |