lemire / streamvbyte

Fast integer compression in C using the StreamVByte codec

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Const uint32_t pointer

elshize opened this issue · comments

Hi,

I believe you could (and should) make the input pointer const. As far as I can tell, only two signatures must be changed:

size_t streamvbyte_encode(const uint32_t *in, uint32_t length, uint8_t *out);
size_t streamvbyte_encode_quad(const uint32_t *in, uint8_t *outData, uint8_t *outKey);

instead of

size_t streamvbyte_encode(uint32_t *in, uint32_t length, uint8_t *out);
size_t streamvbyte_encode_quad(uint32_t *in, uint8_t *outData, uint8_t *outKey);

I found myself in the need of casting away the const because of this.

Fixed as per 4aa9c3b