]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
bitstream: fix `BIT_readBits` and `BIT_reloadDStream` prototypes
authorAlexander Moch <mail@alexmoch.com>
Thu, 1 Jan 2026 09:56:31 +0000 (10:56 +0100)
committerNick Terrell <nickrterrell@gmail.com>
Fri, 27 Feb 2026 21:37:40 +0000 (16:37 -0500)
Align the declarations of BIT_readBits() and BIT_reloadDStream() in
bitstream.h with their FORCE_INLINE_TEMPLATE definitions.

The previous MEM_STATIC declarations caused an attribute mismatch
between the header and the definitions, which can lead to incorrect
compiler assumptions under certain toolchains and optimization levels.

Signed-off-by: Alexander Moch <mail@alexmoch.com>
lib/common/bitstream.h

index 3b7ad483d9e978537679e8b00796ba169295dfe7..6ff482a8399704c78d10ccba9c59045095603142 100644 (file)
@@ -102,8 +102,8 @@ typedef enum { BIT_DStream_unfinished = 0,  /* fully refilled */
     } BIT_DStream_status;  /* result of BIT_reloadDStream() */
 
 MEM_STATIC size_t   BIT_initDStream(BIT_DStream_t* bitD, const void* srcBuffer, size_t srcSize);
-MEM_STATIC BitContainerType BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits);
-MEM_STATIC BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD);
+FORCE_INLINE_TEMPLATE BitContainerType BIT_readBits(BIT_DStream_t* bitD, unsigned nbBits);
+FORCE_INLINE_TEMPLATE BIT_DStream_status BIT_reloadDStream(BIT_DStream_t* bitD);
 MEM_STATIC unsigned BIT_endOfDStream(const BIT_DStream_t* bitD);