Skip to content

Commit e0e3d98

Browse files
committed
hash: Fix -Warray-parameter= warnings
Signed-off-by: Anatol Belski <[email protected]>
1 parent 2c4346f commit e0e3d98

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

ext/hash/murmur/PMurHash128.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ do {\
170170
} while(0)
171171

172172
/* Finalize a hash. To match the original Murmur3_128x86 the total_length must be provided */
173-
void PMurHash128x86_Result(const uint32_t *ph, const uint32_t *pcarry, uint32_t total_length, uint32_t *out)
173+
void PMurHash128x86_Result(const uint32_t ph[4], const uint32_t pcarry[4], uint32_t total_length, uint32_t out[4])
174174
{
175175
uint32_t h1 = ph[0];
176176
uint32_t h2 = ph[1];
@@ -240,7 +240,7 @@ void PMurHash128x86_Result(const uint32_t *ph, const uint32_t *pcarry, uint32_t
240240

241241
/* Main hashing function. Initialise carry[4] to {0,0,0,0} and h[4] to an initial {seed,seed,seed,seed}
242242
* if wanted. Both ph and pcarry are required arguments. */
243-
void PMurHash128x86_Process(uint32_t * const ph, uint32_t * const pcarry, const void * const key, int len)
243+
void PMurHash128x86_Process(uint32_t ph[4], uint32_t pcarry[4], const void * const key, int len)
244244
{
245245
uint32_t h1 = ph[0];
246246
uint32_t h2 = ph[1];
@@ -480,8 +480,8 @@ do {\
480480
} while(0)
481481

482482
/* Finalize a hash. To match the original Murmur3_128x64 the total_length must be provided */
483-
void PMurHash128x64_Result(const uint64_t * const ph, const uint64_t * const pcarry,
484-
const uint32_t total_length, uint64_t * const out)
483+
void PMurHash128x64_Result(const uint64_t ph[2], const uint64_t pcarry[2],
484+
const uint32_t total_length, uint64_t out[2])
485485
{
486486
uint64_t h1 = ph[0];
487487
uint64_t h2 = ph[1];
@@ -523,7 +523,7 @@ void PMurHash128x64_Result(const uint64_t * const ph, const uint64_t * const pca
523523

524524
/* Main hashing function. Initialise carry[2] to {0,0} and h[2] to an initial {seed,seed}
525525
* if wanted. Both ph and pcarry are required arguments. */
526-
void PMurHash128x64_Process(uint64_t * const ph, uint64_t * const pcarry, const void * const key, int len)
526+
void PMurHash128x64_Process(uint64_t ph[2], uint64_t pcarry[2], const void * const key, int len)
527527
{
528528
uint64_t h1 = ph[0];
529529
uint64_t h2 = ph[1];

ext/hash/php_hash_fnv.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ typedef struct {
5555
PHP_HASH_API void PHP_FNV132Init(PHP_FNV132_CTX *context, ZEND_ATTRIBUTE_UNUSED HashTable *args);
5656
PHP_HASH_API void PHP_FNV132Update(PHP_FNV132_CTX *context, const unsigned char *input, size_t inputLen);
5757
PHP_HASH_API void PHP_FNV1a32Update(PHP_FNV132_CTX *context, const unsigned char *input, size_t inputLen);
58-
PHP_HASH_API void PHP_FNV132Final(unsigned char digest[16], PHP_FNV132_CTX * context);
58+
PHP_HASH_API void PHP_FNV132Final(unsigned char digest[4], PHP_FNV132_CTX * context);
5959

6060
PHP_HASH_API void PHP_FNV164Init(PHP_FNV164_CTX *context, ZEND_ATTRIBUTE_UNUSED HashTable *args);
6161
PHP_HASH_API void PHP_FNV164Update(PHP_FNV164_CTX *context, const unsigned char *input, size_t inputLen);
6262
PHP_HASH_API void PHP_FNV1a64Update(PHP_FNV164_CTX *context, const unsigned char *input, size_t inputLen);
63-
PHP_HASH_API void PHP_FNV164Final(unsigned char digest[16], PHP_FNV164_CTX * context);
63+
PHP_HASH_API void PHP_FNV164Final(unsigned char digest[8], PHP_FNV164_CTX * context);
6464

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

ext/hash/php_hash_gost.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ typedef struct {
3131

3232
PHP_HASH_API void PHP_GOSTInit(PHP_GOST_CTX *, ZEND_ATTRIBUTE_UNUSED HashTable *args);
3333
PHP_HASH_API void PHP_GOSTUpdate(PHP_GOST_CTX *, const unsigned char *, size_t);
34-
PHP_HASH_API void PHP_GOSTFinal(unsigned char[64], PHP_GOST_CTX *);
34+
PHP_HASH_API void PHP_GOSTFinal(unsigned char[32], PHP_GOST_CTX *);
3535

3636
#endif

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

2525
PHP_HASH_API void PHP_JOAATInit(PHP_JOAAT_CTX *context, ZEND_ATTRIBUTE_UNUSED HashTable *args);
2626
PHP_HASH_API void PHP_JOAATUpdate(PHP_JOAAT_CTX *context, const unsigned char *input, size_t inputLen);
27-
PHP_HASH_API void PHP_JOAATFinal(unsigned char digest[16], PHP_JOAAT_CTX * context);
27+
PHP_HASH_API void PHP_JOAATFinal(unsigned char digest[4], PHP_JOAAT_CTX * context);
2828

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

0 commit comments

Comments
 (0)