Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 716ab5614f | |||
| e017aeca0b | |||
| 42a1567b32 |
@@ -1,92 +0,0 @@
|
||||
# reHDD Code Style - clang-format configuration
|
||||
# Based on analyzed codebase formatting
|
||||
|
||||
BasedOnStyle: LLVM
|
||||
|
||||
# Indentation
|
||||
IndentWidth: 4
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
||||
ContinuationIndentWidth: 4
|
||||
|
||||
# Braces
|
||||
BreakBeforeBraces: Allman
|
||||
# Allman style:
|
||||
# if (condition)
|
||||
# {
|
||||
# statement;
|
||||
# }
|
||||
|
||||
# Spacing
|
||||
SpaceAfterCStyleCast: false
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceInEmptyParentheses: false
|
||||
SpacesInContainerLiterals: false
|
||||
SpacesInCStyleCastParentheses: false
|
||||
SpacesInParentheses: false
|
||||
SpacesInSquareBrackets: false
|
||||
|
||||
# Alignment
|
||||
AlignAfterOpenBracket: Align
|
||||
AlignConsecutiveAssignments: false
|
||||
AlignConsecutiveDeclarations: false
|
||||
AlignEscapedNewlines: Left
|
||||
AlignOperands: true
|
||||
AlignTrailingComments: false
|
||||
|
||||
# Line breaks
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
AllowShortFunctionsOnASingleLine: None
|
||||
AllowShortIfStatementsOnASingleLine: Never
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
AlwaysBreakAfterReturnType: None
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
AlwaysBreakTemplateDeclarations: Yes
|
||||
|
||||
# Column limit
|
||||
ColumnLimit: 0
|
||||
# 0 = no limit (observed in the code)
|
||||
|
||||
# Breaking
|
||||
BinPackArguments: true
|
||||
BinPackParameters: true
|
||||
BreakBeforeBinaryOperators: None
|
||||
BreakBeforeTernaryOperators: true
|
||||
BreakConstructorInitializers: BeforeColon
|
||||
BreakInheritanceList: BeforeColon
|
||||
BreakStringLiterals: false
|
||||
|
||||
# Pointers and references
|
||||
PointerAlignment: Left
|
||||
# Type *variable (not Type* variable)
|
||||
|
||||
# Include sorting
|
||||
SortIncludes: false
|
||||
# Keep includes in original order
|
||||
|
||||
# Comments
|
||||
ReflowComments: false
|
||||
# Don't reformat comments
|
||||
|
||||
# Access modifiers
|
||||
AccessModifierOffset: -4
|
||||
# public: is outdented
|
||||
|
||||
# Constructor initializers
|
||||
ConstructorInitializerIndentWidth: 6
|
||||
# Observed 6 spaces for initializer lists
|
||||
|
||||
# Other
|
||||
Cpp11BracedListStyle: true
|
||||
FixNamespaceComments: true
|
||||
IncludeBlocks: Preserve
|
||||
IndentCaseLabels: false
|
||||
IndentPPDirectives: None
|
||||
KeepEmptyLinesAtTheStartOfBlocks: false
|
||||
MaxEmptyLinesToKeep: 1
|
||||
NamespaceIndentation: None
|
||||
PenaltyBreakBeforeFirstCallParameter: 100
|
||||
PenaltyBreakComment: 300
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyExcessCharacter: 1000000
|
||||
+7
-2
@@ -229,7 +229,8 @@ int Shred::shredDrive(Drive* drive, int* ipSignalFd)
|
||||
#endif
|
||||
|
||||
#ifndef DRYRUN
|
||||
const char* cpDrivePath = drive->getPath().c_str();
|
||||
string sDrivePath = drive->getPath();
|
||||
const char *cpDrivePath = sDrivePath.c_str();
|
||||
unsigned char ucKey[TFNG_KEY_SIZE];
|
||||
|
||||
#ifdef ADAPTIVE_CHUNK_SIZE
|
||||
@@ -454,8 +455,10 @@ int Shred::shredDrive(Drive* drive, int* ipSignalFd)
|
||||
|
||||
if ((d32Percent - d32TmpPercent) >= 0.01)
|
||||
{
|
||||
// set shred percentage
|
||||
drive->setTaskPercentage(d32TmpPercent);
|
||||
d32TmpPercent = d32Percent;
|
||||
// signal process in shredding
|
||||
write(*ipSignalFd, "A", 1);
|
||||
}
|
||||
|
||||
@@ -562,7 +565,7 @@ double Shred::calcProgress()
|
||||
unsigned int uiMaxShredIteration = SHRED_ITERATIONS;
|
||||
|
||||
#ifdef ZERO_CHECK
|
||||
uiMaxShredIteration++;
|
||||
uiMaxShredIteration++; // increment because we will check after SHRED_ITERATIONS the drive for non-zero bytes
|
||||
#endif
|
||||
|
||||
if (this->ulDriveByteSize == 0)
|
||||
@@ -640,6 +643,8 @@ unsigned int Shred::uiCalcChecksum(fileDescriptor file, Drive* drive, int* ipSig
|
||||
unsigned int uiChecksum = 0;
|
||||
unsigned long ulDriveByteCounter = 0U;
|
||||
|
||||
Logger::logThis()->info("Check-Task: Starting checksum verification - Drive: " + drive->getSerial());
|
||||
|
||||
#ifdef ADAPTIVE_CHUNK_SIZE
|
||||
size_t checkChunkSize = CHUNK_SIZE_MAX;
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user