diff options
author | Yann Collet <cyan@fb.com> | 2019-04-12 23:49:01 (GMT) |
---|---|---|
committer | Yann Collet <cyan@fb.com> | 2019-04-12 23:49:01 (GMT) |
commit | f8b760503445610c43cad813fb3eda29bb3fc763 (patch) | |
tree | c75ffb9f4e0bbcbadaf3eb51db02b8a963cfa6c2 /lib/lz4.c | |
parent | 9c49e3ca07673949c58d9cffb23034ad0865fefb (diff) | |
download | lz4-f8b760503445610c43cad813fb3eda29bb3fc763.zip lz4-f8b760503445610c43cad813fb3eda29bb3fc763.tar.gz lz4-f8b760503445610c43cad813fb3eda29bb3fc763.tar.bz2 |
fixed minor Visual warnings
since Visual 2017,
worries about potential overflow, which are actually impossible.
Replaced (c * a) by (c ? a : 0).
Will likely replaced a * by a cmov.
Probably harmless for performance.
Diffstat (limited to 'lib/lz4.c')
-rw-r--r-- | lib/lz4.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -983,7 +983,7 @@ _next_match: assert(dictEnd > match); if (limit > matchlimit) limit = matchlimit; matchCode = LZ4_count(ip+MINMATCH, match+MINMATCH, limit); - ip += MINMATCH + matchCode; + ip += (size_t)matchCode + MINMATCH; if (ip==limit) { unsigned const more = LZ4_count(limit, (const BYTE*)source, matchlimit); matchCode += more; @@ -992,7 +992,7 @@ _next_match: DEBUGLOG(6, " with matchLength=%u starting in extDict", matchCode+MINMATCH); } else { matchCode = LZ4_count(ip+MINMATCH, match+MINMATCH, matchlimit); - ip += MINMATCH + matchCode; + ip += (size_t)matchCode + MINMATCH; DEBUGLOG(6, " with matchLength=%u", matchCode+MINMATCH); } |