From 11052f56f3a7a5e92868a8f1b48c5c4d2a45bd3a Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Wed, 9 Mar 2011 13:25:33 +1100 Subject: [PATCH] Ignore the lzo_1 return value entirely. --- stream.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stream.c b/stream.c index 14397af..9967635 100644 --- a/stream.c +++ b/stream.c @@ -402,7 +402,6 @@ static int lzo_compress_buf(rzip_control *control, struct compress_thread *cthre { lzo_uint in_len = cthread->s_len; lzo_uint dlen = in_len + in_len / 16 + 64 + 3; - lzo_int return_var; /* lzo1x_1_compress does not return anything but LZO_OK */ lzo_bytep wrkmem; uchar *c_buf; int ret = -1; @@ -419,7 +418,9 @@ static int lzo_compress_buf(rzip_control *control, struct compress_thread *cthre goto out_free; } - return_var = lzo1x_1_compress(cthread->s_buf, in_len, c_buf, &dlen, wrkmem); + /* lzo1x_1_compress does not return anything but LZO_OK so we ignore + * the return value */ + lzo1x_1_compress(cthread->s_buf, in_len, c_buf, &dlen, wrkmem); ret = 0; if (dlen >= in_len){ @@ -1397,7 +1398,6 @@ static int lzo_compresses(rzip_control *control, uchar *s_buf, i64 s_len) lzo_bytep wrkmem = NULL; lzo_uint in_len, test_len = s_len, save_len = s_len; lzo_uint dlen; - lzo_int return_var; /* lzo1x_1_compress does not return anything but LZO_OK */ uchar *c_buf = NULL, *test_buf = s_buf; /* set minimum buffer test size based on the length of the test stream */ unsigned long buftest_size = (test_len > 5 * STREAM_BUFSIZE ? STREAM_BUFSIZE : STREAM_BUFSIZE / 4096); @@ -1422,7 +1422,7 @@ static int lzo_compresses(rzip_control *control, uchar *s_buf, i64 s_len) compressible is found, jump out as a success */ while (test_len > 0) { workcounter++; - return_var = lzo1x_1_compress(test_buf, in_len, (uchar *)c_buf, &dlen, wrkmem); + lzo1x_1_compress(test_buf, in_len, (uchar *)c_buf, &dlen, wrkmem); if (dlen < best_dlen) best_dlen = dlen; /* save best value */