diff options
author | David Robillard <d@drobilla.net> | 2024-09-27 13:06:20 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2024-09-27 18:16:57 -0400 |
commit | 287e07ebaa5fbcf9be0ce0cb1981798fc04bc9f1 (patch) | |
tree | 727a8a5e95e37f5c679d6391254913f3d9303b7b /src/byte_sink.h | |
parent | 771215229522e203eba802bc041a1d8105de9283 (diff) | |
download | serd-287e07ebaa5fbcf9be0ce0cb1981798fc04bc9f1.tar.gz serd-287e07ebaa5fbcf9be0ce0cb1981798fc04bc9f1.tar.bz2 serd-287e07ebaa5fbcf9be0ce0cb1981798fc04bc9f1.zip |
Make function parameters const wherever possible
The early history of this code didn't tend to make parameters const, but the
"const density" is high enough now that I often find myself wondering if
something is mutable for some reason, or just old and sloppier. So, eliminate
this confusion by making (hopefully) all function parameters const if possible.
Diffstat (limited to 'src/byte_sink.h')
-rw-r--r-- | src/byte_sink.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/byte_sink.h b/src/byte_sink.h index 65b5eb12..b99b5551 100644 --- a/src/byte_sink.h +++ b/src/byte_sink.h @@ -22,7 +22,7 @@ typedef struct SerdByteSinkImpl { } SerdByteSink; static inline SerdByteSink -serd_byte_sink_new(SerdSink sink, void* stream, size_t block_size) +serd_byte_sink_new(SerdSink sink, void* const stream, const size_t block_size) { SerdByteSink bsink = {sink, stream, NULL, 0, block_size}; @@ -34,7 +34,7 @@ serd_byte_sink_new(SerdSink sink, void* stream, size_t block_size) } static inline SerdStatus -serd_byte_sink_flush(SerdByteSink* bsink) +serd_byte_sink_flush(SerdByteSink* const bsink) { if (bsink->block_size > 1 && bsink->size > 0) { const size_t size = bsink->size; @@ -48,7 +48,7 @@ serd_byte_sink_flush(SerdByteSink* bsink) } static inline void -serd_byte_sink_free(SerdByteSink* bsink) +serd_byte_sink_free(SerdByteSink* const bsink) { serd_byte_sink_flush(bsink); serd_free_aligned(bsink->buf); @@ -56,7 +56,7 @@ serd_byte_sink_free(SerdByteSink* bsink) } static inline size_t -serd_byte_sink_write(const void* buf, size_t len, SerdByteSink* bsink) +serd_byte_sink_write(const void* buf, size_t len, SerdByteSink* const bsink) { if (len == 0) { return 0; |