avutil/crypto: change length parameter to size_t on the remaining modules

See 651ee93461
fcc4ed1efa

Signed-off-by: James Almer <jamrial@gmail.com>
This commit is contained in:
James Almer 2018-02-15 11:12:54 -03:00
parent 75027066d8
commit 8a8d0b319a
7 changed files with 32 additions and 0 deletions

View File

@ -15,6 +15,10 @@ libavutil: 2017-10-21
API changes, most recent first: API changes, most recent first:
2018-02-xx - xxxxxxx
Change av_ripemd_update(), av_murmur3_update() and av_hash_update() length
parameter type to size_t at next major bump.
2018-02-xx - xxxxxxx - lavfi 7.12.100 - avfilter.h 2018-02-xx - xxxxxxx - lavfi 7.12.100 - avfilter.h
Add AVFilterContext.extra_hw_frames. Add AVFilterContext.extra_hw_frames.

View File

@ -155,7 +155,11 @@ void av_hash_init(AVHashContext *ctx)
} }
} }
#if FF_API_CRYPTO_SIZE_T
void av_hash_update(AVHashContext *ctx, const uint8_t *src, int len) void av_hash_update(AVHashContext *ctx, const uint8_t *src, int len)
#else
void av_hash_update(AVHashContext *ctx, const uint8_t *src, size_t len)
#endif
{ {
switch (ctx->type) { switch (ctx->type) {
case MD5: av_md5_update(ctx->ctx, src, len); break; case MD5: av_md5_update(ctx->ctx, src, len); break;

View File

@ -29,6 +29,8 @@
#include <stdint.h> #include <stdint.h>
#include "version.h"
/** /**
* @defgroup lavu_hash Hash Functions * @defgroup lavu_hash Hash Functions
* @ingroup lavu_crypto * @ingroup lavu_crypto
@ -179,7 +181,11 @@ void av_hash_init(struct AVHashContext *ctx);
* @param[in] src Data to be added to the hash context * @param[in] src Data to be added to the hash context
* @param[in] len Size of the additional data * @param[in] len Size of the additional data
*/ */
#if FF_API_CRYPTO_SIZE_T
void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, int len); void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, int len);
#else
void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, size_t len);
#endif
/** /**
* Finalize a hash context and compute the actual hash value. * Finalize a hash context and compute the actual hash value.

View File

@ -89,7 +89,11 @@ static inline uint64_t update_h2(uint64_t k, uint64_t h1, uint64_t h2)
return k; return k;
} }
#if FF_API_CRYPTO_SIZE_T
void av_murmur3_update(AVMurMur3 *c, const uint8_t *src, int len) void av_murmur3_update(AVMurMur3 *c, const uint8_t *src, int len)
#else
void av_murmur3_update(AVMurMur3 *c, const uint8_t *src, size_t len)
#endif
{ {
const uint8_t *end; const uint8_t *end;
uint64_t h1 = c->h1, h2 = c->h2; uint64_t h1 = c->h1, h2 = c->h2;

View File

@ -29,6 +29,8 @@
#include <stdint.h> #include <stdint.h>
#include "version.h"
/** /**
* @defgroup lavu_murmur3 Murmur3 * @defgroup lavu_murmur3 Murmur3
* @ingroup lavu_hash * @ingroup lavu_hash
@ -97,7 +99,11 @@ void av_murmur3_init(struct AVMurMur3 *c);
* @param[in] src Input data to update hash with * @param[in] src Input data to update hash with
* @param[in] len Number of bytes to read from `src` * @param[in] len Number of bytes to read from `src`
*/ */
#if FF_API_CRYPTO_SIZE_T
void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, int len); void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, int len);
#else
void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, size_t len);
#endif
/** /**
* Finish hashing and output digest value. * Finish hashing and output digest value.

View File

@ -510,7 +510,11 @@ av_cold int av_ripemd_init(AVRIPEMD *ctx, int bits)
return 0; return 0;
} }
#if FF_API_CRYPTO_SIZE_T
void av_ripemd_update(AVRIPEMD* ctx, const uint8_t* data, unsigned int len) void av_ripemd_update(AVRIPEMD* ctx, const uint8_t* data, unsigned int len)
#else
void av_ripemd_update(AVRIPEMD* ctx, const uint8_t* data, size_t len)
#endif
{ {
unsigned int i, j; unsigned int i, j;

View File

@ -66,7 +66,11 @@ int av_ripemd_init(struct AVRIPEMD* context, int bits);
* @param data input data to update hash with * @param data input data to update hash with
* @param len input data length * @param len input data length
*/ */
#if FF_API_CRYPTO_SIZE_T
void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, unsigned int len); void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, unsigned int len);
#else
void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, size_t len);
#endif
/** /**
* Finish hashing and output digest value. * Finish hashing and output digest value.