mirror of
https://github.com/transmission/transmission
synced 2025-01-30 10:52:00 +00:00
Use clang-format for qualifier alignment (#5845)
`QualifierAlignment` option is available since clang-format v14 and works better than our own script.
This commit is contained in:
parent
84f9d01e7d
commit
c14094f4c9
6 changed files with 6 additions and 20 deletions
|
@ -56,6 +56,7 @@ ConstructorInitializerIndentWidth: 4
|
|||
FixNamespaceComments: true
|
||||
IndentGotoLabels: false
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
QualifierAlignment: Right
|
||||
SortUsingDeclarations: true
|
||||
SpaceAfterTemplateKeyword: false
|
||||
StatementMacros:
|
||||
|
@ -71,3 +72,4 @@ ObjCBlockIndentWidth: 4
|
|||
ObjCBreakBeforeNestedBlockParam: false
|
||||
ObjCSpaceBeforeProtocolList: false
|
||||
PenaltyExcessCharacter: 1
|
||||
QualifierAlignment: Right
|
||||
|
|
|
@ -65,22 +65,6 @@ if ! find_cfiles -exec "${clang_format_exe}" $clang_format_args '{}' '+'; then
|
|||
exitcode=1
|
||||
fi
|
||||
|
||||
# enforce east const
|
||||
# look for 'const'
|
||||
# - as the first token in the line
|
||||
# - or preceded by 'static'
|
||||
# - or following any of (<,;
|
||||
# - but not if 'const' is followed by ` override` (const virtual function)
|
||||
# - but not if 'const' is followed by ` = 0` (const virtual function)
|
||||
matches="$(find_cfiles -exec perl -ne 'print "west const:",$ARGV,":",$_ if /((?:^|[(<,;]|\bstatic\s+)\s*)\b(const)\b(?!\s+((\w+\s*\[)|(override)|(\=\ 0)))/' '{}' '+')"
|
||||
if [ -n "$matches" ]; then
|
||||
echo "$matches"
|
||||
exitcode=1
|
||||
fi
|
||||
if [ -n "$fix" ]; then
|
||||
find_cfiles -exec perl -pi -e 's/((?:^|[(<,;]|\bstatic\s+)\s*)\b(const)\b(?!\s+((\w+\s*\[)|(override)|(\=\ 0)))/\1>\2</g' '{}' '+'
|
||||
fi
|
||||
|
||||
# format JS
|
||||
# but only if js has changed
|
||||
git diff --cached --quiet -- "web/**" && exit $exitcode
|
||||
|
|
|
@ -75,7 +75,7 @@ public:
|
|||
return ::dht_search(id, port, af, callback, closure);
|
||||
}
|
||||
|
||||
virtual int init(int s, int s6, unsigned const char* id, unsigned const char* v)
|
||||
virtual int init(int s, int s6, unsigned char const* id, unsigned char const* v)
|
||||
{
|
||||
return ::dht_init(s, s6, id, v);
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ private:
|
|||
|
||||
public:
|
||||
using value_type = Char;
|
||||
using const_reference = const Char&;
|
||||
using const_reference = Char const&;
|
||||
|
||||
tr_strbuf()
|
||||
{
|
||||
|
|
|
@ -509,7 +509,7 @@ bool trashDataFile(char const* filename, void* /*user_data*/, tr_error** error)
|
|||
return;
|
||||
}
|
||||
|
||||
volatile int status;
|
||||
int volatile status;
|
||||
tr_torrentSetLocation(self.fHandle, folder.UTF8String, YES, NULL, &status);
|
||||
|
||||
while (status == TR_LOC_MOVING) //block while moving (for now)
|
||||
|
|
|
@ -209,7 +209,7 @@ protected:
|
|||
return 0;
|
||||
}
|
||||
|
||||
int init(int dht_socket, int dht_socket6, unsigned const char* id, unsigned const char* /*v*/) override
|
||||
int init(int dht_socket, int dht_socket6, unsigned char const* id, unsigned char const* /*v*/) override
|
||||
{
|
||||
inited_ = true;
|
||||
dht_socket_ = dht_socket;
|
||||
|
|
Loading…
Reference in a new issue