From 1d6003e5750d537f45e7fe780b54358662b9252b Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Tue, 21 Jan 2020 21:01:05 -0500 Subject: [PATCH] [core] mark some chunk.c funcs as pure --- src/chunk.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/chunk.c b/src/chunk.c index 25c100ac..d8a9f201 100644 --- a/src/chunk.c +++ b/src/chunk.c @@ -43,12 +43,15 @@ void chunkqueue_set_tempdirs_default_reset (void) } /* chunk buffer (c->mem) is never NULL; specialize routines from buffer.h */ +__attribute_pure__ static inline size_t chunk_buffer_string_length(const buffer *b) { return 0 != b->used ? b->used - 1 : 0; } +__attribute_pure__ static inline int chunk_buffer_string_is_empty(const buffer *b) { return b->used < 2; } +__attribute_pure__ static inline size_t chunk_buffer_string_space(const buffer *b) { return b->size ? b->size - (b->used | (0 == b->used)) : 0; } @@ -220,6 +223,7 @@ void chunkqueue_chunk_pool_free(void) chunk_buffers = NULL; } +__attribute_pure__ static off_t chunk_remaining_length(const chunk *c) { /* MEM_CHUNK or FILE_CHUNK */ return (c->type == MEM_CHUNK