History

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

See 651ee9346105b9d492e01172ab447c04d03fa32e fcc4ed1efa1a7575dc45fe57ce552af331941469

James Almer committed 8 years ago

Commit 8a8d0b31 parent 75027067 files · +32 −0Browse files

Unified · Split

7 files
  1. doc/APIchanges +4 −0
  2. libavutil/hash.c +4 −0
  3. libavutil/hash.h +6 −0
  4. libavutil/murmur3.c +4 −0
  5. libavutil/murmur3.h +6 −0
  6. libavutil/ripemd.c +4 −0
  7. libavutil/ripemd.h +4 −0
doc/APIchanges+4−0
@@ -15,6 +15,10 @@ libavutil: 2017-10-21 · 14 unmodified lines
1515
1616 API changes, most recent first:
1717
18+2018-02-xx - xxxxxxx
19+ Change av_ripemd_update(), av_murmur3_update() and av_hash_update() length
20+ parameter type to size_t at next major bump.
21+
1822 2018-02-xx - xxxxxxx - lavfi 7.12.100 - avfilter.h
1923 Add AVFilterContext.extra_hw_frames.
2024
libavutil/hash.c+4−0
@@ -155,7 +155,11 @@ void av_hash_init(AVHashContext *ctx) · 154 unmodified lines
155155 }
156156 }
157157
158+#if FF_API_CRYPTO_SIZE_T
158159 void av_hash_update(AVHashContext *ctx, const uint8_t *src, int len)
160+#else
161+void av_hash_update(AVHashContext *ctx, const uint8_t *src, size_t len)
162+#endif
159163 {
160164 switch (ctx->type) {
161165 case MD5: av_md5_update(ctx->ctx, src, len); break;
libavutil/hash.h+6−0
@@ -29,6 +29,8 @@ · 28 unmodified lines
2929
3030 #include <stdint.h>
3131
32+#include "version.h"
33+
3234 /**
3335 * @defgroup lavu_hash Hash Functions
3436 * @ingroup lavu_crypto
@@ -179,7 +181,11 @@ void av_hash_init(struct AVHashContext *ctx); · 144 unmodified lines
179181 * @param[in] src Data to be added to the hash context
180182 * @param[in] len Size of the additional data
181183 */
184+#if FF_API_CRYPTO_SIZE_T
182185 void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, int len);
186+#else
187+void av_hash_update(struct AVHashContext *ctx, const uint8_t *src, size_t len);
188+#endif
183189
184190 /**
185191 * Finalize a hash context and compute the actual hash value.
libavutil/murmur3.c+4−0
@@ -89,7 +89,11 @@ static inline uint64_t update_h2(uint64_t k, uint64_t h1, uint64_t h2) · 88 unmodified lines
8989 return k;
9090 }
9191
92+#if FF_API_CRYPTO_SIZE_T
9293 void av_murmur3_update(AVMurMur3 *c, const uint8_t *src, int len)
94+#else
95+void av_murmur3_update(AVMurMur3 *c, const uint8_t *src, size_t len)
96+#endif
9397 {
9498 const uint8_t *end;
9599 uint64_t h1 = c->h1, h2 = c->h2;
libavutil/murmur3.h+6−0
@@ -29,6 +29,8 @@ · 28 unmodified lines
2929
3030 #include <stdint.h>
3131
32+#include "version.h"
33+
3234 /**
3335 * @defgroup lavu_murmur3 Murmur3
3436 * @ingroup lavu_hash
@@ -97,7 +99,11 @@ void av_murmur3_init(struct AVMurMur3 *c); · 62 unmodified lines
9799 * @param[in] src Input data to update hash with
98100 * @param[in] len Number of bytes to read from `src`
99101 */
102+#if FF_API_CRYPTO_SIZE_T
100103 void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, int len);
104+#else
105+void av_murmur3_update(struct AVMurMur3 *c, const uint8_t *src, size_t len);
106+#endif
101107
102108 /**
103109 * Finish hashing and output digest value.
libavutil/ripemd.c+4−0
@@ -510,7 +510,11 @@ av_cold int av_ripemd_init(AVRIPEMD *ctx, int bits) · 509 unmodified lines
510510 return 0;
511511 }
512512
513+#if FF_API_CRYPTO_SIZE_T
513514 void av_ripemd_update(AVRIPEMD* ctx, const uint8_t* data, unsigned int len)
515+#else
516+void av_ripemd_update(AVRIPEMD* ctx, const uint8_t* data, size_t len)
517+#endif
514518 {
515519 unsigned int i, j;
516520
libavutil/ripemd.h+4−0
@@ -66,7 +66,11 @@ int av_ripemd_init(struct AVRIPEMD* context, int bits); · 65 unmodified lines
6666 * @param data input data to update hash with
6767 * @param len input data length
6868 */
69+#if FF_API_CRYPTO_SIZE_T
6970 void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, unsigned int len);
71+#else
72+void av_ripemd_update(struct AVRIPEMD* context, const uint8_t* data, size_t len);
73+#endif
7074
7175 /**
7276 * Finish hashing and output digest value.

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