Skip to content

Commit

Permalink
Merge branch 'release/1.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
intelligide committed Feb 22, 2021
2 parents 842d113 + df658ad commit 2b7f79a
Show file tree
Hide file tree
Showing 200 changed files with 64,400 additions and 49,471 deletions.
88 changes: 88 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
---
IndentWidth: 4
ColumnLimit: 0

---
Language: Cpp

AccessModifierOffset: -4

AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: DontAlign
AlignOperands: false
AlignTrailingComments: false

AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortIfStatementsOnASingleLine : false
AllowShortLoopsOnASingleLine: false

AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true

BinPackArguments: true
BinPackParameters: true

BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true

BreakBeforeInheritanceComma: false
BreakBeforeTernaryOperators: true

CompactNamespaces: false
FixNamespaceComments: false
NamespaceIndentation: All

BreakConstructorInitializers: AfterColon
ConstructorInitializerIndentWidth: 4
ConstructorInitializerAllOnOneLineOrOnePerLine: true
Cpp11BracedListStyle: false

IncludeBlocks: Preserve

IndentCaseLabels: true
IndentWrappedFunctionNames: true

KeepEmptyLinesAtTheStartOfBlocks: false
MaxEmptyLinesToKeep: 1

PointerAlignment: Left

ReflowComments: true

SortIncludes: false
SortUsingDeclarations: true

SpaceAfterTemplateKeyword: false
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
# SpaceBeforeInheritanceColon: false
# SpaceBeforeCtorInitializerColon: false
# SpaceBeforeRangeBasedForLoopColon: true

IndentCaseBlocks: false
IndentCaseLabels: false
1 change: 1 addition & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Checks: '-*,readability-braces-around-statements'
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace=true
guidelines = 120
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
/out
CMakeSettings.json
test_package/build/
.idea
66 changes: 33 additions & 33 deletions 3rdparty/lzma/Linux/7zBuf.cpp
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
/* 7zBuf.c -- Byte Buffer
2008-03-28
Igor Pavlov
Public domain */

#include "7zBuf.h"

namespace crnlib {

void Buf_Init(CBuf* p) {
p->data = 0;
p->size = 0;
}

int Buf_Create(CBuf* p, size_t size, ISzAlloc* alloc) {
p->size = 0;
if (size == 0) {
p->data = 0;
return 1;
}
p->data = (Byte*)alloc->Alloc(alloc, size);
if (p->data != 0) {
p->size = size;
return 1;
}
return 0;
}

void Buf_Free(CBuf* p, ISzAlloc* alloc) {
alloc->Free(alloc, p->data);
p->data = 0;
p->size = 0;
}
/* 7zBuf.c -- Byte Buffer
2008-03-28
Igor Pavlov
Public domain */

#include "7zBuf.h"

namespace crnlib {

void Buf_Init(CBuf* p) {
p->data = 0;
p->size = 0;
}

int Buf_Create(CBuf* p, size_t size, ISzAlloc* alloc) {
p->size = 0;
if (size == 0) {
p->data = 0;
return 1;
}
p->data = (Byte*)alloc->Alloc(alloc, size);
if (p->data != 0) {
p->size = size;
return 1;
}
return 0;
}

void Buf_Free(CBuf* p, ISzAlloc* alloc) {
alloc->Free(alloc, p->data);
p->data = 0;
p->size = 0;
}
}
68 changes: 34 additions & 34 deletions 3rdparty/lzma/Linux/7zBuf.h
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
/* 7zBuf.h -- Byte Buffer
2008-10-04 : Igor Pavlov : Public domain */

#ifndef __7Z_BUF_H
#define __7Z_BUF_H

#include "LzmaTypes.h"

namespace crnlib {

typedef struct
{
Byte* data;
size_t size;
} CBuf;

void Buf_Init(CBuf* p);
int Buf_Create(CBuf* p, size_t size, ISzAlloc* alloc);
void Buf_Free(CBuf* p, ISzAlloc* alloc);

typedef struct
{
Byte* data;
size_t size;
size_t pos;
} CDynBuf;

void DynBuf_Construct(CDynBuf* p);
void DynBuf_SeekToBeg(CDynBuf* p);
int DynBuf_Write(CDynBuf* p, const Byte* buf, size_t size, ISzAlloc* alloc);
void DynBuf_Free(CDynBuf* p, ISzAlloc* alloc);
}

#endif
/* 7zBuf.h -- Byte Buffer
2008-10-04 : Igor Pavlov : Public domain */

#ifndef __7Z_BUF_H
#define __7Z_BUF_H

#include "LzmaTypes.h"

namespace crnlib {

typedef struct
{
Byte* data;
size_t size;
} CBuf;

void Buf_Init(CBuf* p);
int Buf_Create(CBuf* p, size_t size, ISzAlloc* alloc);
void Buf_Free(CBuf* p, ISzAlloc* alloc);

typedef struct
{
Byte* data;
size_t size;
size_t pos;
} CDynBuf;

void DynBuf_Construct(CDynBuf* p);
void DynBuf_SeekToBeg(CDynBuf* p);
int DynBuf_Write(CDynBuf* p, const Byte* buf, size_t size, ISzAlloc* alloc);
void DynBuf_Free(CDynBuf* p, ISzAlloc* alloc);
}

#endif
86 changes: 43 additions & 43 deletions 3rdparty/lzma/Linux/7zBuf2.cpp
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
/* 7zBuf2.c -- Byte Buffer
2008-10-04 : Igor Pavlov : Public domain */

/* 7zBuf2.c -- Byte Buffer
2008-10-04 : Igor Pavlov : Public domain */

#include <string.h>

#include "7zBuf.h"

namespace crnlib {

void DynBuf_Construct(CDynBuf* p) {
p->data = 0;
p->size = 0;
p->pos = 0;
}

void DynBuf_SeekToBeg(CDynBuf* p) {
p->pos = 0;
}

int DynBuf_Write(CDynBuf* p, const Byte* buf, size_t size, ISzAlloc* alloc) {
if (size > p->size - p->pos) {
size_t newSize = p->pos + size;
Byte* data;
newSize += newSize / 4;
data = (Byte*)alloc->Alloc(alloc, newSize);
if (data == 0)
return 0;
p->size = newSize;
memcpy(data, p->data, p->pos);
alloc->Free(alloc, p->data);
p->data = data;
}
memcpy(p->data + p->pos, buf, size);
p->pos += size;
return 1;
}

void DynBuf_Free(CDynBuf* p, ISzAlloc* alloc) {
alloc->Free(alloc, p->data);
p->data = 0;
p->size = 0;
p->pos = 0;
}
}

#include "7zBuf.h"

namespace crnlib {

void DynBuf_Construct(CDynBuf* p) {
p->data = 0;
p->size = 0;
p->pos = 0;
}

void DynBuf_SeekToBeg(CDynBuf* p) {
p->pos = 0;
}

int DynBuf_Write(CDynBuf* p, const Byte* buf, size_t size, ISzAlloc* alloc) {
if (size > p->size - p->pos) {
size_t newSize = p->pos + size;
Byte* data;
newSize += newSize / 4;
data = (Byte*)alloc->Alloc(alloc, newSize);
if (data == 0)
return 0;
p->size = newSize;
memcpy(data, p->data, p->pos);
alloc->Free(alloc, p->data);
p->data = data;
}
memcpy(p->data + p->pos, buf, size);
p->pos += size;
return 1;
}

void DynBuf_Free(CDynBuf* p, ISzAlloc* alloc) {
alloc->Free(alloc, p->data);
p->data = 0;
p->size = 0;
p->pos = 0;
}
}
66 changes: 33 additions & 33 deletions 3rdparty/lzma/Linux/7zCrc.cpp
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
/* 7zCrc.c -- CRC32 calculation
2008-08-05
Igor Pavlov
/* 7zCrc.c -- CRC32 calculation
2008-08-05
Igor Pavlov
Public domain */

#include "7zCrc.h"

namespace crnlib {

#define kCrcPoly 0xEDB88320
UInt32 g_CrcTable[256];

void MY_FAST_CALL CrcGenerateTable(void) {
UInt32 i;
for (i = 0; i < 256; i++) {
UInt32 r = i;
int j;
for (j = 0; j < 8; j++)
r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1));
g_CrcTable[i] = r;
}
}

UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void* data, size_t size) {
const Byte* p = (const Byte*)data;
for (; size > 0; size--, p++)
v = CRC_UPDATE_BYTE(v, *p);
return v;
}

UInt32 MY_FAST_CALL CrcCalc(const void* data, size_t size) {
return CrcUpdate(CRC_INIT_VAL, data, size) ^ 0xFFFFFFFF;
}
}

#include "7zCrc.h"

namespace crnlib {

#define kCrcPoly 0xEDB88320
UInt32 g_CrcTable[256];

void MY_FAST_CALL CrcGenerateTable(void) {
UInt32 i;
for (i = 0; i < 256; i++) {
UInt32 r = i;
int j;
for (j = 0; j < 8; j++)
r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1));
g_CrcTable[i] = r;
}
}

UInt32 MY_FAST_CALL CrcUpdate(UInt32 v, const void* data, size_t size) {
const Byte* p = (const Byte*)data;
for (; size > 0; size--, p++)
v = CRC_UPDATE_BYTE(v, *p);
return v;
}

UInt32 MY_FAST_CALL CrcCalc(const void* data, size_t size) {
return CrcUpdate(CRC_INIT_VAL, data, size) ^ 0xFFFFFFFF;
}
}
Loading

0 comments on commit 2b7f79a

Please sign in to comment.