I'm currently studying programmation and I'm trying to add This library to ZopfliPNG. I would like to use it instead of Zopfli. I tried to change to this but it's not working :
unsigned CustomPNGDeflate(unsigned char** out, size_t* outsize, const unsigned char* in, size_t insize, const LodePNGCompressSettings* settings) { int compression_level = 12; struct libdeflate_compressor* compressor; compressor = libdeflate_alloc_compressor(compression_level); libdeflate_deflate_compress(compressor, in, insize, out, outsize); libdeflate_free_compressor(compressor); return 0; }
During compilation, I have this :
error: invalid conversion from 'size_t* {aka unsigned int*}' to 'size_t {aka unsigned int}' [-fpermissive] libdeflate_deflate_compress(compressor, in, insize, out, outsize); libdeflate.h:65:1: note: initializing argument 5 of 'size_t libdeflate_deflate_compress(libdeflate_compressor*, const void*, size_t, void*, size_t)' libdeflate_deflate_compress(struct libdeflate_compressor *compressor, make: *** [bin] Error 1
Maybe I'm not doing the right stuff here. Any help will be appreciated !
outsize
is asize_t *
butlibdeflate_deflate_compress
is expecting asize_t
.