lemire / streamvbyte

Fast integer compression in C using the StreamVByte codec
Apache License 2.0
376 stars 37 forks source link

Const uint32_t pointer #24

Closed elshize closed 6 years ago

elshize commented 6 years ago

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.

lemire commented 6 years ago

Fixed as per https://github.com/lemire/streamvbyte/commit/4aa9c3ba83916a2335ac03787d86d4b3592c9226