1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2024-12-21 15:22:37 +00:00

chore: misc formatting updates and fixes (#7049)

* chore: remove redundant `.clang-format` entry for `TR_DEFINE_QUARK`

Left-over from bf41e1487a.

* chore: remove redundant `.clang-format` entry for `API_HEADER_*`

Left-over from f7edcfcb2a.

* chore: drop deprecated options in favour of `PackConstructorInitializers`

* fix: invalid `SpacesInAngles` value

* chore: add comment to forecast a change we need to make in the future

* chore: add trailing comma to prettify lambda
This commit is contained in:
Yat Ho 2024-08-13 07:44:39 +08:00 committed by GitHub
parent 3e9f5f614a
commit 120b2fb6a0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 14 deletions

View file

@ -35,7 +35,7 @@ ReflowComments: false
SortIncludes: Never
SpaceAfterCStyleCast: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInAngles: Never
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
@ -46,24 +46,18 @@ Language: Cpp
Standard: c++17
AccessModifierOffset: -4
AllowAllConstructorInitializersOnNextLine: false
PackConstructorInitializers: Never
AlwaysBreakAfterReturnType: None
AlwaysBreakTemplateDeclarations: Yes
BreakConstructorInitializers: BeforeComma
BreakInheritanceList: BeforeComma
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
FixNamespaceComments: true
IndentGotoLabels: false
KeepEmptyLinesAtTheStartOfBlocks: false
QualifierAlignment: Right
SortUsingDeclarations: true
SortUsingDeclarations: true # Since clang-format 16, the equivalent value is LexicographicNumeric
SpaceAfterTemplateKeyword: false
StatementMacros:
- TR_DEFINE_QUARK
WhitespaceSensitiveMacros:
- API_HEADER
- API_HEADER_CRYPT
---
Language: ObjC

View file

@ -512,11 +512,10 @@ private:
fmt::arg("error_code", static_cast<int>(rc))));
return {};
}
auto const info_uniq = std::unique_ptr<addrinfo, void (*)(addrinfo*)>{ info,
[](addrinfo* p) // MSVC forced my hands
{
freeaddrinfo(p);
} };
auto const info_uniq = std::unique_ptr<addrinfo, void (*)(addrinfo*)>{
info,
[](addrinfo* p) { freeaddrinfo(p); }, // MSVC forced me to write this lambda wrapper
};
// N.B. getaddrinfo() will return IPv4-mapped addresses by default on macOS
auto socket_address = tr_socket_address::from_sockaddr(info->ai_addr);