Skip to content

Commit c560c42

Browse files
committed
Merge branch '7z' into unicode
2 parents 86b61e1 + 9410517 commit c560c42

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+906
-415
lines changed

C/7zArcIn.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* 7zArcIn.c -- 7z Input functions
2-
2018-07-04 : Igor Pavlov : Public domain */
2+
2018-12-31 : Igor Pavlov : Public domain */
33

44
#include "Precomp.h"
55

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

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

2424
#define k7zMajorVersion 0
2525

@@ -666,7 +666,7 @@ static SRes ReadUnpackInfo(CSzAr *p,
666666
MY_ALLOC(size_t, p->FoCodersOffsets, (size_t)numFolders + 1, alloc);
667667
MY_ALLOC(UInt32, p->FoStartPackStreamIndex, (size_t)numFolders + 1, alloc);
668668
MY_ALLOC(UInt32, p->FoToCoderUnpackSizes, (size_t)numFolders + 1, alloc);
669-
MY_ALLOC(Byte, p->FoToMainUnpackSizeIndex, (size_t)numFolders, alloc);
669+
MY_ALLOC_ZE(Byte, p->FoToMainUnpackSizeIndex, (size_t)numFolders, alloc);
670670

671671
startBufPtr = sd.Data;
672672

C/7zDec.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* 7zDec.c -- Decoding from 7z folder
2-
2018-07-04 : Igor Pavlov : Public domain */
2+
2019-02-02 : Igor Pavlov : Public domain */
33

44
#include "Precomp.h"
55

@@ -156,7 +156,7 @@ static SRes SzDecodeLzma(const Byte *props, unsigned propsSize, UInt64 inSize, I
156156
{
157157
SizeT inProcessed = (SizeT)lookahead, dicPos = state.dicPos;
158158
ELzmaStatus status;
159-
res = LzmaDec_DecodeToDic(&state, outSize, inBuf, &inProcessed, LZMA_FINISH_END, &status);
159+
res = LzmaDec_DecodeToDic(&state, outSize, (const Byte *)inBuf, &inProcessed, LZMA_FINISH_END, &status);
160160
lookahead -= inProcessed;
161161
inSize -= inProcessed;
162162
if (res != SZ_OK)
@@ -218,7 +218,7 @@ static SRes SzDecodeLzma2(const Byte *props, unsigned propsSize, UInt64 inSize,
218218
{
219219
SizeT inProcessed = (SizeT)lookahead, dicPos = state.decoder.dicPos;
220220
ELzmaStatus status;
221-
res = Lzma2Dec_DecodeToDic(&state, outSize, inBuf, &inProcessed, LZMA_FINISH_END, &status);
221+
res = Lzma2Dec_DecodeToDic(&state, outSize, (const Byte *)inBuf, &inProcessed, LZMA_FINISH_END, &status);
222222
lookahead -= inProcessed;
223223
inSize -= inProcessed;
224224
if (res != SZ_OK)

C/7zVersion.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
#define MY_VER_MAJOR 18
2-
#define MY_VER_MINOR 06
1+
#define MY_VER_MAJOR 19
2+
#define MY_VER_MINOR 00
33
#define MY_VER_BUILD 0
4-
#define MY_VERSION_NUMBERS "18.06"
4+
#define MY_VERSION_NUMBERS "19.00"
55
#define MY_VERSION MY_VERSION_NUMBERS
66

77
#ifdef MY_CPU_NAME
@@ -10,7 +10,7 @@
1010
#define MY_VERSION_CPU MY_VERSION
1111
#endif
1212

13-
#define MY_DATE "2018-12-30"
13+
#define MY_DATE "2019-02-21"
1414
#undef MY_COPYRIGHT
1515
#undef MY_VERSION_COPYRIGHT_DATE
1616
#define MY_AUTHOR_NAME "Igor Pavlov"

C/Bcj2Enc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Bcj2Enc.c -- BCJ2 Encoder (Converter for x86 code)
2-
2018-07-04 : Igor Pavlov : Public domain */
2+
2019-02-02 : Igor Pavlov : Public domain */
33

44
#include "Precomp.h"
55

@@ -253,7 +253,7 @@ void Bcj2Enc_Encode(CBcj2Enc *p)
253253
{
254254
const Byte *src = p->src;
255255
const Byte *srcLim = p->srcLim;
256-
unsigned finishMode = p->finishMode;
256+
EBcj2Enc_FinishMode finishMode = p->finishMode;
257257

258258
p->src = p->temp;
259259
p->srcLim = p->temp + p->tempPos;

C/CpuArch.c

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* CpuArch.c -- CPU specific code
2-
2018-07-04: Igor Pavlov : Public domain */
2+
2018-02-18: Igor Pavlov : Public domain */
33

44
#include "Precomp.h"
55

@@ -197,4 +197,22 @@ BoolInt CPU_Is_Aes_Supported()
197197
return (p.c >> 25) & 1;
198198
}
199199

200+
BoolInt CPU_IsSupported_PageGB()
201+
{
202+
Cx86cpuid cpuid;
203+
if (!x86cpuid_CheckAndRead(&cpuid))
204+
return False;
205+
{
206+
UInt32 d[4] = { 0 };
207+
MyCPUID(0x80000000, &d[0], &d[1], &d[2], &d[3]);
208+
if (d[0] < 0x80000001)
209+
return False;
210+
}
211+
{
212+
UInt32 d[4] = { 0 };
213+
MyCPUID(0x80000001, &d[0], &d[1], &d[2], &d[3]);
214+
return (d[3] >> 26) & 1;
215+
}
216+
}
217+
200218
#endif

C/CpuArch.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* CpuArch.h -- CPU specific code
2-
2018-07-04 : Igor Pavlov : Public domain */
2+
2018-02-18 : Igor Pavlov : Public domain */
33

44
#ifndef __CPU_ARCH_H
55
#define __CPU_ARCH_H
@@ -327,6 +327,7 @@ int x86cpuid_GetFirm(const Cx86cpuid *p);
327327

328328
BoolInt CPU_Is_InOrder();
329329
BoolInt CPU_Is_Aes_Supported();
330+
BoolInt CPU_IsSupported_PageGB();
330331

331332
#endif
332333

C/DllSecur.c

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* DllSecur.c -- DLL loading security
2-
2016-10-04 : Igor Pavlov : Public domain */
2+
2018-02-21 : Igor Pavlov : Public domain */
33

44
#include "Precomp.h"
55

@@ -28,10 +28,31 @@ static const char * const g_Dlls =
2828
"CRYPTBASE\0"
2929
"OLEACC\0"
3030
"CLBCATQ\0"
31+
"VERSION\0"
3132
;
3233

3334
#endif
3435

36+
void My_SetDefaultDllDirectories()
37+
{
38+
#ifndef UNDER_CE
39+
40+
OSVERSIONINFO vi;
41+
vi.dwOSVersionInfoSize = sizeof(vi);
42+
GetVersionEx(&vi);
43+
if (!GetVersionEx(&vi) || vi.dwMajorVersion != 6 || vi.dwMinorVersion != 0)
44+
{
45+
Func_SetDefaultDllDirectories setDllDirs = (Func_SetDefaultDllDirectories)
46+
GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "SetDefaultDllDirectories");
47+
if (setDllDirs)
48+
if (setDllDirs(MY_LOAD_LIBRARY_SEARCH_SYSTEM32 | MY_LOAD_LIBRARY_SEARCH_USER_DIRS))
49+
return;
50+
}
51+
52+
#endif
53+
}
54+
55+
3556
void LoadSecurityDlls()
3657
{
3758
#ifndef UNDER_CE
@@ -70,7 +91,7 @@ void LoadSecurityDlls()
7091
for (;;)
7192
{
7293
char c = *dll++;
73-
buf[pos + k] = c;
94+
buf[pos + k] = (Byte)c;
7495
k++;
7596
if (c == 0)
7697
break;

C/DllSecur.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* DllSecur.h -- DLL loading for security
2-
2016-06-08 : Igor Pavlov : Public domain */
2+
2018-02-19 : Igor Pavlov : Public domain */
33

44
#ifndef __DLL_SECUR_H
55
#define __DLL_SECUR_H
@@ -10,6 +10,7 @@ EXTERN_C_BEGIN
1010

1111
#ifdef _WIN32
1212

13+
void My_SetDefaultDllDirectories();
1314
void LoadSecurityDlls();
1415

1516
#endif

C/Lzma2Dec.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Lzma2Dec.c -- LZMA2 Decoder
2-
2018-07-04 : Igor Pavlov : Public domain */
2+
2019-02-02 : Igor Pavlov : Public domain */
33

44
/* #define SHOW_DEBUG_INFO */
55

@@ -314,15 +314,15 @@ ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p,
314314
while (p->state != LZMA2_STATE_ERROR)
315315
{
316316
if (p->state == LZMA2_STATE_FINISHED)
317-
return LZMA_STATUS_FINISHED_WITH_MARK;
317+
return (ELzma2ParseStatus)LZMA_STATUS_FINISHED_WITH_MARK;
318318

319319
if (outSize == 0 && !checkFinishBlock)
320-
return LZMA_STATUS_NOT_FINISHED;
320+
return (ELzma2ParseStatus)LZMA_STATUS_NOT_FINISHED;
321321

322322
if (p->state != LZMA2_STATE_DATA && p->state != LZMA2_STATE_DATA_CONT)
323323
{
324324
if (*srcLen == inSize)
325-
return LZMA_STATUS_NEEDS_MORE_INPUT;
325+
return (ELzma2ParseStatus)LZMA_STATUS_NEEDS_MORE_INPUT;
326326
(*srcLen)++;
327327

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

350350
if (p->state == LZMA2_STATE_DATA)
@@ -354,15 +354,15 @@ ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p,
354354
}
355355

356356
if (outSize == 0)
357-
return LZMA_STATUS_NOT_FINISHED;
357+
return (ELzma2ParseStatus)LZMA_STATUS_NOT_FINISHED;
358358

359359
{
360360
SizeT inCur = inSize - *srcLen;
361361

362362
if (LZMA2_IS_UNCOMPRESSED_STATE(p))
363363
{
364364
if (inCur == 0)
365-
return LZMA_STATUS_NEEDS_MORE_INPUT;
365+
return (ELzma2ParseStatus)LZMA_STATUS_NEEDS_MORE_INPUT;
366366
if (inCur > p->unpackSize)
367367
inCur = p->unpackSize;
368368
if (inCur > outSize)
@@ -381,7 +381,7 @@ ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p,
381381
if (inCur == 0)
382382
{
383383
if (p->packSize != 0)
384-
return LZMA_STATUS_NEEDS_MORE_INPUT;
384+
return (ELzma2ParseStatus)LZMA_STATUS_NEEDS_MORE_INPUT;
385385
}
386386
else if (p->state == LZMA2_STATE_DATA)
387387
{
@@ -418,7 +418,7 @@ ELzma2ParseStatus Lzma2Dec_Parse(CLzma2Dec *p,
418418
}
419419

420420
p->state = LZMA2_STATE_ERROR;
421-
return LZMA_STATUS_NOT_SPECIFIED;
421+
return (ELzma2ParseStatus)LZMA_STATUS_NOT_SPECIFIED;
422422
}
423423

424424

C/Lzma2DecMt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* Lzma2DecMt.c -- LZMA2 Decoder Multi-thread
2-
2018-07-04 : Igor Pavlov : Public domain */
2+
2019-02-02 : Igor Pavlov : Public domain */
33

44
#include "Precomp.h"
55

@@ -265,7 +265,7 @@ static void Lzma2DecMt_MtCallback_Parse(void *obj, unsigned coderIndex, CMtDecCa
265265
t->outPreSize = 0;
266266
// t->blockWasFinished = False;
267267
// t->finishedWithMark = False;
268-
t->parseStatus = LZMA_STATUS_NOT_SPECIFIED;
268+
t->parseStatus = (ELzma2ParseStatus)LZMA_STATUS_NOT_SPECIFIED;
269269
t->state = MTDEC_PARSE_CONTINUE;
270270

271271
t->inCodeSize = 0;

0 commit comments

Comments
 (0)