]> git.sesse.net Git - ffmpeg/commitdiff
avutil/adler32: Switch av_adler32_update() to size_t on bump
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Thu, 18 Mar 2021 03:33:28 +0000 (04:33 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 19 Mar 2021 03:19:53 +0000 (04:19 +0100)
av_adler32_update() is used by av_hash_update() which will be switched
to size_t at the next bump. So it also has to be made to use size_t.
This is also necessary for framecrcenc.c, because the size of side data
will become a size_t, too.

Reviewed-by: James Almer <jamrial@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
doc/APIchanges
libavutil/adler32.c
libavutil/adler32.h
libavutil/version.h

index 937ea70fbcf62499f54752be25bc5d123071cbfc..6e116dbc83ca871ce4679db8f00b66e61c4be056 100644 (file)
@@ -15,6 +15,13 @@ libavutil:     2017-10-21
 
 API changes, most recent first:
 
+2021-03-19 - xxxxxxxxxx - lavu 56.69.100 - adler32.h
+  Added a typedef for the type of the Adler-32 checksums
+  used by av_adler32_update(). It will be changed to uint32_t
+  at the next major bump.
+  The type of the parameter for the length of the input buffer
+  will also be changed to size_t at the next major bump.
+
 2021-03-19 - xxxxxxxxxx - lavf 58.75.100  - avformat.h
   AVChapter.id will be changed from int to int64_t
   on the next major version bump.
index c87d5e261c4803b86d888dc180d7c3c1d34d526c..5ed5ff55a382724d31c84f327d805db8ee846616 100644 (file)
 #define DO4(buf)  DO1(buf); DO1(buf); DO1(buf); DO1(buf);
 #define DO16(buf) DO4(buf); DO4(buf); DO4(buf); DO4(buf);
 
+#if FF_API_CRYPTO_SIZE_T
 unsigned long av_adler32_update(unsigned long adler, const uint8_t * buf,
                                 unsigned int len)
+#else
+AVAdler av_adler32_update(AVAdler adler, const uint8_t *buf, size_t len)
+#endif
 {
     unsigned long s1 = adler & 0xffff;
     unsigned long s2 = adler >> 16;
index a1f035b7340f8b7d0fd6327e3a9b65189c4e93a4..e7a8f83729e3473469eee42207f686dfeea27b4b 100644 (file)
 #ifndef AVUTIL_ADLER32_H
 #define AVUTIL_ADLER32_H
 
+#include <stddef.h>
 #include <stdint.h>
 #include "attributes.h"
+#include "version.h"
 
 /**
  * @defgroup lavu_adler32 Adler-32
  * @{
  */
 
+#if FF_API_CRYPTO_SIZE_T
+typedef unsigned long AVAdler;
+#else
+typedef uint32_t AVAdler;
+#endif
+
 /**
  * Calculate the Adler32 checksum of a buffer.
  *
  * @param len   size of input buffer
  * @return      updated checksum
  */
-unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf,
-                                unsigned int len) av_pure;
+AVAdler av_adler32_update(AVAdler adler, const uint8_t *buf,
+#if FF_API_CRYPTO_SIZE_T
+                          unsigned int len) av_pure;
+#else
+                          size_t len) av_pure;
+#endif
 
 /**
  * @}
index 9a290d57e783b4cbdf37f9d409429bdd14f8f3e8..f357f6165ed948fb3d270ff63a5c8f0b3e3b2f43 100644 (file)
@@ -79,7 +79,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  56
-#define LIBAVUTIL_VERSION_MINOR  68
+#define LIBAVUTIL_VERSION_MINOR  69
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \