[FFmpeg-devel] [PATCH] avcodec/put_bits: Fix LZW warning

Steinar H. Gunderson steinar+ffmpeg at gunderson.no
Sun Jul 19 19:15:42 EEST 2020


lzwenc stores a function pointer to either put_bits or put_bits_le.
Update the function pointer's prototype after the recent change.
---
 libavcodec/lzw.h    | 4 +++-
 libavcodec/lzwenc.c | 4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/libavcodec/lzw.h b/libavcodec/lzw.h
index 6af8a6b83a..400a479809 100644
--- a/libavcodec/lzw.h
+++ b/libavcodec/lzw.h
@@ -32,6 +32,8 @@
 
 #include <stdint.h>
 
+#include "put_bits.h"
+
 struct PutBitContext;
 
 enum FF_LZW_MODES{
@@ -55,7 +57,7 @@ extern const int ff_lzw_encode_state_size;
 
 void ff_lzw_encode_init(struct LZWEncodeState *s, uint8_t *outbuf, int outsize,
                         int maxbits, enum FF_LZW_MODES mode,
-                        void (*lzw_put_bits)(struct PutBitContext *, int, unsigned int));
+                        void (*lzw_put_bits)(struct PutBitContext *, int, BitBuf));
 int ff_lzw_encode(struct LZWEncodeState * s, const uint8_t * inbuf, int insize);
 int ff_lzw_encode_flush(struct LZWEncodeState *s,
                         void (*lzw_flush_put_bits)(struct PutBitContext *));
diff --git a/libavcodec/lzwenc.c b/libavcodec/lzwenc.c
index 03080ee587..c1b96905e8 100644
--- a/libavcodec/lzwenc.c
+++ b/libavcodec/lzwenc.c
@@ -60,7 +60,7 @@ typedef struct LZWEncodeState {
     int output_bytes;        ///< Number of written bytes
     int last_code;           ///< Value of last output code or LZW_PREFIX_EMPTY
     enum FF_LZW_MODES mode;  ///< TIFF or GIF
-    void (*put_bits)(PutBitContext *, int, unsigned); ///< GIF is LE while TIFF is BE
+    void (*put_bits)(PutBitContext *, int, BitBuf); ///< GIF is LE while TIFF is BE
 }LZWEncodeState;
 
 
@@ -201,7 +201,7 @@ static int writtenBytes(LZWEncodeState *s){
  */
 void ff_lzw_encode_init(LZWEncodeState *s, uint8_t *outbuf, int outsize,
                         int maxbits, enum FF_LZW_MODES mode,
-                        void (*lzw_put_bits)(PutBitContext *, int, unsigned))
+                        void (*lzw_put_bits)(PutBitContext *, int, BitBuf))
 {
     s->clear_code = 256;
     s->end_code = 257;
-- 
2.20.1



More information about the ffmpeg-devel mailing list