diff options
Diffstat (limited to '')
-rw-r--r-- | CPP/7zip/Archive/Wim/WimHandlerOut.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/CPP/7zip/Archive/Wim/WimHandlerOut.cpp b/CPP/7zip/Archive/Wim/WimHandlerOut.cpp index 6b4497f..5e8365a 100644 --- a/CPP/7zip/Archive/Wim/WimHandlerOut.cpp +++ b/CPP/7zip/Archive/Wim/WimHandlerOut.cpp | |||
@@ -32,8 +32,8 @@ static int AddUniqHash(const CStreamInfo *streams, CUIntVector &sorted, const By | |||
32 | unsigned left = 0, right = sorted.Size(); | 32 | unsigned left = 0, right = sorted.Size(); |
33 | while (left != right) | 33 | while (left != right) |
34 | { | 34 | { |
35 | unsigned mid = (left + right) / 2; | 35 | const unsigned mid = (unsigned)(((size_t)left + (size_t)right) / 2); |
36 | unsigned index = sorted[mid]; | 36 | const unsigned index = sorted[mid]; |
37 | const Byte *hash2 = streams[index].Hash; | 37 | const Byte *hash2 = streams[index].Hash; |
38 | 38 | ||
39 | unsigned i; | 39 | unsigned i; |
@@ -124,9 +124,9 @@ static int AddToHardLinkList(const CObjectVector<CMetaItem> &metaItems, unsigned | |||
124 | unsigned left = 0, right = indexes.Size(); | 124 | unsigned left = 0, right = indexes.Size(); |
125 | while (left != right) | 125 | while (left != right) |
126 | { | 126 | { |
127 | unsigned mid = (left + right) / 2; | 127 | const unsigned mid = (unsigned)(((size_t)left + (size_t)right) / 2); |
128 | unsigned index = indexes[mid]; | 128 | const unsigned index = indexes[mid]; |
129 | int comp = Compare_HardLink_MetaItems(mi, metaItems[index]); | 129 | const int comp = Compare_HardLink_MetaItems(mi, metaItems[index]); |
130 | if (comp == 0) | 130 | if (comp == 0) |
131 | return index; | 131 | return index; |
132 | if (comp < 0) | 132 | if (comp < 0) |
@@ -203,8 +203,8 @@ bool CDir::FindDir(const CObjectVector<CMetaItem> &items, const UString &name, u | |||
203 | unsigned left = 0, right = Dirs.Size(); | 203 | unsigned left = 0, right = Dirs.Size(); |
204 | while (left != right) | 204 | while (left != right) |
205 | { | 205 | { |
206 | unsigned mid = (left + right) / 2; | 206 | const unsigned mid = (unsigned)(((size_t)left + (size_t)right) / 2); |
207 | int comp = CompareFileNames(name, items[Dirs[mid].MetaIndex].Name); | 207 | const int comp = CompareFileNames(name, items[Dirs[mid].MetaIndex].Name); |
208 | if (comp == 0) | 208 | if (comp == 0) |
209 | { | 209 | { |
210 | index = mid; | 210 | index = mid; |