From 10fb81e895980ab1a17a164a65260818e6e76622 Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Tue, 15 Jan 2019 12:33:05 +0000 Subject: [PATCH] emile+ tgv saver - stop using deprecated lz4 functions to remove warnings --- src/lib/emile/emile_compress.c | 12 ++++++------ src/modules/evas/image_savers/tgv/evas_image_save_tgv.c | 10 +++++++--- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/src/lib/emile/emile_compress.c b/src/lib/emile/emile_compress.c index 0d2e605..e744d3f 100644 --- a/src/lib/emile/emile_compress.c +++ b/src/lib/emile/emile_compress.c @@ -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; diff --git a/src/modules/evas/image_savers/tgv/evas_image_save_tgv.c b/src/modules/evas/image_savers/tgv/evas_image_save_tgv.c index aa0a82b..9fee4de 100644 --- a/src/modules/evas/image_savers/tgv/evas_image_save_tgv.c +++ b/src/modules/evas/image_savers/tgv/evas_image_save_tgv.c @@ -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 { -- 2.7.4