History

avutil/adler32: Switch av_adler32_update() to size_t on bump

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.

Andreas Rheinhardt committed 5 years ago

Commit e8c0bca1 parent a46d7814 files · +26 −3Browse files

Unified · Split

4 files
  1. doc/APIchanges +7 −0
  2. libavutil/adler32.c +4 −0
  3. libavutil/adler32.h +14 −2
  4. libavutil/version.h +1 −1
doc/APIchanges+7−0
@@ -15,6 +15,13 @@ libavutil: 2017-10-21 · 14 unmodified lines
1515
1616 API changes, most recent first:
1717
18+2021-03-19 - xxxxxxxxxx - lavu 56.69.100 - adler32.h
19+ Added a typedef for the type of the Adler-32 checksums
20+ used by av_adler32_update(). It will be changed to uint32_t
21+ at the next major bump.
22+ The type of the parameter for the length of the input buffer
23+ will also be changed to size_t at the next major bump.
24+
1825 2021-03-19 - xxxxxxxxxx - lavf 58.75.100 - avformat.h
1926 AVChapter.id will be changed from int to int64_t
2027 on the next major version bump.
libavutil/adler32.c+4−0
@@ -41,8 +41,12 @@ · 40 unmodified lines
4141 #define DO4(buf) DO1(buf); DO1(buf); DO1(buf); DO1(buf);
4242 #define DO16(buf) DO4(buf); DO4(buf); DO4(buf); DO4(buf);
4343
44+#if FF_API_CRYPTO_SIZE_T
4445 unsigned long av_adler32_update(unsigned long adler, const uint8_t * buf,
4546 unsigned int len)
47+#else
48+AVAdler av_adler32_update(AVAdler adler, const uint8_t *buf, size_t len)
49+#endif
4650 {
4751 unsigned long s1 = adler & 0xffff;
4852 unsigned long s2 = adler >> 16;
libavutil/adler32.h+14−2
@@ -27,8 +27,10 @@ · 26 unmodified lines
2727 #ifndef AVUTIL_ADLER32_H
2828 #define AVUTIL_ADLER32_H
2929
30+#include <stddef.h>
3031 #include <stdint.h>
3132 #include "attributes.h"
33+#include "version.h"
3234
3335 /**
3436 * @defgroup lavu_adler32 Adler-32
@@ -38,6 +40,12 @@ · 3 unmodified lines
3840 * @{
3941 */
4042
43+#if FF_API_CRYPTO_SIZE_T
44+typedef unsigned long AVAdler;
45+#else
46+typedef uint32_t AVAdler;
47+#endif
48+
4149 /**
4250 * Calculate the Adler32 checksum of a buffer.
4351 *
@@ -50,8 +58,12 @@ · 6 unmodified lines
5058 * @param len size of input buffer
5159 * @return updated checksum
5260 */
53−unsigned long av_adler32_update(unsigned long adler, const uint8_t *buf,
54− unsigned int len) av_pure;
61+AVAdler av_adler32_update(AVAdler adler, const uint8_t *buf,
62+#if FF_API_CRYPTO_SIZE_T
63+ unsigned int len) av_pure;
64+#else
65+ size_t len) av_pure;
66+#endif
5567
5668 /**
5769 * @}
libavutil/version.h+1−1
@@ -79,7 +79,7 @@ · 78 unmodified lines
7979 */
8080
8181 #define LIBAVUTIL_VERSION_MAJOR 56
82−#define LIBAVUTIL_VERSION_MINOR 68
82+#define LIBAVUTIL_VERSION_MINOR 69
8383 #define LIBAVUTIL_VERSION_MICRO 100
8484
8585 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t