Skip to content

Commit 84b0d0f

Browse files
committed
Second round of fixing compiler warnings in ext/hash. Lots of the signatures that previously was unsigned int is now size_t, there was a fair bit of inconsistency there already and this commit should make it all sync nicely
1 parent f7991ca commit 84b0d0f

17 files changed

+52
-58
lines changed

ext/hash/hash.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename,
276276

277277
if (isfilename) {
278278
char buf[1024];
279-
int n;
279+
size_t n;
280280
ops->hash_init(context);
281281
ops->hash_update(context, K, ops->block_size);
282282
while ((n = php_stream_read(stream, buf, sizeof(buf))) > 0) {
@@ -671,7 +671,7 @@ PHP_FUNCTION(hash_hkdf)
671671
// Expand
672672
returnval = zend_string_alloc(length, 0);
673673
digest = emalloc(ops->digest_size);
674-
for (i = 1, rounds = (length - 1) / ops->digest_size + 1; i <= rounds; i++) {
674+
for (i = 1, rounds = (int) (length - 1) / ops->digest_size + 1; i <= rounds; i++) {
675675
// chr(i)
676676
unsigned char c[1];
677677
c[0] = (i & 0xFF);
@@ -831,7 +831,7 @@ PHP_FUNCTION(hash_pbkdf2)
831831
if (raw_output) {
832832
memcpy(ZSTR_VAL(returnval), result, length);
833833
} else {
834-
php_hash_bin2hex(ZSTR_VAL(returnval), result, digest_length);
834+
php_hash_bin2hex(ZSTR_VAL(returnval), result, (int) digest_length);
835835
}
836836
ZSTR_VAL(returnval)[length] = 0;
837837
efree(result);

ext/hash/hash_fnv.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,13 @@ PHP_HASH_API void PHP_FNV132Init(PHP_FNV132_CTX *context)
7676
/* }}} */
7777

7878
PHP_HASH_API void PHP_FNV132Update(PHP_FNV132_CTX *context, const unsigned char *input,
79-
unsigned int inputLen)
79+
size_t inputLen)
8080
{
8181
context->state = fnv_32_buf((void *)input, inputLen, context->state, 0);
8282
}
8383

8484
PHP_HASH_API void PHP_FNV1a32Update(PHP_FNV132_CTX *context, const unsigned char *input,
85-
unsigned int inputLen)
85+
size_t inputLen)
8686
{
8787
context->state = fnv_32_buf((void *)input, inputLen, context->state, 1);
8888
}
@@ -111,13 +111,13 @@ PHP_HASH_API void PHP_FNV164Init(PHP_FNV164_CTX *context)
111111
/* }}} */
112112

113113
PHP_HASH_API void PHP_FNV164Update(PHP_FNV164_CTX *context, const unsigned char *input,
114-
unsigned int inputLen)
114+
size_t inputLen)
115115
{
116116
context->state = fnv_64_buf((void *)input, inputLen, context->state, 0);
117117
}
118118

119119
PHP_HASH_API void PHP_FNV1a64Update(PHP_FNV164_CTX *context, const unsigned char *input,
120-
unsigned int inputLen)
120+
size_t inputLen)
121121
{
122122
context->state = fnv_64_buf((void *)input, inputLen, context->state, 1);
123123
}

ext/hash/hash_joaat.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ PHP_HASH_API void PHP_JOAATInit(PHP_JOAAT_CTX *context)
3939
context->state = 0;
4040
}
4141

42-
PHP_HASH_API void PHP_JOAATUpdate(PHP_JOAAT_CTX *context, const unsigned char *input, unsigned int inputLen)
42+
PHP_HASH_API void PHP_JOAATUpdate(PHP_JOAAT_CTX *context, const unsigned char *input, size_t inputLen)
4343
{
4444
context->state = joaat_buf((void *)input, inputLen, context->state);
4545
}

ext/hash/hash_md.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ PHP_HASH_API void PHP_MD5Init(PHP_MD5_CTX * context)
280280
context.
281281
*/
282282
PHP_HASH_API void PHP_MD5Update(PHP_MD5_CTX * context, const unsigned char *input,
283-
unsigned int inputLen)
283+
size_t inputLen)
284284
{
285285
unsigned int i, index, partLen;
286286

@@ -539,7 +539,7 @@ PHP_HASH_API void PHP_MD4Init(PHP_MD4_CTX * context)
539539
operation, processing another message block, and updating the
540540
context.
541541
*/
542-
PHP_HASH_API void PHP_MD4Update(PHP_MD4_CTX * context, const unsigned char *input, unsigned int inputLen)
542+
PHP_HASH_API void PHP_MD4Update(PHP_MD4_CTX * context, const unsigned char *input, size_t inputLen)
543543
{
544544
unsigned int i, index, partLen;
545545

@@ -652,15 +652,15 @@ static void MD2_Transform(PHP_MD2_CTX *context, const unsigned char *block)
652652
}
653653
}
654654

655-
PHP_HASH_API void PHP_MD2Update(PHP_MD2_CTX *context, const unsigned char *buf, unsigned int len)
655+
PHP_HASH_API void PHP_MD2Update(PHP_MD2_CTX *context, const unsigned char *buf, size_t len)
656656
{
657657
const unsigned char *p = buf, *e = buf + len;
658658

659659
if (context->in_buffer) {
660660
if (context->in_buffer + len < 16) {
661661
/* Not enough for block, just pass into buffer */
662662
memcpy(context->buffer + context->in_buffer, p, len);
663-
context->in_buffer += len;
663+
context->in_buffer += (char) len;
664664
return;
665665
}
666666
/* Put buffered data together with inbound for a single block */
@@ -679,7 +679,7 @@ PHP_HASH_API void PHP_MD2Update(PHP_MD2_CTX *context, const unsigned char *buf,
679679
/* Copy remaining data to buffer */
680680
if (p < e) {
681681
memcpy(context->buffer, p, e - p);
682-
context->in_buffer = e - p;
682+
context->in_buffer = (char) (e - p);
683683
}
684684
}
685685

ext/hash/hash_ripemd.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ static void RIPEMD128Transform(uint32_t state[4], const unsigned char block[64])
255255
operation, processing another message block, and updating the
256256
context.
257257
*/
258-
PHP_HASH_API void PHP_RIPEMD128Update(PHP_RIPEMD128_CTX * context, const unsigned char *input, unsigned int inputLen)
258+
PHP_HASH_API void PHP_RIPEMD128Update(PHP_RIPEMD128_CTX * context, const unsigned char *input, size_t inputLen)
259259
{
260260
unsigned int i, index, partLen;
261261

@@ -353,7 +353,7 @@ static void RIPEMD256Transform(uint32_t state[8], const unsigned char block[64])
353353
operation, processing another message block, and updating the
354354
context.
355355
*/
356-
PHP_HASH_API void PHP_RIPEMD256Update(PHP_RIPEMD256_CTX * context, const unsigned char *input, unsigned int inputLen)
356+
PHP_HASH_API void PHP_RIPEMD256Update(PHP_RIPEMD256_CTX * context, const unsigned char *input, size_t inputLen)
357357
{
358358
unsigned int i, index, partLen;
359359

@@ -452,7 +452,7 @@ static void RIPEMD160Transform(uint32_t state[5], const unsigned char block[64])
452452
operation, processing another message block, and updating the
453453
context.
454454
*/
455-
PHP_HASH_API void PHP_RIPEMD160Update(PHP_RIPEMD160_CTX * context, const unsigned char *input, unsigned int inputLen)
455+
PHP_HASH_API void PHP_RIPEMD160Update(PHP_RIPEMD160_CTX * context, const unsigned char *input, size_t inputLen)
456456
{
457457
unsigned int i, index, partLen;
458458

@@ -560,7 +560,7 @@ static void RIPEMD320Transform(uint32_t state[10], const unsigned char block[64]
560560
operation, processing another message block, and updating the
561561
context.
562562
*/
563-
PHP_HASH_API void PHP_RIPEMD320Update(PHP_RIPEMD320_CTX * context, const unsigned char *input, unsigned int inputLen)
563+
PHP_HASH_API void PHP_RIPEMD320Update(PHP_RIPEMD320_CTX * context, const unsigned char *input, size_t inputLen)
564564
{
565565
unsigned int i, index, partLen;
566566

ext/hash/hash_sha.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ static void SHA1Transform(uint32_t state[5], const unsigned char block[64])
327327
context.
328328
*/
329329
PHP_HASH_API void PHP_SHA1Update(PHP_SHA1_CTX * context, const unsigned char *input,
330-
unsigned int inputLen)
330+
size_t inputLen)
331331
{
332332
unsigned int i, index, partLen;
333333

@@ -537,7 +537,7 @@ PHP_HASH_API void PHP_SHA224Init(PHP_SHA224_CTX * context)
537537
operation, processing another message block, and updating the
538538
context.
539539
*/
540-
PHP_HASH_API void PHP_SHA224Update(PHP_SHA224_CTX * context, const unsigned char *input, unsigned int inputLen)
540+
PHP_HASH_API void PHP_SHA224Update(PHP_SHA224_CTX * context, const unsigned char *input, size_t inputLen)
541541
{
542542
unsigned int i, index, partLen;
543543

@@ -614,7 +614,7 @@ PHP_HASH_API void PHP_SHA224Final(unsigned char digest[28], PHP_SHA224_CTX * con
614614
operation, processing another message block, and updating the
615615
context.
616616
*/
617-
PHP_HASH_API void PHP_SHA256Update(PHP_SHA256_CTX * context, const unsigned char *input, unsigned int inputLen)
617+
PHP_HASH_API void PHP_SHA256Update(PHP_SHA256_CTX * context, const unsigned char *input, size_t inputLen)
618618
{
619619
unsigned int i, index, partLen;
620620

@@ -828,9 +828,9 @@ static void SHA512Transform(uint64_t state[8], const unsigned char block[128])
828828
operation, processing another message block, and updating the
829829
context.
830830
*/
831-
PHP_HASH_API void PHP_SHA384Update(PHP_SHA384_CTX * context, const unsigned char *input, unsigned int inputLen)
831+
PHP_HASH_API void PHP_SHA384Update(PHP_SHA384_CTX * context, const unsigned char *input, size_t inputLen)
832832
{
833-
unsigned int i, index, partLen;
833+
unsigned int i = 0, index, partLen;
834834

835835
/* Compute number of bytes mod 128 */
836836
index = (unsigned int) ((context->count[0] >> 3) & 0x7F);
@@ -854,8 +854,6 @@ PHP_HASH_API void PHP_SHA384Update(PHP_SHA384_CTX * context, const unsigned char
854854
}
855855

856856
index = 0;
857-
} else {
858-
i = 0;
859857
}
860858

861859
/* Buffer remaining input */
@@ -979,7 +977,7 @@ PHP_HASH_API void PHP_SHA512_224Init(PHP_SHA512_CTX * context)
979977
operation, processing another message block, and updating the
980978
context.
981979
*/
982-
PHP_HASH_API void PHP_SHA512Update(PHP_SHA512_CTX * context, const unsigned char *input, unsigned int inputLen)
980+
PHP_HASH_API void PHP_SHA512Update(PHP_SHA512_CTX * context, const unsigned char *input, size_t inputLen)
983981
{
984982
unsigned int i, index, partLen;
985983

ext/hash/hash_sha3.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static void PHP_SHA3_Init(PHP_SHA3_CTX* ctx,
156156

157157
static void PHP_SHA3_Update(PHP_SHA3_CTX* ctx,
158158
const unsigned char* buf,
159-
unsigned int count,
159+
size_t count,
160160
size_t block_size) {
161161
while (count > 0) {
162162
unsigned int len = block_size - ctx->pos;
@@ -205,7 +205,7 @@ void PHP_SHA3##bits##Init(PHP_SHA3_##bits##_CTX* ctx) { \
205205
} \
206206
void PHP_SHA3##bits##Update(PHP_SHA3_##bits##_CTX* ctx, \
207207
const unsigned char* input, \
208-
unsigned int inputLen) { \
208+
size_t inputLen) { \
209209
PHP_SHA3_Update(ctx, input, inputLen, \
210210
(1600 - (2 * bits)) >> 3); \
211211
} \
@@ -251,7 +251,7 @@ void PHP_SHA3##bits##Init(PHP_SHA3_##bits##_CTX* ctx) { \
251251
} \
252252
void PHP_SHA3##bits##Update(PHP_SHA3_##bits##_CTX* ctx, \
253253
const unsigned char* input, \
254-
unsigned int inputLen) { \
254+
size_t inputLen) { \
255255
Keccak_HashUpdate((Keccak_HashInstance *)ctx->hashinstance, input, inputLen * 8); \
256256
} \
257257
void PHP_SHA3##bits##Final(unsigned char* digest, \

ext/hash/hash_snefru.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,9 @@ PHP_HASH_API void PHP_SNEFRUUpdate(PHP_SNEFRU_CTX *context, const unsigned char
142142
if ((MAX32 - context->count[1]) < (len * 8)) {
143143
context->count[0]++;
144144
context->count[1] = MAX32 - context->count[1];
145-
context->count[1] = (len * 8) - context->count[1];
145+
context->count[1] = ((uint32_t) len * 8) - context->count[1];
146146
} else {
147-
context->count[1] += len * 8;
147+
context->count[1] += (uint32_t) len * 8;
148148
}
149149

150150
if (context->length + len < 32) {

ext/hash/php_hash.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
#define L64 INT64_C
3131

3232
typedef void (*php_hash_init_func_t)(void *context);
33-
typedef void (*php_hash_update_func_t)(void *context, const unsigned char *buf, unsigned int count);
33+
typedef void (*php_hash_update_func_t)(void *context, const unsigned char *buf, size_t count);
3434
typedef void (*php_hash_final_func_t)(unsigned char *digest, void *context);
3535
typedef int (*php_hash_copy_func_t)(const void *ops, void *orig_context, void *dest_context);
3636

@@ -128,10 +128,6 @@ extern zend_module_entry hash_module_entry;
128128
# define PHP_HASH_API
129129
#endif
130130

131-
#ifdef ZTS
132-
#include "TSRM.h"
133-
#endif
134-
135131
PHP_FUNCTION(hash);
136132
PHP_FUNCTION(hash_file);
137133
PHP_FUNCTION(hash_hkdf);

ext/hash/php_hash_fnv.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ typedef struct {
5353

5454

5555
PHP_HASH_API void PHP_FNV132Init(PHP_FNV132_CTX *context);
56-
PHP_HASH_API void PHP_FNV132Update(PHP_FNV132_CTX *context, const unsigned char *input, unsigned int inputLen);
57-
PHP_HASH_API void PHP_FNV1a32Update(PHP_FNV132_CTX *context, const unsigned char *input, unsigned int inputLen);
56+
PHP_HASH_API void PHP_FNV132Update(PHP_FNV132_CTX *context, const unsigned char *input, size_t inputLen);
57+
PHP_HASH_API void PHP_FNV1a32Update(PHP_FNV132_CTX *context, const unsigned char *input, size_t inputLen);
5858
PHP_HASH_API void PHP_FNV132Final(unsigned char digest[16], PHP_FNV132_CTX * context);
5959

6060
PHP_HASH_API void PHP_FNV164Init(PHP_FNV164_CTX *context);
61-
PHP_HASH_API void PHP_FNV164Update(PHP_FNV164_CTX *context, const unsigned char *input, unsigned int inputLen);
62-
PHP_HASH_API void PHP_FNV1a64Update(PHP_FNV164_CTX *context, const unsigned char *input, unsigned int inputLen);
61+
PHP_HASH_API void PHP_FNV164Update(PHP_FNV164_CTX *context, const unsigned char *input, size_t inputLen);
62+
PHP_HASH_API void PHP_FNV1a64Update(PHP_FNV164_CTX *context, const unsigned char *input, size_t inputLen);
6363
PHP_HASH_API void PHP_FNV164Final(unsigned char digest[16], PHP_FNV164_CTX * context);
6464

6565
static uint32_t fnv_32_buf(void *buf, size_t len, uint32_t hval, int alternate);

ext/hash/php_hash_gost.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
/* GOST context */
2525
typedef struct {
2626
uint32_t state[16];
27-
uint32_t count[2];
27+
size_t count[2];
2828
unsigned char length;
2929
unsigned char buffer[32];
3030
const uint32_t (*tables)[4][256];

ext/hash/php_hash_joaat.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ typedef struct {
2424
} PHP_JOAAT_CTX;
2525

2626
PHP_HASH_API void PHP_JOAATInit(PHP_JOAAT_CTX *context);
27-
PHP_HASH_API void PHP_JOAATUpdate(PHP_JOAAT_CTX *context, const unsigned char *input, unsigned int inputLen);
27+
PHP_HASH_API void PHP_JOAATUpdate(PHP_JOAAT_CTX *context, const unsigned char *input, size_t inputLen);
2828
PHP_HASH_API void PHP_JOAATFinal(unsigned char digest[16], PHP_JOAAT_CTX * context);
2929

3030
static uint32_t joaat_buf(void *buf, size_t len, uint32_t hval);

ext/hash/php_hash_md.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ typedef struct {
6565

6666
PHP_HASH_API void make_digest(char *md5str, unsigned char *digest);
6767
PHP_HASH_API void PHP_MD5Init(PHP_MD5_CTX *);
68-
PHP_HASH_API void PHP_MD5Update(PHP_MD5_CTX *, const unsigned char *, unsigned int);
68+
PHP_HASH_API void PHP_MD5Update(PHP_MD5_CTX *, const unsigned char *, size_t);
6969
PHP_HASH_API void PHP_MD5Final(unsigned char[16], PHP_MD5_CTX *);
7070

7171
PHP_NAMED_FUNCTION(php_if_md5);
@@ -80,7 +80,7 @@ typedef struct {
8080
} PHP_MD4_CTX;
8181

8282
PHP_HASH_API void PHP_MD4Init(PHP_MD4_CTX *);
83-
PHP_HASH_API void PHP_MD4Update(PHP_MD4_CTX *context, const unsigned char *, unsigned int);
83+
PHP_HASH_API void PHP_MD4Update(PHP_MD4_CTX *context, const unsigned char *, size_t);
8484
PHP_HASH_API void PHP_MD4Final(unsigned char[16], PHP_MD4_CTX *);
8585

8686
/* MD2 context */
@@ -92,7 +92,7 @@ typedef struct {
9292
} PHP_MD2_CTX;
9393

9494
PHP_HASH_API void PHP_MD2Init(PHP_MD2_CTX *context);
95-
PHP_HASH_API void PHP_MD2Update(PHP_MD2_CTX *context, const unsigned char *, unsigned int);
95+
PHP_HASH_API void PHP_MD2Update(PHP_MD2_CTX *context, const unsigned char *, size_t);
9696
PHP_HASH_API void PHP_MD2Final(unsigned char[16], PHP_MD2_CTX *);
9797

9898
#endif

ext/hash/php_hash_ripemd.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,19 @@ typedef struct {
4646
} PHP_RIPEMD320_CTX;
4747

4848
PHP_HASH_API void PHP_RIPEMD128Init(PHP_RIPEMD128_CTX *);
49-
PHP_HASH_API void PHP_RIPEMD128Update(PHP_RIPEMD128_CTX *, const unsigned char *, unsigned int);
49+
PHP_HASH_API void PHP_RIPEMD128Update(PHP_RIPEMD128_CTX *, const unsigned char *, size_t);
5050
PHP_HASH_API void PHP_RIPEMD128Final(unsigned char[16], PHP_RIPEMD128_CTX *);
5151

5252
PHP_HASH_API void PHP_RIPEMD160Init(PHP_RIPEMD160_CTX *);
53-
PHP_HASH_API void PHP_RIPEMD160Update(PHP_RIPEMD160_CTX *, const unsigned char *, unsigned int);
53+
PHP_HASH_API void PHP_RIPEMD160Update(PHP_RIPEMD160_CTX *, const unsigned char *, size_t);
5454
PHP_HASH_API void PHP_RIPEMD160Final(unsigned char[20], PHP_RIPEMD160_CTX *);
5555

5656
PHP_HASH_API void PHP_RIPEMD256Init(PHP_RIPEMD256_CTX *);
57-
PHP_HASH_API void PHP_RIPEMD256Update(PHP_RIPEMD256_CTX *, const unsigned char *, unsigned int);
57+
PHP_HASH_API void PHP_RIPEMD256Update(PHP_RIPEMD256_CTX *, const unsigned char *, size_t);
5858
PHP_HASH_API void PHP_RIPEMD256Final(unsigned char[32], PHP_RIPEMD256_CTX *);
5959

6060
PHP_HASH_API void PHP_RIPEMD320Init(PHP_RIPEMD320_CTX *);
61-
PHP_HASH_API void PHP_RIPEMD320Update(PHP_RIPEMD320_CTX *, const unsigned char *, unsigned int);
61+
PHP_HASH_API void PHP_RIPEMD320Update(PHP_RIPEMD320_CTX *, const unsigned char *, size_t);
6262
PHP_HASH_API void PHP_RIPEMD320Final(unsigned char[40], PHP_RIPEMD320_CTX *);
6363

6464
#endif /* PHP_HASH_RIPEMD_H */

ext/hash/php_hash_sha.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ typedef struct {
4040
} PHP_SHA1_CTX;
4141

4242
PHP_HASH_API void PHP_SHA1Init(PHP_SHA1_CTX *);
43-
PHP_HASH_API void PHP_SHA1Update(PHP_SHA1_CTX *, const unsigned char *, unsigned int);
43+
PHP_HASH_API void PHP_SHA1Update(PHP_SHA1_CTX *, const unsigned char *, size_t);
4444
PHP_HASH_API void PHP_SHA1Final(unsigned char[20], PHP_SHA1_CTX *);
4545

4646
PHP_FUNCTION(sha1);
@@ -56,7 +56,7 @@ typedef struct {
5656
} PHP_SHA224_CTX;
5757

5858
PHP_HASH_API void PHP_SHA224Init(PHP_SHA224_CTX *);
59-
PHP_HASH_API void PHP_SHA224Update(PHP_SHA224_CTX *, const unsigned char *, unsigned int);
59+
PHP_HASH_API void PHP_SHA224Update(PHP_SHA224_CTX *, const unsigned char *, size_t);
6060
PHP_HASH_API void PHP_SHA224Final(unsigned char[28], PHP_SHA224_CTX *);
6161

6262
/* SHA256 context. */
@@ -67,7 +67,7 @@ typedef struct {
6767
} PHP_SHA256_CTX;
6868

6969
PHP_HASH_API void PHP_SHA256Init(PHP_SHA256_CTX *);
70-
PHP_HASH_API void PHP_SHA256Update(PHP_SHA256_CTX *, const unsigned char *, unsigned int);
70+
PHP_HASH_API void PHP_SHA256Update(PHP_SHA256_CTX *, const unsigned char *, size_t);
7171
PHP_HASH_API void PHP_SHA256Final(unsigned char[32], PHP_SHA256_CTX *);
7272

7373
/* SHA384 context */
@@ -78,7 +78,7 @@ typedef struct {
7878
} PHP_SHA384_CTX;
7979

8080
PHP_HASH_API void PHP_SHA384Init(PHP_SHA384_CTX *);
81-
PHP_HASH_API void PHP_SHA384Update(PHP_SHA384_CTX *, const unsigned char *, unsigned int);
81+
PHP_HASH_API void PHP_SHA384Update(PHP_SHA384_CTX *, const unsigned char *, size_t);
8282
PHP_HASH_API void PHP_SHA384Final(unsigned char[48], PHP_SHA384_CTX *);
8383

8484
/* SHA512 context */
@@ -89,7 +89,7 @@ typedef struct {
8989
} PHP_SHA512_CTX;
9090

9191
PHP_HASH_API void PHP_SHA512Init(PHP_SHA512_CTX *);
92-
PHP_HASH_API void PHP_SHA512Update(PHP_SHA512_CTX *, const unsigned char *, unsigned int);
92+
PHP_HASH_API void PHP_SHA512Update(PHP_SHA512_CTX *, const unsigned char *, size_t);
9393
PHP_HASH_API void PHP_SHA512Final(unsigned char[64], PHP_SHA512_CTX *);
9494

9595
PHP_HASH_API void PHP_SHA512_256Init(PHP_SHA512_CTX *);

0 commit comments

Comments
 (0)