emile+ tgv saver - stop using deprecated lz4 functions to remove warnings

This commit is contained in:
Carsten Haitzler 2019-01-15 12:33:05 +00:00
parent ae6a26b8ed
commit 3511b96448
2 changed files with 13 additions and 9 deletions

View File

@ -52,9 +52,9 @@ emile_compress(const Eina_Binbuf *data,
switch (t)
{
case EMILE_LZ4:
length = LZ4_compress((const char *)eina_binbuf_string_get(data),
compact,
eina_binbuf_length_get(data));
length = LZ4_compress_default
((const char *)eina_binbuf_string_get(data), compact,
eina_binbuf_length_get(data), length);
/* It is going to be smaller and should never fail, if it does you are in deep poo. */
temp = realloc(compact, length);
if (temp) compact = temp;
@ -64,9 +64,9 @@ emile_compress(const Eina_Binbuf *data,
break;
case EMILE_LZ4HC:
length = LZ4_compressHC((const char *)eina_binbuf_string_get(data),
compact,
eina_binbuf_length_get(data));
length = LZ4_compress_HC
((const char *)eina_binbuf_string_get(data), compact,
eina_binbuf_length_get(data), length, 16);
temp = realloc(compact, length);
if (temp) compact = temp;

View File

@ -125,7 +125,8 @@ _save_direct_tgv(RGBA_Image *im, const char *file, int compress)
buffer_size = LZ4_compressBound(etc_data_size);
buffer = malloc(buffer_size);
if (!buffer) goto on_error;
data_size = LZ4_compressHC((char *) data, (char *) buffer, etc_data_size);
data_size = LZ4_compress_HC
((char *)data, (char *)buffer, etc_data_size, buffer_size, 16);
}
else
{
@ -486,8 +487,11 @@ evas_image_save_file_tgv(RGBA_Image *im,
if (compress)
{
wlen = LZ4_compressHC((char *) buffer, (char *) comp,
block_count * etc_block_size);
wlen = LZ4_compress_HC
((char *)buffer, (char *)comp,
block_count * etc_block_size,
LZ4_compressBound(block_count * etc_block_size),
16);
}
else
{