Skip to content

Commit

Permalink
19.00
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor Pavlov authored and kornelski committed Mar 4, 2019
1 parent 5b2a99c commit 4a96064
Show file tree
Hide file tree
Showing 74 changed files with 906 additions and 415 deletions.
6 changes: 3 additions & 3 deletions C/7zArcIn.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* 7zArcIn.c -- 7z Input functions
2018-07-04 : Igor Pavlov : Public domain */
2018-12-31 : Igor Pavlov : Public domain */

#include "Precomp.h"

Expand All @@ -19,7 +19,7 @@
{ MY_ALLOC(Byte, to, size, alloc); memcpy(to, from, size); }

#define MY_ALLOC_ZE_AND_CPY(to, size, from, alloc) \
{ if ((size) == 0) p = NULL; else { MY_ALLOC_AND_CPY(to, size, from, alloc) } }
{ if ((size) == 0) to = NULL; else { MY_ALLOC_AND_CPY(to, size, from, alloc) } }

#define k7zMajorVersion 0

Expand Down Expand Up @@ -666,7 +666,7 @@ static SRes ReadUnpackInfo(CSzAr *p,
MY_ALLOC(size_t, p->FoCodersOffsets, (size_t)numFolders + 1, alloc);
MY_ALLOC(UInt32, p->FoStartPackStreamIndex, (size_t)numFolders + 1, alloc);
MY_ALLOC(UInt32, p->FoToCoderUnpackSizes, (size_t)numFolders + 1, alloc);
MY_ALLOC(Byte, p->FoToMainUnpackSizeIndex, (size_t)numFolders, alloc);
MY_ALLOC_ZE(Byte, p->FoToMainUnpackSizeIndex, (size_t)numFolders, alloc);

startBufPtr = sd.Data;

Expand Down
6 changes: 3 additions & 3 deletions C/7zDec.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* 7zDec.c -- Decoding from 7z folder
2018-07-04 : Igor Pavlov : Public domain */
2019-02-02 : Igor Pavlov : Public domain */

#include "Precomp.h"

Expand Down Expand Up @@ -156,7 +156,7 @@ static SRes SzDecodeLzma(const Byte *props, unsigned propsSize, UInt64 inSize, I
{
SizeT inProcessed = (SizeT)lookahead, dicPos = state.dicPos;
ELzmaStatus status;
res = LzmaDec_DecodeToDic(&state, outSize, inBuf, &inProcessed, LZMA_FINISH_END, &status);
res = LzmaDec_DecodeToDic(&state, outSize, (const Byte *)inBuf, &inProcessed, LZMA_FINISH_END, &status);
lookahead -= inProcessed;
inSize -= inProcessed;
if (res != SZ_OK)
Expand Down Expand Up @@ -218,7 +218,7 @@ static SRes SzDecodeLzma2(const Byte *props, unsigned propsSize, UInt64 inSize,
{
SizeT inProcessed = (SizeT)lookahead, dicPos = state.decoder.dicPos;
ELzmaStatus status;
res = Lzma2Dec_DecodeToDic(&state, outSize, inBuf, &inProcessed, LZMA_FINISH_END, &status);
res = Lzma2Dec_DecodeToDic(&state, outSize, (const Byte *)inBuf, &inProcessed, LZMA_FINISH_END, &status);
lookahead -= inProcessed;
inSize -= inProcessed;
if (res != SZ_OK)
Expand Down
8 changes: 4 additions & 4 deletions C/7zVersion.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#define MY_VER_MAJOR 18
#define MY_VER_MINOR 06
#define MY_VER_MAJOR 19
#define MY_VER_MINOR 00
#define MY_VER_BUILD 0
#define MY_VERSION_NUMBERS "18.06"
#define MY_VERSION_NUMBERS "19.00"
#define MY_VERSION MY_VERSION_NUMBERS

#ifdef MY_CPU_NAME
Expand All @@ -10,7 +10,7 @@
#define MY_VERSION_CPU MY_VERSION
#endif

#define MY_DATE "2018-12-30"
#define MY_DATE "2019-02-21"
#undef MY_COPYRIGHT
#undef MY_VERSION_COPYRIGHT_DATE
#define MY_AUTHOR_NAME "Igor Pavlov"
Expand Down
4 changes: 2 additions & 2 deletions C/Bcj2Enc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Bcj2Enc.c -- BCJ2 Encoder (Converter for x86 code)
2018-07-04 : Igor Pavlov : Public domain */
2019-02-02 : Igor Pavlov : Public domain */

#include "Precomp.h"

Expand Down Expand Up @@ -253,7 +253,7 @@ void Bcj2Enc_Encode(CBcj2Enc *p)
{
const Byte *src = p->src;
const Byte *srcLim = p->srcLim;
unsigned finishMode = p->finishMode;
EBcj2Enc_FinishMode finishMode = p->finishMode;

p->src = p->temp;
p->srcLim = p->temp + p->tempPos;
Expand Down
20 changes: 19 additions & 1 deletion C/CpuArch.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* CpuArch.c -- CPU specific code
2018-07-04: Igor Pavlov : Public domain */
2018-02-18: Igor Pavlov : Public domain */

#include "Precomp.h"

Expand Down Expand Up @@ -197,4 +197,22 @@ BoolInt CPU_Is_Aes_Supported()
return (p.c >> 25) & 1;
}

BoolInt CPU_IsSupported_PageGB()
{
Cx86cpuid cpuid;
if (!x86cpuid_CheckAndRead(&cpuid))
return False;
{
UInt32 d[4] = { 0 };
MyCPUID(0x80000000, &d[0], &d[1], &d[2], &d[3]);
if (d[0] < 0x80000001)
return False;
}
{
UInt32 d[4] = { 0 };
MyCPUID(0x80000001, &d[0], &d[1], &d[2], &d[3]);
return (d[3] >> 26) & 1;
}
}

#endif
3 changes: 2 additions & 1 deletion C/CpuArch.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* CpuArch.h -- CPU specific code
2018-07-04 : Igor Pavlov : Public domain */
2018-02-18 : Igor Pavlov : Public domain */

#ifndef __CPU_ARCH_H
#define __CPU_ARCH_H
Expand Down Expand Up @@ -327,6 +327,7 @@ int x86cpuid_GetFirm(const Cx86cpuid *p);

BoolInt CPU_Is_InOrder();
BoolInt CPU_Is_Aes_Supported();
BoolInt CPU_IsSupported_PageGB();

#endif

Expand Down
25 changes: 23 additions & 2 deletions C/DllSecur.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* DllSecur.c -- DLL loading security
2016-10-04 : Igor Pavlov : Public domain */
2018-02-21 : Igor Pavlov : Public domain */

#include "Precomp.h"

Expand Down Expand Up @@ -28,10 +28,31 @@ static const char * const g_Dlls =
"CRYPTBASE\0"
"OLEACC\0"
"CLBCATQ\0"
"VERSION\0"
;

#endif

void My_SetDefaultDllDirectories()
{
#ifndef UNDER_CE

OSVERSIONINFO vi;
vi.dwOSVersionInfoSize = sizeof(vi);
GetVersionEx(&vi);
if (!GetVersionEx(&vi) || vi.dwMajorVersion != 6 || vi.dwMinorVersion != 0)
{
Func_SetDefaultDllDirectories setDllDirs = (Func_SetDefaultDllDirectories)
GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "SetDefaultDllDirectories");
if (setDllDirs)
if (setDllDirs(MY_LOAD_LIBRARY_SEARCH_SYSTEM32 | MY_LOAD_LIBRARY_SEARCH_USER_DIRS))
return;
}

#endif
}


void LoadSecurityDlls()
{
#ifndef UNDER_CE
Expand Down Expand Up @@ -70,7 +91,7 @@ void LoadSecurityDlls()
for (;;)
{
char c = *dll++;
buf[pos + k] = c;
buf[pos + k] = (Byte)c;
k++;
if (c == 0)
break;
Expand Down
3 changes: 2 additions & 1 deletion C/DllSecur.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* DllSecur.h -- DLL loading for security
2016-06-08 : Igor Pavlov : Public domain */
2018-02-19 : Igor Pavlov : Public domain */

#ifndef __DLL_SECUR_H
#define __DLL_SECUR_H
Expand All @@ -10,6 +10,7 @@ EXTERN_C_BEGIN

#ifdef _WIN32

void My_SetDefaultDllDirectories();
void LoadSecurityDlls();

#endif
Expand Down
18 changes: 9 additions & 9 deletions C/Lzma2Dec.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Lzma2Dec.c -- LZMA2 Decoder
2018-07-04 : Igor Pavlov : Public domain */
2019-02-02 : Igor Pavlov : Public domain */

/* #define SHOW_DEBUG_INFO */

Expand Down Expand Up @@ -314,15 +314,15 @@ ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p,
while (p->state != LZMA2_STATE_ERROR)
{
if (p->state == LZMA2_STATE_FINISHED)
return LZMA_STATUS_FINISHED_WITH_MARK;
return (ELzma2ParseStatus)LZMA_STATUS_FINISHED_WITH_MARK;

if (outSize == 0 && !checkFinishBlock)
return LZMA_STATUS_NOT_FINISHED;
return (ELzma2ParseStatus)LZMA_STATUS_NOT_FINISHED;

if (p->state != LZMA2_STATE_DATA && p->state != LZMA2_STATE_DATA_CONT)
{
if (*srcLen == inSize)
return LZMA_STATUS_NEEDS_MORE_INPUT;
return (ELzma2ParseStatus)LZMA_STATUS_NEEDS_MORE_INPUT;
(*srcLen)++;

p->state = Lzma2Dec_UpdateState(p, *src++);
Expand All @@ -344,7 +344,7 @@ ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p,
// checkFinishBlock is true. So we expect that block must be finished,
// We can return LZMA_STATUS_NOT_SPECIFIED or LZMA_STATUS_NOT_FINISHED here
// break;
return LZMA_STATUS_NOT_FINISHED;
return (ELzma2ParseStatus)LZMA_STATUS_NOT_FINISHED;
}

if (p->state == LZMA2_STATE_DATA)
Expand All @@ -354,15 +354,15 @@ ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p,
}

if (outSize == 0)
return LZMA_STATUS_NOT_FINISHED;
return (ELzma2ParseStatus)LZMA_STATUS_NOT_FINISHED;

{
SizeT inCur = inSize - *srcLen;

if (LZMA2_IS_UNCOMPRESSED_STATE(p))
{
if (inCur == 0)
return LZMA_STATUS_NEEDS_MORE_INPUT;
return (ELzma2ParseStatus)LZMA_STATUS_NEEDS_MORE_INPUT;
if (inCur > p->unpackSize)
inCur = p->unpackSize;
if (inCur > outSize)
Expand All @@ -381,7 +381,7 @@ ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p,
if (inCur == 0)
{
if (p->packSize != 0)
return LZMA_STATUS_NEEDS_MORE_INPUT;
return (ELzma2ParseStatus)LZMA_STATUS_NEEDS_MORE_INPUT;
}
else if (p->state == LZMA2_STATE_DATA)
{
Expand Down Expand Up @@ -418,7 +418,7 @@ ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p,
}

p->state = LZMA2_STATE_ERROR;
return LZMA_STATUS_NOT_SPECIFIED;
return (ELzma2ParseStatus)LZMA_STATUS_NOT_SPECIFIED;
}


Expand Down
4 changes: 2 additions & 2 deletions C/Lzma2DecMt.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* Lzma2DecMt.c -- LZMA2 Decoder Multi-thread
2018-07-04 : Igor Pavlov : Public domain */
2019-02-02 : Igor Pavlov : Public domain */

#include "Precomp.h"

Expand Down Expand Up @@ -265,7 +265,7 @@ static void Lzma2DecMt_MtCallback_Parse(void *obj, unsigned coderIndex, CMtDecCa
t->outPreSize = 0;
// t->blockWasFinished = False;
// t->finishedWithMark = False;
t->parseStatus = LZMA_STATUS_NOT_SPECIFIED;
t->parseStatus = (ELzma2ParseStatus)LZMA_STATUS_NOT_SPECIFIED;
t->state = MTDEC_PARSE_CONTINUE;

t->inCodeSize = 0;
Expand Down
6 changes: 3 additions & 3 deletions C/LzmaEnc.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* LzmaEnc.c -- LZMA Encoder
2018-12-29: Igor Pavlov : Public domain */
2019-01-10: Igor Pavlov : Public domain */

#include "Precomp.h"

Expand Down Expand Up @@ -1497,9 +1497,9 @@ static unsigned GetOptimum(CLzmaEnc *p, UInt32 position)

// here we can allow skip_items in p->opt, if we don't check (nextOpt->price < kInfinityPrice)
// 18.new.06
if (nextOpt->price < kInfinityPrice
if ((nextOpt->price < kInfinityPrice
// && !IsLitState(state)
&& matchByte == curByte
&& matchByte == curByte)
|| litPrice > nextOpt->price
)
litPrice = 0;
Expand Down
11 changes: 6 additions & 5 deletions C/MtDec.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* MtDec.c -- Multi-thread Decoder
2018-07-04 : Igor Pavlov : Public domain */
2019-02-02 : Igor Pavlov : Public domain */

#include "Precomp.h"

Expand Down Expand Up @@ -88,12 +88,13 @@ static WRes ArEvent_OptCreate_And_Reset(CEvent *p)
}



typedef struct
struct __CMtDecBufLink
{
void *next;
struct __CMtDecBufLink *next;
void *pad[3];
} CMtDecBufLink;
};

typedef struct __CMtDecBufLink CMtDecBufLink;

#define MTDEC__LINK_DATA_OFFSET sizeof(CMtDecBufLink)
#define MTDEC__DATA_PTR_FROM_LINK(link) ((Byte *)(link) + MTDEC__LINK_DATA_OFFSET)
Expand Down
12 changes: 6 additions & 6 deletions C/Util/7z/7zMain.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* 7zMain.c - Test application for 7z Decoder
2018-08-04 : Igor Pavlov : Public domain */
2019-02-02 : Igor Pavlov : Public domain */

#include "Precomp.h"

Expand Down Expand Up @@ -176,7 +176,7 @@ static SRes Utf16_To_Char(CBuf *buf, const UInt16 *s
char defaultChar = '_';
BOOL defUsed;
unsigned numChars = 0;
numChars = WideCharToMultiByte(codePage, 0, s, len, (char *)buf->data, size, &defaultChar, &defUsed);
numChars = WideCharToMultiByte(codePage, 0, (LPCWSTR)s, len, (char *)buf->data, size, &defaultChar, &defUsed);
if (numChars == 0 || numChars >= size)
return SZ_ERROR_FAIL;
buf->data[numChars] = 0;
Expand All @@ -202,7 +202,7 @@ static WRes MyCreateDir(const UInt16 *name)
{
#ifdef USE_WINDOWS_FILE

return CreateDirectoryW(name, NULL) ? 0 : GetLastError();
return CreateDirectoryW((LPCWSTR)name, NULL) ? 0 : GetLastError();

#else

Expand All @@ -227,7 +227,7 @@ static WRes MyCreateDir(const UInt16 *name)
static WRes OutFile_OpenUtf16(CSzFile *p, const UInt16 *name)
{
#ifdef USE_WINDOWS_FILE
return OutFile_OpenW(p, name);
return OutFile_OpenW(p, (LPCWSTR)name);
#else
CBuf buf;
WRes res;
Expand Down Expand Up @@ -430,7 +430,7 @@ int MY_CDECL main(int numargs, char *args[])
res = SZ_OK;

{
lookStream.buf = ISzAlloc_Alloc(&allocImp, kInputBufSize);
lookStream.buf = (Byte *)ISzAlloc_Alloc(&allocImp, kInputBufSize);
if (!lookStream.buf)
res = SZ_ERROR_MEM;
else
Expand Down Expand Up @@ -647,7 +647,7 @@ int MY_CDECL main(int numargs, char *args[])
We remove posix bits, if we detect posix mode field */
if ((attrib & 0xF0000000) != 0)
attrib &= 0x7FFF;
SetFileAttributesW(destPath, attrib);
SetFileAttributesW((LPCWSTR)destPath, attrib);
}
#endif
}
Expand Down

0 comments on commit 4a96064

Please sign in to comment.