summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2017-03-18 00:42:47 (GMT)
committerYann Collet <cyan@fb.com>2017-03-18 00:42:47 (GMT)
commit8bd32a17b112dd46f61d835e4368ff1bc4464048 (patch)
treedce50ecaa5cde0a0c95af998e2a6af099c02315d /lib
parent118b47f3d1c7bc8898811d47a127b6af9743e2b5 (diff)
downloadlz4-8bd32a17b112dd46f61d835e4368ff1bc4464048.zip
lz4-8bd32a17b112dd46f61d835e4368ff1bc4464048.tar.gz
lz4-8bd32a17b112dd46f61d835e4368ff1bc4464048.tar.bz2
made SET_PRICE macro more usable
previous version would use argument to also change target member. Now, only values are transferred
Diffstat (limited to 'lib')
-rw-r--r--lib/lz4opt.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/lz4opt.h b/lib/lz4opt.h
index b74c946..f12468a 100644
--- a/lib/lz4opt.h
+++ b/lib/lz4opt.h
@@ -190,13 +190,13 @@ FORCE_INLINE int LZ4HC_BinTree_GetAllMatches (
}
-#define SET_PRICE(pos, mlen, offset, ll, price) \
+#define SET_PRICE(pos, ml, offset, ll, cost) \
{ \
while (last_pos < pos) { opt[last_pos+1].price = 1<<30; last_pos++; } \
- opt[pos].mlen = (int)mlen; \
+ opt[pos].mlen = (int)ml; \
opt[pos].off = (int)offset; \
opt[pos].litlen = (int)ll; \
- opt[pos].price = (int)price; \
+ opt[pos].price = (int)cost; \
}
@@ -211,7 +211,7 @@ static int LZ4HC_compress_optimal (
const int fullUpdate
)
{
- LZ4HC_optimal_t opt[LZ4_OPT_NUM + 1];
+ LZ4HC_optimal_t opt[LZ4_OPT_NUM + 1]; /* this uses a bit too much stack memory to my taste ... */
LZ4HC_match_t matches[LZ4_OPT_NUM + 1];
const BYTE *inr = NULL;
size_t res, cur, cur2;