Update to 7-Zip Version 22.00

See: https://sourceforge.net/p/sevenzip/discussion/45797/thread/9c2d9061ce/
This commit is contained in:
Tino Reichardt
2022-08-07 09:59:33 +02:00
parent 6a4fe97fc3
commit 57558682a8
211 changed files with 15251 additions and 2482 deletions

View File

@@ -32,8 +32,8 @@ static int AddUniqHash(const CStreamInfo *streams, CUIntVector &sorted, const By
unsigned left = 0, right = sorted.Size();
while (left != right)
{
unsigned mid = (left + right) / 2;
unsigned index = sorted[mid];
const unsigned mid = (unsigned)(((size_t)left + (size_t)right) / 2);
const unsigned index = sorted[mid];
const Byte *hash2 = streams[index].Hash;
unsigned i;
@@ -124,9 +124,9 @@ static int AddToHardLinkList(const CObjectVector<CMetaItem> &metaItems, unsigned
unsigned left = 0, right = indexes.Size();
while (left != right)
{
unsigned mid = (left + right) / 2;
unsigned index = indexes[mid];
int comp = Compare_HardLink_MetaItems(mi, metaItems[index]);
const unsigned mid = (unsigned)(((size_t)left + (size_t)right) / 2);
const unsigned index = indexes[mid];
const int comp = Compare_HardLink_MetaItems(mi, metaItems[index]);
if (comp == 0)
return index;
if (comp < 0)
@@ -203,8 +203,8 @@ bool CDir::FindDir(const CObjectVector<CMetaItem> &items, const UString &name, u
unsigned left = 0, right = Dirs.Size();
while (left != right)
{
unsigned mid = (left + right) / 2;
int comp = CompareFileNames(name, items[Dirs[mid].MetaIndex].Name);
const unsigned mid = (unsigned)(((size_t)left + (size_t)right) / 2);
const int comp = CompareFileNames(name, items[Dirs[mid].MetaIndex].Name);
if (comp == 0)
{
index = mid;