Update to 7-Zip Version 21.02

This commit is contained in:
Tino Reichardt
2021-05-13 16:39:14 +02:00
parent 3724ecfedc
commit 48fa49f76c
620 changed files with 35032 additions and 10925 deletions

View File

@@ -2,7 +2,7 @@
#include "StdAfx.h"
#include <stdio.h>
// #include <stdio.h>
#include "../../../../C/CpuArch.h"
@@ -71,7 +71,7 @@ static const char * const kHelpString =
" -so : write data to stdout\n";
static const char * const kCantAllocate = "Can not allocate memory";
static const char * const kCantAllocate = "Cannot allocate memory";
static const char * const kReadError = "Read error";
static const char * const kWriteError = "Write error";
@@ -99,24 +99,32 @@ enum Enum
};
}
#define SWFRM_3(t, mu, mi) t, mu, mi, NULL
#define SWFRM_1(t) SWFRM_3(t, false, 0)
#define SWFRM_SIMPLE SWFRM_1(NSwitchType::kSimple)
#define SWFRM_STRING SWFRM_1(NSwitchType::kString)
#define SWFRM_STRING_SINGL(mi) SWFRM_3(NSwitchType::kString, false, mi)
static const CSwitchForm kSwitchForms[] =
{
{ "?", NSwitchType::kSimple, false },
{ "H", NSwitchType::kSimple, false },
{ "MM", NSwitchType::kString, false, 1 },
{ "X", NSwitchType::kString, false, 1 },
{ "A", NSwitchType::kString, false, 1 },
{ "D", NSwitchType::kString, false, 1 },
{ "FB", NSwitchType::kString, false, 1 },
{ "MC", NSwitchType::kString, false, 1 },
{ "LC", NSwitchType::kString, false, 1 },
{ "LP", NSwitchType::kString, false, 1 },
{ "PB", NSwitchType::kString, false, 1 },
{ "MF", NSwitchType::kString, false, 1 },
{ "MT", NSwitchType::kString, false, 0 },
{ "EOS", NSwitchType::kSimple, false },
{ "SI", NSwitchType::kSimple, false },
{ "SO", NSwitchType::kSimple, false },
{ "?", SWFRM_SIMPLE },
{ "H", SWFRM_SIMPLE },
{ "MM", SWFRM_STRING_SINGL(1) },
{ "X", SWFRM_STRING_SINGL(1) },
{ "A", SWFRM_STRING_SINGL(1) },
{ "D", SWFRM_STRING_SINGL(1) },
{ "FB", SWFRM_STRING_SINGL(1) },
{ "MC", SWFRM_STRING_SINGL(1) },
{ "LC", SWFRM_STRING_SINGL(1) },
{ "LP", SWFRM_STRING_SINGL(1) },
{ "PB", SWFRM_STRING_SINGL(1) },
{ "MF", SWFRM_STRING_SINGL(1) },
{ "MT", SWFRM_STRING },
{ "EOS", SWFRM_SIMPLE },
{ "SI", SWFRM_SIMPLE },
{ "SO", SWFRM_SIMPLE },
{ "F86", NSwitchType::kChar, false, 0, "+" }
};
@@ -264,6 +272,7 @@ STDMETHODIMP CProgressPrint::SetRatioInfo(const UInt64 *inSize, const UInt64 *ou
}
MY_ATTR_NORETURN
static void IncorrectCommand()
{
throw "Incorrect command";
@@ -314,7 +323,9 @@ static int Error_HRESULT(const char *s, HRESULT res)
return 1;
}
#if defined(_UNICODE) && !defined(_WIN64) && !defined(UNDER_CE)
#define NT_CHECK_FAIL_ACTION PrintError("Unsupported Windows version"); return 1;
#endif
static void AddProp(CObjectVector<CProperty> &props2, const char *name, const wchar_t *val)
{
@@ -474,7 +485,7 @@ static int main2(int numArgs, const char *args[])
inStream = inStreamSpec;
if (!inStreamSpec->Open(us2fs(inputName)))
{
PrintError2("can not open input file", inputName);
PrintError2("Cannot open input file", inputName);
return 1;
}
}
@@ -494,7 +505,7 @@ static int main2(int numArgs, const char *args[])
outStream = outStreamSpec;
if (!outStreamSpec->Create(us2fs(outputName), true))
{
PrintError2("can not open output file", outputName);
PrintError2("Cannot open output file", outputName);
return 1;
}
}
@@ -505,7 +516,7 @@ static int main2(int numArgs, const char *args[])
if (inStreamSpec)
{
if (!inStreamSpec->File.GetLength(fileSize))
throw "Can not get file length";
throw "Cannot get file length";
fileSizeDefined = true;
if (!stdOutMode)
Print_Size("Input size: ", fileSize);
@@ -532,7 +543,7 @@ static int main2(int numArgs, const char *args[])
You can use xz format instead, if you want to use filters */
if (parser[NKey::kEOS].ThereIs || stdInMode)
throw "Can not use stdin in this mode";
throw "Cannot use stdin in this mode";
size_t inSize = (size_t)fileSize;
@@ -549,7 +560,7 @@ static int main2(int numArgs, const char *args[])
}
if (ReadStream_FAIL(inStream, inBuffer, inSize) != S_OK)
throw "Can not read";
throw "Cannot read";
Byte *outBuffer = NULL;
size_t outSize;