clang-format: copy latest and re-format
clang-format-16 has some backwards incompatible changes that require
additional settings for best compatibility and re-running the formatter.
Copy the latest .clang-format from the docs repository and reformat the
repository.
Change-Id: I520ea7fb067992065539299a2e5dfa4ff28788ab
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/.clang-format b/.clang-format
index 79a474d..d92a3f1 100644
--- a/.clang-format
+++ b/.clang-format
@@ -6,12 +6,14 @@
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
-AlignOperands: true
-AlignTrailingComments: true
+AlignOperands: Align
+AlignTrailingComments:
+ Kind: Always
+ OverEmptyLines: 1
AllowAllParametersOfDeclarationOnNextLine: true
-AllowShortBlocksOnASingleLine: false
+AllowShortBlocksOnASingleLine: Empty
AllowShortCaseLabelsOnASingleLine: false
-AllowShortFunctionsOnASingleLine: None
+AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterReturnType: None
@@ -36,6 +38,7 @@
SplitEmptyFunction: false
SplitEmptyRecord: false
SplitEmptyNamespace: false
+BreakAfterAttributes: Never
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
@@ -75,9 +78,13 @@
- Regex: '.*'
Priority: 6
IndentCaseLabels: true
+IndentRequiresClause: true
IndentWidth: 4
IndentWrappedFunctionNames: true
+InsertNewlineAtEOF: true
KeepEmptyLinesAtTheStartOfBlocks: false
+LambdaBodyIndentation: OuterScope
+LineEnding: LF
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
@@ -85,13 +92,19 @@
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
+PenaltyBreakAssignment: 25
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
+PenaltyIndentedWhitespace: 0
+QualifierAlignment: Left
+ReferenceAlignment: Left
ReflowComments: true
+RequiresClausePosition: OwnLine
+RequiresExpressionIndentation: Keyword
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
@@ -111,6 +124,6 @@
SpacesInSquareBrackets: false
Standard: Latest
TabWidth: 4
-UseCRLF: false
UseTab: Never
...
+
diff --git a/ikvm_args.hpp b/ikvm_args.hpp
index 183bbfa..089c700 100644
--- a/ikvm_args.hpp
+++ b/ikvm_args.hpp
@@ -23,8 +23,7 @@
* @param[in] c - Number of arguments
* @param[in] v - Array of arguments
*/
- CommandLine(int c, char** v) : argc(c), argv(v)
- {}
+ CommandLine(int c, char** v) : argc(c), argv(v) {}
~CommandLine() = default;
CommandLine(const CommandLine&) = default;
CommandLine& operator=(const CommandLine&) = default;
diff --git a/ikvm_input.cpp b/ikvm_input.cpp
index b900740..c3930b5 100644
--- a/ikvm_input.cpp
+++ b/ikvm_input.cpp
@@ -105,8 +105,8 @@
if (!keyboardPath.empty())
{
- keyboardFd =
- open(keyboardPath.c_str(), O_RDWR | O_CLOEXEC | O_NONBLOCK);
+ keyboardFd = open(keyboardPath.c_str(),
+ O_RDWR | O_CLOEXEC | O_NONBLOCK);
if (keyboardFd < 0)
{
log<level::ERR>("Failed to open input device",
diff --git a/ikvm_server.cpp b/ikvm_server.cpp
index 9274a9b..6a6cd06 100644
--- a/ikvm_server.cpp
+++ b/ikvm_server.cpp
@@ -133,9 +133,9 @@
{
/* JFIF header contains some varying data so skip it for
* checksum calculation */
- frame_crc =
- boost::crc<32, 0x04C11DB7, 0xFFFFFFFF, 0xFFFFFFFF, true,
- true>(data + 0x30, video.getFrameSize() - 0x30);
+ frame_crc = boost::crc<32, 0x04C11DB7, 0xFFFFFFFF, 0xFFFFFFFF,
+ true, true>(data + 0x30,
+ video.getFrameSize() - 0x30);
}
if (cd->last_crc == frame_crc)
@@ -222,8 +222,8 @@
{
Server* server = (Server*)cl->screen->screenData;
- cl->clientData =
- new ClientData(server->video.getFrameRate(), &server->input);
+ cl->clientData = new ClientData(server->video.getFrameRate(),
+ &server->input);
cl->clientGoneHook = clientGone;
cl->clientFramebufferUpdateRequestHook = clientFramebufferUpdateRequest;
if (!server->numClients++)
diff --git a/ikvm_video.hpp b/ikvm_video.hpp
index 449f57e..15bbb0b 100644
--- a/ikvm_video.hpp
+++ b/ikvm_video.hpp
@@ -135,8 +135,7 @@
*/
struct Buffer
{
- Buffer() : data(nullptr), queued(false), payload(0), size(0)
- {}
+ Buffer() : data(nullptr), queued(false), payload(0), size(0) {}
~Buffer() = default;
Buffer(const Buffer&) = default;
Buffer& operator=(const Buffer&) = default;