The branch, master has been updated
via a8dd83b4b17de6a740bf55928b0a9b4f8c7d8626 (commit)
from 36e5576a44b36698614e95956c5cb6b213c29ef3 (commit)
- Log -----------------------------------------------------------------
commit a8dd83b4b17de6a740bf55928b0a9b4f8c7d8626
Author: Andreas Rheinhardt <[email protected]>
AuthorDate: Wed Nov 5 14:36:31 2025 +0100
Commit: Andreas Rheinhardt <[email protected]>
CommitDate: Sat Nov 8 14:48:12 2025 +0100
avcodec/get_bits: Avoid unused variable
Fixes lots of warnings from MSVC (which does not support av_unused).
Reviewed-by: Kacper MichajÅow <[email protected]>
Reviewed-by: Lynne <[email protected]>
Reviewed-by: Martin Storsjö <[email protected]>
Signed-off-by: Andreas Rheinhardt <[email protected]>
diff --git a/libavcodec/get_bits.h b/libavcodec/get_bits.h
index 85c87c65b1..a0c0f51276 100644
--- a/libavcodec/get_bits.h
+++ b/libavcodec/get_bits.h
@@ -166,18 +166,22 @@ static inline unsigned int show_bits(GetBitContext *s,
int n);
#define MIN_CACHE_BITS 25
+#define OPEN_READER_NOSIZE_NOCACHE(name, gb) \
+ unsigned int name ## _index = (gb)->index
+
#define OPEN_READER_NOSIZE(name, gb) \
- unsigned int name ## _index = (gb)->index; \
- av_unused unsigned int name ## _cache
+ OPEN_READER_NOSIZE_NOCACHE(name, gb); \
+ unsigned int name ## _cache
#if UNCHECKED_BITSTREAM_READER
#define OPEN_READER(name, gb) OPEN_READER_NOSIZE(name, gb)
-
+#define OPEN_READER_SIZE(name, gb) ((void)0)
#define BITS_AVAILABLE(name, gb) 1
#else
+#define OPEN_READER_SIZE(name, gb) unsigned int name ## _size_plus8 =
(gb)->size_in_bits_plus8
#define OPEN_READER(name, gb) \
OPEN_READER_NOSIZE(name, gb); \
- unsigned int name ## _size_plus8 = (gb)->size_in_bits_plus8
+ OPEN_READER_SIZE(name, gb)
#define BITS_AVAILABLE(name, gb) name ## _index < name ## _size_plus8
#endif
@@ -378,7 +382,8 @@ static inline unsigned int show_bits(GetBitContext *s, int
n)
static inline void skip_bits(GetBitContext *s, int n)
{
- OPEN_READER(re, s);
+ OPEN_READER_NOSIZE_NOCACHE(re, s);
+ OPEN_READER_SIZE(re, s);
LAST_SKIP_BITS(re, s, n);
CLOSE_READER(re, s);
}
-----------------------------------------------------------------------
Summary of changes:
libavcodec/get_bits.h | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
hooks/post-receive
--
_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]