Skip to content

Commit 2b7f79a

Browse files
committed
Merge branch 'release/1.3.0'
2 parents 842d113 + df658ad commit 2b7f79a

File tree

200 files changed

+64400
-49471
lines changed

Some content is hidden

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

200 files changed

+64400
-49471
lines changed

.clang-format

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
---
2+
IndentWidth: 4
3+
ColumnLimit: 0
4+
5+
---
6+
Language: Cpp
7+
8+
AccessModifierOffset: -4
9+
10+
AlignAfterOpenBracket: DontAlign
11+
AlignConsecutiveAssignments: false
12+
AlignConsecutiveDeclarations: false
13+
AlignEscapedNewlines: DontAlign
14+
AlignOperands: false
15+
AlignTrailingComments: false
16+
17+
AllowShortBlocksOnASingleLine: false
18+
AllowShortCaseLabelsOnASingleLine: false
19+
AllowShortFunctionsOnASingleLine: None
20+
AllowShortIfStatementsOnASingleLine : false
21+
AllowShortLoopsOnASingleLine: false
22+
23+
AlwaysBreakAfterReturnType: None
24+
AlwaysBreakBeforeMultilineStrings: false
25+
AlwaysBreakTemplateDeclarations: true
26+
27+
BinPackArguments: true
28+
BinPackParameters: true
29+
30+
BreakBeforeBraces: Custom
31+
BraceWrapping:
32+
AfterCaseLabel: true
33+
AfterClass: true
34+
AfterControlStatement: true
35+
AfterEnum: true
36+
AfterFunction: true
37+
AfterNamespace: true
38+
AfterStruct: true
39+
AfterUnion: true
40+
AfterExternBlock: true
41+
BeforeCatch: true
42+
BeforeElse: true
43+
IndentBraces: false
44+
SplitEmptyFunction: true
45+
SplitEmptyRecord: true
46+
SplitEmptyNamespace: true
47+
48+
BreakBeforeInheritanceComma: false
49+
BreakBeforeTernaryOperators: true
50+
51+
CompactNamespaces: false
52+
FixNamespaceComments: false
53+
NamespaceIndentation: All
54+
55+
BreakConstructorInitializers: AfterColon
56+
ConstructorInitializerIndentWidth: 4
57+
ConstructorInitializerAllOnOneLineOrOnePerLine: true
58+
Cpp11BracedListStyle: false
59+
60+
IncludeBlocks: Preserve
61+
62+
IndentCaseLabels: true
63+
IndentWrappedFunctionNames: true
64+
65+
KeepEmptyLinesAtTheStartOfBlocks: false
66+
MaxEmptyLinesToKeep: 1
67+
68+
PointerAlignment: Left
69+
70+
ReflowComments: true
71+
72+
SortIncludes: false
73+
SortUsingDeclarations: true
74+
75+
SpaceAfterTemplateKeyword: false
76+
SpaceBeforeAssignmentOperators: true
77+
SpaceBeforeParens: ControlStatements
78+
SpaceInEmptyParentheses: false
79+
SpacesBeforeTrailingComments: 1
80+
SpacesInAngles: false
81+
SpacesInParentheses: false
82+
SpacesInSquareBrackets: false
83+
# SpaceBeforeInheritanceColon: false
84+
# SpaceBeforeCtorInitializerColon: false
85+
# SpaceBeforeRangeBasedForLoopColon: true
86+
87+
IndentCaseBlocks: false
88+
IndentCaseLabels: false

.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Checks: '-*,readability-braces-around-statements'

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ insert_final_newline = true
77
indent_style = space
88
indent_size = 4
99
trim_trailing_whitespace=true
10+
guidelines = 120

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
/out
33
CMakeSettings.json
44
test_package/build/
5+
.idea

3rdparty/lzma/Linux/7zBuf.cpp

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
/* 7zBuf.c -- Byte Buffer
2-
2008-03-28
3-
Igor Pavlov
4-
Public domain */
5-
6-
#include "7zBuf.h"
7-
8-
namespace crnlib {
9-
10-
void Buf_Init(CBuf* p) {
11-
p->data = 0;
12-
p->size = 0;
13-
}
14-
15-
int Buf_Create(CBuf* p, size_t size, ISzAlloc* alloc) {
16-
p->size = 0;
17-
if (size == 0) {
18-
p->data = 0;
19-
return 1;
20-
}
21-
p->data = (Byte*)alloc->Alloc(alloc, size);
22-
if (p->data != 0) {
23-
p->size = size;
24-
return 1;
25-
}
26-
return 0;
27-
}
28-
29-
void Buf_Free(CBuf* p, ISzAlloc* alloc) {
30-
alloc->Free(alloc, p->data);
31-
p->data = 0;
32-
p->size = 0;
33-
}
1+
/* 7zBuf.c -- Byte Buffer
2+
2008-03-28
3+
Igor Pavlov
4+
Public domain */
5+
6+
#include "7zBuf.h"
7+
8+
namespace crnlib {
9+
10+
void Buf_Init(CBuf* p) {
11+
p->data = 0;
12+
p->size = 0;
13+
}
14+
15+
int Buf_Create(CBuf* p, size_t size, ISzAlloc* alloc) {
16+
p->size = 0;
17+
if (size == 0) {
18+
p->data = 0;
19+
return 1;
20+
}
21+
p->data = (Byte*)alloc->Alloc(alloc, size);
22+
if (p->data != 0) {
23+
p->size = size;
24+
return 1;
25+
}
26+
return 0;
27+
}
28+
29+
void Buf_Free(CBuf* p, ISzAlloc* alloc) {
30+
alloc->Free(alloc, p->data);
31+
p->data = 0;
32+
p->size = 0;
33+
}
3434
}

3rdparty/lzma/Linux/7zBuf.h

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
/* 7zBuf.h -- Byte Buffer
2-
2008-10-04 : Igor Pavlov : Public domain */
3-
4-
#ifndef __7Z_BUF_H
5-
#define __7Z_BUF_H
6-
7-
#include "LzmaTypes.h"
8-
9-
namespace crnlib {
10-
11-
typedef struct
12-
{
13-
Byte* data;
14-
size_t size;
15-
} CBuf;
16-
17-
void Buf_Init(CBuf* p);
18-
int Buf_Create(CBuf* p, size_t size, ISzAlloc* alloc);
19-
void Buf_Free(CBuf* p, ISzAlloc* alloc);
20-
21-
typedef struct
22-
{
23-
Byte* data;
24-
size_t size;
25-
size_t pos;
26-
} CDynBuf;
27-
28-
void DynBuf_Construct(CDynBuf* p);
29-
void DynBuf_SeekToBeg(CDynBuf* p);
30-
int DynBuf_Write(CDynBuf* p, const Byte* buf, size_t size, ISzAlloc* alloc);
31-
void DynBuf_Free(CDynBuf* p, ISzAlloc* alloc);
32-
}
33-
34-
#endif
1+
/* 7zBuf.h -- Byte Buffer
2+
2008-10-04 : Igor Pavlov : Public domain */
3+
4+
#ifndef __7Z_BUF_H
5+
#define __7Z_BUF_H
6+
7+
#include "LzmaTypes.h"
8+
9+
namespace crnlib {
10+
11+
typedef struct
12+
{
13+
Byte* data;
14+
size_t size;
15+
} CBuf;
16+
17+
void Buf_Init(CBuf* p);
18+
int Buf_Create(CBuf* p, size_t size, ISzAlloc* alloc);
19+
void Buf_Free(CBuf* p, ISzAlloc* alloc);
20+
21+
typedef struct
22+
{
23+
Byte* data;
24+
size_t size;
25+
size_t pos;
26+
} CDynBuf;
27+
28+
void DynBuf_Construct(CDynBuf* p);
29+
void DynBuf_SeekToBeg(CDynBuf* p);
30+
int DynBuf_Write(CDynBuf* p, const Byte* buf, size_t size, ISzAlloc* alloc);
31+
void DynBuf_Free(CDynBuf* p, ISzAlloc* alloc);
32+
}
33+
34+
#endif

3rdparty/lzma/Linux/7zBuf2.cpp

Lines changed: 43 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
1-
/* 7zBuf2.c -- Byte Buffer
2-
2008-10-04 : Igor Pavlov : Public domain */
3-
1+
/* 7zBuf2.c -- Byte Buffer
2+
2008-10-04 : Igor Pavlov : Public domain */
3+
44
#include <string.h>
5-
6-
#include "7zBuf.h"
7-
8-
namespace crnlib {
9-
10-
void DynBuf_Construct(CDynBuf* p) {
11-
p->data = 0;
12-
p->size = 0;
13-
p->pos = 0;
14-
}
15-
16-
void DynBuf_SeekToBeg(CDynBuf* p) {
17-
p->pos = 0;
18-
}
19-
20-
int DynBuf_Write(CDynBuf* p, const Byte* buf, size_t size, ISzAlloc* alloc) {
21-
if (size > p->size - p->pos) {
22-
size_t newSize = p->pos + size;
23-
Byte* data;
24-
newSize += newSize / 4;
25-
data = (Byte*)alloc->Alloc(alloc, newSize);
26-
if (data == 0)
27-
return 0;
28-
p->size = newSize;
29-
memcpy(data, p->data, p->pos);
30-
alloc->Free(alloc, p->data);
31-
p->data = data;
32-
}
33-
memcpy(p->data + p->pos, buf, size);
34-
p->pos += size;
35-
return 1;
36-
}
37-
38-
void DynBuf_Free(CDynBuf* p, ISzAlloc* alloc) {
39-
alloc->Free(alloc, p->data);
40-
p->data = 0;
41-
p->size = 0;
42-
p->pos = 0;
43-
}
44-
}
5+
6+
#include "7zBuf.h"
7+
8+
namespace crnlib {
9+
10+
void DynBuf_Construct(CDynBuf* p) {
11+
p->data = 0;
12+
p->size = 0;
13+
p->pos = 0;
14+
}
15+
16+
void DynBuf_SeekToBeg(CDynBuf* p) {
17+
p->pos = 0;
18+
}
19+
20+
int DynBuf_Write(CDynBuf* p, const Byte* buf, size_t size, ISzAlloc* alloc) {
21+
if (size > p->size - p->pos) {
22+
size_t newSize = p->pos + size;
23+
Byte* data;
24+
newSize += newSize / 4;
25+
data = (Byte*)alloc->Alloc(alloc, newSize);
26+
if (data == 0)
27+
return 0;
28+
p->size = newSize;
29+
memcpy(data, p->data, p->pos);
30+
alloc->Free(alloc, p->data);
31+
p->data = data;
32+
}
33+
memcpy(p->data + p->pos, buf, size);
34+
p->pos += size;
35+
return 1;
36+
}
37+
38+
void DynBuf_Free(CDynBuf* p, ISzAlloc* alloc) {
39+
alloc->Free(alloc, p->data);
40+
p->data = 0;
41+
p->size = 0;
42+
p->pos = 0;
43+
}
44+
}

3rdparty/lzma/Linux/7zCrc.cpp

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
/* 7zCrc.c -- CRC32 calculation
2-
2008-08-05
3-
Igor Pavlov
1+
/* 7zCrc.c -- CRC32 calculation
2+
2008-08-05
3+
Igor Pavlov
44
Public domain */
5-
6-
#include "7zCrc.h"
7-
8-
namespace crnlib {
9-
10-
#define kCrcPoly 0xEDB88320
11-
UInt32 g_CrcTable[256];
12-
13-
void MY_FAST_CALL CrcGenerateTable(void) {
14-
UInt32 i;
15-
for (i = 0; i < 256; i++) {
16-
UInt32 r = i;
17-
int j;
18-
for (j = 0; j < 8; j++)
19-
r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1));
20-
g_CrcTable[i] = r;
21-
}
22-
}
23-
24-
UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void* data, size_t size) {
25-
const Byte* p = (const Byte*)data;
26-
for (; size > 0; size--, p++)
27-
v = CRC_UPDATE_BYTE(v, *p);
28-
return v;
29-
}
30-
31-
UInt32 MY_FAST_CALL CrcCalc(const void* data, size_t size) {
32-
return CrcUpdate(CRC_INIT_VAL, data, size) ^ 0xFFFFFFFF;
33-
}
34-
}
5+
6+
#include "7zCrc.h"
7+
8+
namespace crnlib {
9+
10+
#define kCrcPoly 0xEDB88320
11+
UInt32 g_CrcTable[256];
12+
13+
void MY_FAST_CALL CrcGenerateTable(void) {
14+
UInt32 i;
15+
for (i = 0; i < 256; i++) {
16+
UInt32 r = i;
17+
int j;
18+
for (j = 0; j < 8; j++)
19+
r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1));
20+
g_CrcTable[i] = r;
21+
}
22+
}
23+
24+
UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void* data, size_t size) {
25+
const Byte* p = (const Byte*)data;
26+
for (; size > 0; size--, p++)
27+
v = CRC_UPDATE_BYTE(v, *p);
28+
return v;
29+
}
30+
31+
UInt32 MY_FAST_CALL CrcCalc(const void* data, size_t size) {
32+
return CrcUpdate(CRC_INIT_VAL, data, size) ^ 0xFFFFFFFF;
33+
}
34+
}

0 commit comments

Comments
 (0)