size_t is the correct type to use for sizes.
Unified · Split
| @@ -13,6 +13,10 @@ libavutil: 2015-08-28 · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | API changes, most recent first: |
| 15 | 15 | |
| 16 | +2016-xx-xx - xxxxxxx | |
| 17 | + Change av_sha_update() and av_md5_sum()/av_md5_update() length | |
| 18 | + parameter type to size_t at next major bump. | |
| 19 | + | |
| 16 | 20 | 2016-xx-xx - xxxxxxx - lavc 57.29.0 - avcodec.h |
| 17 | 21 | Add AV_PKT_DATA_SPHERICAL packet side data to export AVSphericalMapping |
| 18 | 22 | information from containers. |
| @@ -146,7 +146,11 @@ void av_md5_init(AVMD5 *ctx) · 145 unmodified lines | ||
| 146 | 146 | ctx->ABCD[3] = 0x67452301; |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | +#if FF_API_CRYPTO_SIZE_T | |
| 149 | 150 | void av_md5_update(AVMD5 *ctx, const uint8_t *src, const int len) |
| 151 | +#else | |
| 152 | +void av_md5_update(AVMD5 *ctx, const uint8_t *src, size_t len) | |
| 153 | +#endif | |
| 150 | 154 | { |
| 151 | 155 | int i, j; |
| 152 | 156 | |
| @@ -177,7 +181,11 @@ void av_md5_final(AVMD5 *ctx, uint8_t *dst) · 24 unmodified lines | ||
| 177 | 181 | AV_WL32(dst + 4 * i, ctx->ABCD[3 - i]); |
| 178 | 182 | } |
| 179 | 183 | |
| 184 | +#if FF_API_CRYPTO_SIZE_T | |
| 180 | 185 | void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len) |
| 186 | +#else | |
| 187 | +void av_md5_sum(uint8_t *dst, const uint8_t *src, size_t len) | |
| 188 | +#endif | |
| 181 | 189 | { |
| 182 | 190 | AVMD5 ctx; |
| 183 | 191 | |
| @@ -21,6 +21,7 @@ · 20 unmodified lines | ||
| 21 | 21 | #ifndef AVUTIL_MD5_H |
| 22 | 22 | #define AVUTIL_MD5_H |
| 23 | 23 | |
| 24 | +#include <stddef.h> | |
| 24 | 25 | #include <stdint.h> |
| 25 | 26 | |
| 26 | 27 | #include "attributes.h" |
| @@ -36,9 +37,14 @@ struct AVMD5; · 9 unmodified lines | ||
| 36 | 37 | |
| 37 | 38 | struct AVMD5 *av_md5_alloc(void); |
| 38 | 39 | void av_md5_init(struct AVMD5 *ctx); |
| 39 | −void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, const int len); | |
| 40 | 40 | void av_md5_final(struct AVMD5 *ctx, uint8_t *dst); |
| 41 | +#if FF_API_CRYPTO_SIZE_T | |
| 42 | +void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, const int len); | |
| 41 | 43 | void av_md5_sum(uint8_t *dst, const uint8_t *src, const int len); |
| 44 | +#else | |
| 45 | +void av_md5_update(struct AVMD5 *ctx, const uint8_t *src, size_t len); | |
| 46 | +void av_md5_sum(uint8_t *dst, const uint8_t *src, size_t len); | |
| 47 | +#endif | |
| 42 | 48 | |
| 43 | 49 | /** |
| 44 | 50 | * @} |
| @@ -290,7 +290,11 @@ av_cold int av_sha_init(AVSHA *ctx, int bits) · 289 unmodified lines | ||
| 290 | 290 | return 0; |
| 291 | 291 | } |
| 292 | 292 | |
| 293 | −void av_sha_update(AVSHA* ctx, const uint8_t* data, unsigned int len) | |
| 293 | +#if FF_API_CRYPTO_SIZE_T | |
| 294 | +void av_sha_update(struct AVSHA *ctx, const uint8_t *data, unsigned int len) | |
| 295 | +#else | |
| 296 | +void av_sha_update(struct AVSHA *ctx, const uint8_t *data, size_t len) | |
| 297 | +#endif | |
| 294 | 298 | { |
| 295 | 299 | unsigned int i, j; |
| 296 | 300 | |
| @@ -21,6 +21,7 @@ · 20 unmodified lines | ||
| 21 | 21 | #ifndef AVUTIL_SHA_H |
| 22 | 22 | #define AVUTIL_SHA_H |
| 23 | 23 | |
| 24 | +#include <stddef.h> | |
| 24 | 25 | #include <stdint.h> |
| 25 | 26 | |
| 26 | 27 | #include "attributes.h" |
| @@ -51,11 +52,15 @@ int av_sha_init(struct AVSHA* context, int bits); · 24 unmodified lines | ||
| 51 | 52 | /** |
| 52 | 53 | * Update hash value. |
| 53 | 54 | * |
| 54 | − * @param context hash function context | |
| 55 | + * @param ctx hash function context | |
| 55 | 56 | * @param data input data to update hash with |
| 56 | 57 | * @param len input data length |
| 57 | 58 | */ |
| 58 | −void av_sha_update(struct AVSHA* context, const uint8_t* data, unsigned int len); | |
| 59 | +#if FF_API_CRYPTO_SIZE_T | |
| 60 | +void av_sha_update(struct AVSHA *ctx, const uint8_t *data, unsigned int len); | |
| 61 | +#else | |
| 62 | +void av_sha_update(struct AVSHA *ctx, const uint8_t *data, size_t len); | |
| 63 | +#endif | |
| 59 | 64 | |
| 60 | 65 | /** |
| 61 | 66 | * Finish hashing and output digest value. |
| @@ -105,6 +105,9 @@ · 104 unmodified lines | ||
| 105 | 105 | #ifndef FF_API_PKT_PTS |
| 106 | 106 | #define FF_API_PKT_PTS (LIBAVUTIL_VERSION_MAJOR < 56) |
| 107 | 107 | #endif |
| 108 | +#ifndef FF_API_CRYPTO_SIZE_T | |
| 109 | +#define FF_API_CRYPTO_SIZE_T (LIBAVUTIL_VERSION_MAJOR < 56) | |
| 110 | +#endif | |
| 108 | 111 | |
| 109 | 112 | |
| 110 | 113 | /** |