From: Vladimír Čunát Date: Fri, 2 Nov 2018 11:30:32 +0000 (+0100) Subject: lib/generic/queue: remove a ssize_t cast X-Git-Tag: v3.1.0~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3a4363066321de55f13f7194c879a8ee95b250b;p=thirdparty%2Fknot-resolver.git lib/generic/queue: remove a ssize_t cast The Alpine-based Docker image wouldn't compile. I can't see a reason for the cast now - it's a sum of compile-time constants, and very unlikely to overflow on changes in code or platform. --- diff --git a/lib/generic/queue.c b/lib/generic/queue.c index 7bda79015..45657c7c5 100644 --- a/lib/generic/queue.c +++ b/lib/generic/queue.c @@ -25,7 +25,7 @@ KR_EXPORT void queue_init_impl(struct queue *q, size_t item_size) /* Take 128 B (two x86 cache lines), except a small margin * that the allocator can use for its overhead. * Normally (64-bit pointers) this means 16 B header + 13*8 B data. */ - q->chunk_cap = ( ((ssize_t)128) - offsetof(struct queue_chunk, data) + q->chunk_cap = (128 - offsetof(struct queue_chunk, data) - sizeof(size_t) ) / item_size; if (!q->chunk_cap) q->chunk_cap = 1; /* item_size big enough by itself */