Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Asm/x86/7zCrcOpt.asm
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ endm
jnc @B

if 0
; byte verson
; byte version
add rD, rN
xor x0, dword ptr [rD]
add rN, NUM_BYTES_LIMIT - 1
Expand Down
4 changes: 2 additions & 2 deletions C/CpuArch.h
Original file line number Diff line number Diff line change
Expand Up @@ -455,13 +455,13 @@ problem-3 : compiler for 32-bit arm:
32-bit access must be aligned for 32-bit, if we want to
avoid "Alignment fault" exception (handled or unhandled).

problem-4 : performace:
problem-4 : performance:
Even if unaligned access is handled by kernel, it will be slow.
So if we allow unaligned access, we can get fast unaligned
single-access, and slow unaligned paired-access.

We don't allow unaligned access on 32-bit arm, because compiler
genarates paired-access instructions that require 32-bit alignment,
generates paired-access instructions that require 32-bit alignment,
and some arm64 kernels have no handler for these instructions.
Also unaligned paired-access instructions will be slow, if kernel handles them.
*/
Expand Down
4 changes: 2 additions & 2 deletions C/HuffEnc.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void Huffman_Generate(const UInt32 *freqs, UInt32 *p, Byte *lens, unsigned numSy
{
const UInt32 *fp = freqs + numSymbols;
#define NUM_UNROLLS 1
#if NUM_UNROLLS > 1 // use 1 if odd (numSymbols) is possisble
#if NUM_UNROLLS > 1 // use 1 if odd (numSymbols) is possible
if (numSymbols & 1)
{
UInt32 f;
Expand Down Expand Up @@ -282,7 +282,7 @@ void Huffman_Generate(const UInt32 *freqs, UInt32 *p, Byte *lens, unsigned numSy

if (b != p)
{
// we detect level of each node (realtive to root),
// we detect level of each node (relative to root),
// and update lenCounters[].
// We process only intermediate nodes and we don't process leaves.
do
Expand Down
4 changes: 2 additions & 2 deletions C/LzFind.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#define kBlockMoveAlign (1 << 7) // alignment for memmove()
#define kBlockSizeAlign (1 << 16) // alignment for block allocation
#define kBlockSizeReserveMin (1 << 24) // it's 1/256 from 4 GB dictinary
#define kBlockSizeReserveMin (1 << 24) // it's 1/256 from 4 GB dictionary

#define kEmptyHashValue 0

Expand Down Expand Up @@ -147,7 +147,7 @@ static void MatchFinder_ReadBlock(CMatchFinder *p)
if (size == 0)
{
/* we call ReadBlock() after NeedMove() and MoveBlock().
NeedMove() and MoveBlock() povide more than (keepSizeAfter)
NeedMove() and MoveBlock() provide more than (keepSizeAfter)
to the end of (blockSize).
So we don't execute this branch in normal code flow.
We can go here, if we will call ReadBlock() before NeedMove(), MoveBlock().
Expand Down
8 changes: 4 additions & 4 deletions C/LzFindMt.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ static void MtSync_StopWriting(CMtSync *p)

PRF(printf("\nMtSync_StopWriting %p : Event_Wait(&p->wasStopped)\n", p));
Event_Wait(&p->wasStopped);
PRF(printf("\nMtSync_StopWriting %p : Event_Wait() finsihed\n", p));
PRF(printf("\nMtSync_StopWriting %p : Event_Wait() finished\n", p));

/* 21.03 : we don't restore samaphore counters here.
We will recreate and reinit samaphores in next start */
/* 21.03 : we don't restore semaphore counters here.
We will recreate and reinit semaphores in next start */

p->needStart = True;
}
Expand Down Expand Up @@ -972,7 +972,7 @@ static UInt32 MatchFinderMt_GetNextBlock_Bt(CMatchFinderMt *p)
p->failure_LZ_BT = True;
// p->btNumAvailBytes = 0;
/* we don't want to decrease AvailBytes, that was load before.
that can be unxepected for the code that have loaded anopther value before */
that can be unexpected for the code that have loaded another value before */
}
}

Expand Down
2 changes: 1 addition & 1 deletion C/LzFindMt.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ typedef struct CMatchFinderMt_
const UInt32 *crc;

Mf_Mix_Matches MixMatchesFunc;
UInt32 failure_LZ_BT; // failure in BT transfered to LZ
UInt32 failure_LZ_BT; // failure in BT transferred to LZ
// UInt32 failure_LZ_LZ; // failure in LZ tables
UInt32 failureBuf[1];
// UInt32 crc[256];
Expand Down
2 changes: 1 addition & 1 deletion C/Lzma2Dec.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ LZMA2 parser doesn't decode LZMA chunks, so we must read

Lzma2Dec_GetUnpackExtra() returns the value that shows
max possible number of output bytes that can be output by decoder
at current input positon.
at current input position.
*/

#define Lzma2Dec_GetUnpackExtra(p) ((p)->isExtraMode ? (p)->unpackSize : 0)
Expand Down
2 changes: 1 addition & 1 deletion C/Lzma86Enc.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ int Lzma86_Encode(Byte *dest, size_t *destLen, const Byte *src, size_t srcLen,
/* passes for SZ_FILTER_AUTO:
0 - BCJ + LZMA
1 - LZMA
2 - BCJ + LZMA agaian, if pass 0 (BCJ + LZMA) is better.
2 - BCJ + LZMA again, if pass 0 (BCJ + LZMA) is better.
*/
int numPasses = (filterMode == SZ_FILTER_AUTO) ? 3 : 1;

Expand Down
4 changes: 2 additions & 2 deletions C/LzmaLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ outPropsSize -
In: the pointer to the size of outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5.
Out: the pointer to the size of written properties in outProps buffer; *outPropsSize = LZMA_PROPS_SIZE = 5.

LZMA Encoder will use defult values for any parameter, if it is
LZMA Encoder will use default values for any parameter, if it is
-1 for any from: level, loc, lp, pb, fb, numThreads
0 for dictSize

Expand Down Expand Up @@ -125,7 +125,7 @@ LzmaUncompress
Returns:
SZ_OK - OK
SZ_ERROR_DATA - Data error
SZ_ERROR_MEM - Memory allocation arror
SZ_ERROR_MEM - Memory allocation error
SZ_ERROR_UNSUPPORTED - Unsupported properties
SZ_ERROR_INPUT_EOF - it needs more bytes in input buffer (src)
*/
Expand Down
16 changes: 8 additions & 8 deletions C/Ppmd7.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ void Ppmd7_Init(CPpmd7 *p, unsigned maxOrder)
that is the link to position in Raw text.
So we create Context records and write the links to
FoundState->Successor and to identical RAW-Successors in suffix
contexts of MinContex.
contexts of MinContext.

The function returns:
if (OrderFall == 0) then MinContext is already at MAX order,
Expand Down Expand Up @@ -519,7 +519,7 @@ static PPMD7_CTX_PTR Ppmd7_CreateSuccessors(CPpmd7 *p)
s0 = (UInt32)c->Union2.SummFreq - c->NumStats - cf;
/*
cf - is frequency of symbol that will be Successor in new context records.
s0 - is commulative frequency sum of another symbols from parent context.
s0 - is cumulative frequency sum of another symbols from parent context.
max(newFreq)= (s->Freq + 1), when (s0 == 1)
we have requirement (Ppmd7Context_OneState()->Freq <= 128) in BinSumm[]
so (s->Freq < 128) - is requirement for multi-symbol contexts
Expand Down Expand Up @@ -668,19 +668,19 @@ void Ppmd7_UpdateModel(CPpmd7 *p)
if (--p->OrderFall == 0)
{
/*
if we move to MaxOrder context, then minSuccessor will be common Succesor for both:
if we move to MaxOrder context, then minSuccessor will be common Successor for both:
MinContext that is (MaxOrder - 1)
MaxContext that is (MaxOrder)
so we don't need new RAW-Successor, and we can use real minSuccessor
as succssors for both MinContext and MaxContext.
as successors for both MinContext and MaxContext.
*/
maxSuccessor = minSuccessor;

/*
if (MaxContext != MinContext)
{
there was order fall from MaxOrder and we don't need current symbol
to transfer some RAW-Succesors to real contexts.
to transfer some RAW-Successors to real contexts.
So we roll back pointer in raw data for one position.
}
*/
Expand Down Expand Up @@ -1041,7 +1041,7 @@ PPMd Memory Map:
}

These addresses don't cross at any time.
And the following condtions is true for addresses:
And the following conditions is true for addresses:
(0 <= Text < UnitsStart <= LoUnit <= HiUnit <= Size)

Raw text is BYTE--aligned.
Expand All @@ -1052,7 +1052,7 @@ The code can free UNITs memory blocks that were allocated to store CPpmd_State v
The code doesn't free UNITs allocated for CPpmd7_Context records.

The code calls Ppmd7_RestartModel(), when there is no free memory for allocation.
And Ppmd7_RestartModel() changes the state to orignal start state, with full free block.
And Ppmd7_RestartModel() changes the state to original start state, with full free block.


The code allocates UNITs with the following order:
Expand Down Expand Up @@ -1088,7 +1088,7 @@ There are 3 types of Successor:
3) RECORD-Successor - the link to CPpmd7_Context record of (Order+1),
that record is being created when we go via RAW-Successor again.

For any successors at any time: the following condtions are true for Successor links:
For any successors at any time: the following conditions are true for Successor links:
(NULL-Successor < RAW-Successor < UnitsStart <= RECORD-Successor)


Expand Down
4 changes: 2 additions & 2 deletions C/Ppmd8.c
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ static void SWAP_STATES(CPpmd_State *t1, CPpmd_State *t2)

/*
CutOff() reduces contexts:
It conversts Successors at MaxOrder to another Contexts to NULL-Successors
It converts Successors at MaxOrder to another Contexts to NULL-Successors
It removes RAW-Successors and NULL-Successors that are not Order-0
and it removes contexts when it has no Successors.
if the (Union4.Stats) is close to (UnitsStart), it moves it up.
Expand Down Expand Up @@ -715,7 +715,7 @@ static CPpmd_Void_Ref CutOff(CPpmd8 *p, PPMD8_CTX_PTR ctx, unsigned order)

/*
RemoveBinContexts()
It conversts Successors at MaxOrder to another Contexts to NULL-Successors
It converts Successors at MaxOrder to another Contexts to NULL-Successors
It changes RAW-Successors to NULL-Successors
removes Bin Context without Successor, if suffix of that context is also binary.
*/
Expand Down
2 changes: 1 addition & 1 deletion C/Sha512.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ Are there any ways to fix the problems with arm64-wine and x64-SDE cases?
isSupported = True;
}
#else // Z7_COMPILER_SHA512_SUPPORTED
// for debug : we generate bad instrction or raise exception.
// for debug : we generate bad instruction or raise exception.
// __except() doesn't catch raise() calls.
#ifdef Z7_SHA512_USE_LONGJMP
PRF(printf("====== raise(SIGILL)\n");)
Expand Down
2 changes: 1 addition & 1 deletion C/Sort.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ if !defined(USE_PREFETCH_FOR_ALIGNED_ARRAY)
#if 1 && PREFETCH_LEVEL <= 3 && defined(USE_PREFETCH_FOR_ALIGNED_ARRAY)
#define PREFETCH_ADD_OFFSET 0
#else
// last offset that can be reqiured in PREFETCH_LEVEL step:
// last offset that can be required in PREFETCH_LEVEL step:
#define PREFETCH_RANGE ((2 << PREFETCH_LEVEL) - 1)
#define PREFETCH_ADD_OFFSET PREFETCH_RANGE / 2
#endif
Expand Down
2 changes: 1 addition & 1 deletion C/Threads.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ Z7_DIAGNOSTIC_IGNORE_END_RESERVED_MACRO_IDENTIFIER

WRes Thread_Create_With_CpuSet(CThread *p, THREAD_FUNC_TYPE func, LPVOID param, const CCpuSet *cpuSet)
{
// new thread in Posix probably inherits affinity from parrent thread
// new thread in Posix probably inherits affinity from parent thread
Print("Thread_Create_With_CpuSet")

pthread_attr_t attr;
Expand Down
4 changes: 2 additions & 2 deletions C/Threads.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ typedef HANDLE CThread;
// #define Thread_Wait(p) Handle_WaitObject(*(p))

#ifdef UNDER_CE
// if (USE_THREADS_CreateThread is defined), we use _beginthreadex()
// if (USE_THREADS_CreateThread is not definned), we use CreateThread()
// if (USE_THREADS_CreateThread is defined), we use _beginthreadex()
// if (USE_THREADS_CreateThread is not defined), we use CreateThread()
#define USE_THREADS_CreateThread
#endif

Expand Down
2 changes: 1 addition & 1 deletion C/Xz.h
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ typedef struct
SRes ReadRes; // error code from ISeqInStream:Read()
SRes ProgressRes; // error code from ICompressProgress:Progress()

SRes CombinedRes; // Combined result error code that shows main rusult
SRes CombinedRes; // Combined result error code that shows main result
// = S_OK, if there is no error.
// but check also (DataAfterEnd) that can show additional minor errors.

Expand Down
2 changes: 1 addition & 1 deletion C/XzDec.c
Original file line number Diff line number Diff line change
Expand Up @@ -2583,7 +2583,7 @@ static void XzStatInfo_SetStat(const CXzUnpacker *dec,
{
// if (extraSize != 0 || readProcessed != inProcessed)
{
// he we suppose that all xz streams were finsihed OK, and we have
// he we suppose that all xz streams were finished OK, and we have
// some extra data after all streams
stat->DataAfterEnd = True;
res = SZ_OK;
Expand Down
14 changes: 7 additions & 7 deletions C/ZstdDec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1341,7 +1341,7 @@ typedef struct
else {
if ( isCyclicMode) : cycSize = cyclic_buffer_size = (winSize + extra_space)
if (!isCyclicMode) : cycSize = ContentSize,
(isCyclicMode == true) if (ContetSize >= winSize) or ContetSize is unknown
(isCyclicMode == true) if (ContentSize >= winSize) or ContentSize is unknown
}
*/
SizeT winPos;
Expand Down Expand Up @@ -2574,7 +2574,7 @@ SRes ZstdDec1_DecodeBlock(CZstdDec1 *p,
else
#ifdef MY_CPU_64BIT
{
// alignemt (UInt64 _pad_Alignment) in fse.ml is required for that code
// alignment (UInt64 _pad_Alignment) in fse.ml is required for that code
UInt64 *table = (UInt64 *)(void *)p->fse.ml;
const UInt64 *end = (const UInt64 *)(const void *)
((const Byte *)(const void *)table + ((size_t)sizeof(CFseRecord) << accuracy));
Expand Down Expand Up @@ -2873,7 +2873,7 @@ static SRes ZstdDec_AllocateMisc(CZstdDec *p)
}
if (!p->inTemp)
{
// we need k_Lit_AfterAvail here for owerread from raw literals stream
// we need k_Lit_AfterAvail here for overread from raw literals stream
p->inTemp = (Byte *)ISzAlloc_Alloc(p->alloc_Small,
kBlockSizeMax + kTempBuffer_PreSize + k_Lit_AfterAvail);
if (!p->inTemp)
Expand Down Expand Up @@ -3512,7 +3512,7 @@ static SRes ZstdDec_DecodeBlock(CZstdDec * const p, CZstdDecState * const ds,
}
else
{
/* ZSTD2_STATE_FINISHED proccesing doesn't depend from input buffer */
/* ZSTD2_STATE_FINISHED processing doesn't depend from input buffer */
p->frameState = ZSTD2_STATE_FINISHED;
}
/*
Expand Down Expand Up @@ -3899,9 +3899,9 @@ SRes ZstdDec_Decode(CZstdDecHandle dec, CZstdDecState *p)

if (useCyclic)
{
/* cyclyc buffer size must be at least (COPY_CHUNK_SIZE - 1) bytes
/* cyclic buffer size must be at least (COPY_CHUNK_SIZE - 1) bytes
larger than window size, because CopyMatch() can write additional
(COPY_CHUNK_SIZE - 1) bytes and overwrite oldests data in cyclyc buffer.
(COPY_CHUNK_SIZE - 1) bytes and overwrite oldest data in cyclic buffer.
But for performance reasons we align (cycSize) for (kBlockSizeMax).
also we must provide (cycSize >= max_decoded_data_after_cycSize),
because after data move wrapping over zero we must provide (winPos < cycSize).
Expand Down Expand Up @@ -3984,7 +3984,7 @@ SRes ZstdDec_Decode(CZstdDecHandle dec, CZstdDecState *p)
/*
else
{
// for non-cyclycMode we want flush data, and set winPos = 0
// for non-cyclicMode we want flush data, and set winPos = 0
if (needWrite)
{
if (!useCyclic || dec->decoder.winPos >= cycSize)
Expand Down
2 changes: 1 addition & 1 deletion C/ZstdDec.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ typedef enum
ZSTD_STATUS_FINISHED_FRAME, /* data frame or skip frame was finished */
ZSTD_STATUS_NOT_FINISHED, /* just finished non-empty block or unfinished RAW/RLE block */
ZSTD_STATUS_NEEDS_MORE_INPUT, /* the callee needs more input bytes. It has more priority over ZSTD_STATUS_NOT_FINISHED */
ZSTD_STATUS_OUT_REACHED /* is not finihed frame and ((outProcessed > outSize) || (outProcessed == outSize && unfinished RAW/RLE block) */
ZSTD_STATUS_OUT_REACHED /* is not finished frame and ((outProcessed > outSize) || (outProcessed == outSize && unfinished RAW/RLE block) */
} enum_ZstdStatus_Dummy;

#define ZstdDecState_DOES_NEED_MORE_INPUT_OR_FINISHED_FRAME(p) \
Expand Down
2 changes: 1 addition & 1 deletion CPP/7zip/Archive/7z/7zOut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ void COutArchive::WriteHeader(

/*
{
// It's example for per archive properies writing
// It's example for per archive properties writing

WriteByte(NID::kArchiveProperties);

Expand Down
10 changes: 5 additions & 5 deletions CPP/7zip/Archive/ApfsHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1857,7 +1857,7 @@ struct CKeyValPair
{
CByteBuffer Key;
CByteBuffer Val;
// unsigned ValPos; // for alognment
// unsigned ValPos; // for alignment
};


Expand Down Expand Up @@ -1945,7 +1945,7 @@ struct CMap
btree_info bti;
UInt64 NumNodes;

// we use thnese options to check:
// we use these options to check:
UInt32 Subtype;
bool IsPhysical;

Expand Down Expand Up @@ -2884,7 +2884,7 @@ HRESULT CDatabase::OpenVolume(const CObjectMap &omap, const oid_t fs_oid)
return S_FALSE;
if (vol.NodeIDs.Back() != id)
{
// extents for Attributs;
// extents for Attributes;
if (vol.SmallNodeIDs.IsEmpty() ||
vol.SmallNodeIDs.Back() != id)
{
Expand Down Expand Up @@ -3365,7 +3365,7 @@ HRESULT CVol::FillRefs()
CRef &ref = Refs[item.RefIndex];

/*
// it's optional check that parent_id is set correclty
// it's optional check that parent_id is set correctly
if (IsViDef(ref.NodeIndex))
{
const CNode &node = Nodes[ref.NodeIndex];
Expand All @@ -3377,7 +3377,7 @@ HRESULT CVol::FillRefs()
/*
if (id == ROOT_DIR_INO_NUM)
{
// ItemIndex in Node for ROOT_DIR_INO_NUM was not set bofere
// ItemIndex in Node for ROOT_DIR_INO_NUM was not set before
// probably unused now.
ref.ParentRefIndex = VI_MINUS1;
}
Expand Down
2 changes: 1 addition & 1 deletion CPP/7zip/Archive/Base64Handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ API_FUNC_static_IsArc IsArc_Base64(const Byte *p, size_t size)
}

{
// we try to redece false positive detection here.
// we try to reduce false positive detection here.
// we don't expect space character in starting base64 line
const unsigned kNumExpectedNonSpaceSyms = 20;
if (firstSpace != 0 && firstSpace < num && firstSpace < kNumExpectedNonSpaceSyms)
Expand Down
Loading