Cleared "signed/unsigned mismatch" warning under GCC 5.1. The pointer math meant we got a ptrdiff_t back from the expression. Its not clear if we should throw, so an assert was added
parent
81af925716
commit
ed0300b143
|
|
@ -8,6 +8,7 @@
|
||||||
#include "pch.h"
|
#include "pch.h"
|
||||||
#include "zdeflate.h"
|
#include "zdeflate.h"
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
#include <cstddef> // ptrdiff_t
|
||||||
|
|
||||||
#if _MSC_VER >= 1600
|
#if _MSC_VER >= 1600
|
||||||
// for make_unchecked_array_iterator
|
// for make_unchecked_array_iterator
|
||||||
|
|
@ -406,7 +407,12 @@ unsigned int Deflator::LongestMatch(unsigned int &bestMatch) const
|
||||||
{
|
{
|
||||||
bestLength = len;
|
bestLength = len;
|
||||||
bestMatch = current;
|
bestMatch = current;
|
||||||
if (len == (scanEnd - scan))
|
|
||||||
|
// TODO: should we throw here?
|
||||||
|
const ptrdiff_t diff = scanEnd - scan;
|
||||||
|
assert(diff >= 0);
|
||||||
|
|
||||||
|
if (len == static_cast<unsigned int>(diff))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue