8000 Don't compare a signed value with an unsigned one · coderforlife/ms-compress@8e45dbf · GitHub
[go: up one dir, main page]

Skip to content

Commit 8e45dbf

Browse files
committed
Don't compare a signed value with an unsigned one
This triggers a warning on MSVC (C4018) at level 3, as well as GCC with -Wsign-compare (enabled with -Wextra).
1 parent 4e263b5 commit 8e45dbf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/xpress_huff_compress.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ static size_t xh_compress_lz77(const_bytes in, int32_t /* * */ in_len, const_byt
9090
if (rem >= 3 && (len = d->Find(in, &off)) >= 3)
9191
{
9292
// TODO: allow len > rem (chunk-spanning matches)
93-
if (len > rem) { len = rem; }
93+
if (len > (uint32_t)rem) { len = rem; }
9494
in += len; rem -= len;
9595

9696
//d->Add(in + 1, len - 1);

0 commit comments

Comments
 (0)
0