Skip to content

Commit

Permalink
explicit casts
Browse files Browse the repository at this point in the history
  • Loading branch information
lemire committed Jan 22, 2025
1 parent e75ad54 commit 78a7fe7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/xorfilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -1374,7 +1374,7 @@ static inline bool xor8_deserialize(xor8_t * filter, const char *buffer) {
static inline size_t xor ## xbits ## _pack_bytes(const xor ## xbits ## _t *filter) \
{ \
size_t sz = 0; \
size_t capacity = 3 * filter->blockLength; \
size_t capacity = (size_t)(3 * filter->blockLength); \
sz += sizeof filter->seed; \
sz += sizeof filter->blockLength; \
sz += XOR_bitf_sz(capacity); \
Expand All @@ -1391,7 +1391,7 @@ static inline size_t xor ## xbits ## _pack_bytes(const xor ## xbits ## _t *filte
static inline size_t xor ## xbits ## _pack(const xor ## xbits ## _t *filter, char *buffer, size_t space) { \
uint8_t *s = (uint8_t *)(void *)buffer; \
uint8_t *buf = s, *e = buf + space; \
size_t capacity = 3 * filter->blockLength; \
size_t capacity = (size_t)(3 * filter->blockLength); \
\
XOR_ser(buf, e, filter->seed); \
XOR_ser(buf, e, filter->blockLength); \
Expand Down Expand Up @@ -1420,7 +1420,7 @@ static inline bool xor ## xbits ## _unpack(xor ## xbits ## _t *filter, const cha
memset(filter, 0, sizeof *filter); \
XOR_deser(filter->seed, buf, e); \
XOR_deser(filter->blockLength, buf, e); \
size_t capacity = 3 * filter->blockLength; \
size_t capacity = (size_t)(3 * filter->blockLength); \
filter->fingerprints = (uint ## xbits ## _t *)calloc(capacity, sizeof filter->fingerprints[0]); \
if (filter->fingerprints == NULL) \
return (false); \
Expand Down

0 comments on commit 78a7fe7

Please sign in to comment.