Fix function definition and declaration mismatch
PATCH 1/1 Fix function definition and declaration mismatch
From: Udit kumar agarwal <[email protected]>
during the declaration of, let's say XXH32_init parameter type is 'unsigned int' while during the definition it is 'uint32_t'. Now, on most desktop os, they are are usually same, however on some embedded platforms, for example RTEMS which uses newlib as it's standard c library, they both are different.
--- crc/xxhash.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
crc/xxhash.h +4 -4
@@ -107,9 +107,9 @@ XXH32() :// Advanced Hash Functions //**************************** -void *XXH32_init (unsigned int seed); +void *XXH32_init (uint32_t seed);XXH_errorcode XXH32_update (void * state,const void * input,int len); -unsigned int XXH32_digest (void * state); +uint32_t XXH32_digest (void * state);/* These functions calculate the xxhash of an input provided in several small packets,
@@ -135,7 +135,7 @@ Memory will be freed by XXH32_digest().int XXH32_sizeofState (void ); -XXH_errorcode XXH32_resetState (void * state,unsigned int seed); +XXH_errorcode XXH32_resetState (void * state,uint32_t seed);#define XXH32_SIZEOFSTATE 48typedef struct {long long ll[(XXH32_SIZEOFSTATE +(sizeof (long long )-1 ))/sizeof (long long )]; }XXH32_stateSpace_t ;
@@ -151,7 +151,7 @@ use the structure XXH32_stateSpace_t, which will ensure that memory space is lar*/ -unsigned int XXH32_intermediateDigest (void * state); +uint32_t XXH32_intermediateDigest (void * state);/* This function does the same as XXH32_digest(), generating a 32-bit hash, but preserve memory context.
Signature · 1 line
1.9.1
Hi,
Just a ping ;) Does this patch sounds reasonable?
Quoted 52 lines · On Wed, Aug 1, 2018 at 12:04 PM, <[email protected]> wrote:
From: Udit kumar agarwal <[email protected]>
during the declaration of, let's say
XXH32_initparameter type is 'unsigned int' while during the definition it is 'uint32_t'. Now, on most desktop os, they are are usually same, however on some embedded platforms, for example RTEMS which uses newlib as it's standard c library, they both are different.--- crc/xxhash.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)crc/xxhash.h +2
-2@@ -107,9 +107,9 @@ XXH32() :// Advanced Hash Functions //**************************** -void *XXH32_init (unsigned int seed); +void *XXH32_init (uint32_t seed);XXH_errorcode XXH32_update (void * state,const void * input,int len); -unsigned int XXH32_digest (void * state); +uint32_t XXH32_digest (void * state);/* These functions calculate the xxhash of an input provided in several small packets,
crc/xxhash.h +1
-1@@ -135,7 +135,7 @@ Memory will be freed by XXH32_digest().int XXH32_sizeofState (void ); -XXH_errorcode XXH32_resetState (void * state,unsigned int seed); +XXH_errorcode XXH32_resetState (void * state,uint32_t seed);#define XXH32_SIZEOFSTATE 48 typedef struct { long long ll[(XXH32_SIZEOFSTATE+(sizeof(longlong)-1))/sizeof(long long)]; }
XXH32_stateSpace_t;crc/xxhash.h +0
-0@@ -151,7 +151,7 @@ use the structure XXH32_stateSpace_t, which willensure that memory space is lar
*/crc/xxhash.h +1
-2-unsigned int XXH32_intermediateDigest (void * state); +uint32_t XXH32_intermediateDigest (void * state);/* This function does the same as XXH32_digest(), generating a 32-bit hash, but preserve memory context. -- 1.9.1
Signature · 3 lines
Regards, Udit kumar agarwal http://uditagarwal.in/
Quoted 2 lines · Udit agarwal
Hi,
Just a ping ;) Does this patch sounds reasonable?
Yep totally reasonable, had some vacation which is why it took a little longer. Applied.
Signature · 1 line
Jens Axboe