summaryrefslogtreecommitdiff
path: root/crc
diff options
context:
space:
mode:
authorCastor Fu <castor@alumni.caltech.edu>2014-03-20 10:59:29 -0700
committerJens Axboe <axboe@fb.com>2014-03-21 09:28:08 -0600
commit190b8f0c9c1c1a99ed26fd953f7af9023f9533ee (patch)
tree43010145f9df4e32b1b4dd3567c35d77c2c30991 /crc
parent1417daeb92c44632f2e1e376d736a0f198d7af8d (diff)
Pass -Wstrict-prototypes -Wold-style-definition, whitespace
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'crc')
-rw-r--r--crc/xxhash.c14
-rw-r--r--crc/xxhash.h2
2 files changed, 8 insertions, 8 deletions
diff --git a/crc/xxhash.c b/crc/xxhash.c
index 5190330..db7890b 100644
--- a/crc/xxhash.c
+++ b/crc/xxhash.c
@@ -149,11 +149,11 @@ typedef enum { XXH_bigEndian=0, XXH_littleEndian=1 } XXH_endianess;
typedef enum { XXH_aligned, XXH_unaligned } XXH_alignment;
uint32_t XXH_readLE32_align(const uint32_t* ptr, XXH_endianess endian, XXH_alignment align)
-{
+{
if (align==XXH_unaligned)
- return endian==XXH_littleEndian ? A32(ptr) : XXH_swap32(A32(ptr));
+ return endian==XXH_littleEndian ? A32(ptr) : XXH_swap32(A32(ptr));
else
- return endian==XXH_littleEndian ? *ptr : XXH_swap32(*ptr);
+ return endian==XXH_littleEndian ? *ptr : XXH_swap32(*ptr);
}
uint32_t XXH_readLE32(const uint32_t* ptr, XXH_endianess endian) { return XXH_readLE32_align(ptr, endian, XXH_unaligned); }
@@ -253,15 +253,15 @@ uint32_t XXH32(const void* input, int len, uint32_t seed)
// Advanced Hash Functions
//****************************
-int XXH32_sizeofState()
+int XXH32_sizeofState(void)
{
XXH_STATIC_ASSERT(XXH32_SIZEOFSTATE >= sizeof(struct XXH_state32_t)); // A compilation error here means XXH32_SIZEOFSTATE is not large enough
- return sizeof(struct XXH_state32_t);
+ return sizeof(struct XXH_state32_t);
}
XXH_errorcode XXH32_resetState(void* state_in, uint32_t seed)
-{
+{
struct XXH_state32_t * state = (struct XXH_state32_t *) state_in;
state->seed = seed;
state->v1 = seed + PRIME32_1 + PRIME32_2;
@@ -307,7 +307,7 @@ XXH_errorcode XXH32_update_endian (void* state_in, const void* input, int len, X
{
const uint32_t* p32 = (const uint32_t*)state->memory;
state->v1 += XXH_readLE32(p32, endian) * PRIME32_2; state->v1 = XXH_rotl32(state->v1, 13); state->v1 *= PRIME32_1; p32++;
- state->v2 += XXH_readLE32(p32, endian) * PRIME32_2; state->v2 = XXH_rotl32(state->v2, 13); state->v2 *= PRIME32_1; p32++;
+ state->v2 += XXH_readLE32(p32, endian) * PRIME32_2; state->v2 = XXH_rotl32(state->v2, 13); state->v2 *= PRIME32_1; p32++;
state->v3 += XXH_readLE32(p32, endian) * PRIME32_2; state->v3 = XXH_rotl32(state->v3, 13); state->v3 *= PRIME32_1; p32++;
state->v4 += XXH_readLE32(p32, endian) * PRIME32_2; state->v4 = XXH_rotl32(state->v4, 13); state->v4 *= PRIME32_1; p32++;
}
diff --git a/crc/xxhash.h b/crc/xxhash.h
index bcd060e..e80a91d 100644
--- a/crc/xxhash.h
+++ b/crc/xxhash.h
@@ -134,7 +134,7 @@ Memory will be freed by XXH32_digest().
*/
-int XXH32_sizeofState();
+int XXH32_sizeofState(void);
XXH_errorcode XXH32_resetState(void* state, unsigned int seed);
#define XXH32_SIZEOFSTATE 48