From ed6d1ec059f95e4deb0fca4fde55b57b0c17eb15 Mon Sep 17 00:00:00 2001 From: Tomasz Szumski Date: Thu, 21 Nov 2024 09:05:26 +0000 Subject: [PATCH] Adjust clang-format and apply it to st2110 files Signed-off-by: Tomasz Szumski --- .clang-format | 6 +++++- media-proxy/include/mesh/st2110.h | 9 +++------ media-proxy/include/mesh/st2110rx.h | 18 ++++++------------ media-proxy/include/mesh/st2110tx.h | 18 ++++++------------ media-proxy/src/mesh/st2110.cc | 6 ++---- media-proxy/src/mesh/st2110_20rx.cc | 6 ++---- media-proxy/src/mesh/st2110_20tx.cc | 6 ++---- media-proxy/src/mesh/st2110_22rx.cc | 6 ++---- media-proxy/src/mesh/st2110_22tx.cc | 6 ++---- media-proxy/src/mesh/st2110_30rx.cc | 6 ++---- media-proxy/src/mesh/st2110_30tx.cc | 6 ++---- media-proxy/tests/st2110_tests.cc | 12 ++++-------- 12 files changed, 38 insertions(+), 67 deletions(-) diff --git a/.clang-format b/.clang-format index 331acefc..46a72ccb 100644 --- a/.clang-format +++ b/.clang-format @@ -3,7 +3,11 @@ BasedOnStyle: LLVM IndentWidth: 4 UseTab: Never ColumnLimit: 100 -BreakBeforeBraces: Linux +BreakBeforeBraces: Custom +BraceWrapping: + AfterClass: false + AfterNamespace: false + AfterFunction: true AllowShortIfStatementsOnASingleLine: false AllowShortEnumsOnASingleLine: false IndentCaseLabels: false diff --git a/media-proxy/include/mesh/st2110.h b/media-proxy/include/mesh/st2110.h index b65342d3..4165a465 100644 --- a/media-proxy/include/mesh/st2110.h +++ b/media-proxy/include/mesh/st2110.h @@ -11,11 +11,9 @@ #include "mesh_dp.h" #include "logger.h" -namespace mesh -{ +namespace mesh { -namespace connection -{ +namespace connection { #define ST_APP_PAYLOAD_TYPE_ST30 (111) #define ST_APP_PAYLOAD_TYPE_ST20 (112) @@ -27,8 +25,7 @@ namespace connection * Base abstract class of ST2110. ST2110Rx/ST2110Tx * inherit this class. */ -class ST2110 : public Connection -{ +class ST2110 : public Connection { public: static st_frame_fmt mesh_video_format_to_st_format(int fmt); static st30_fmt mesh_audio_format_to_st_format(int fmt); diff --git a/media-proxy/include/mesh/st2110rx.h b/media-proxy/include/mesh/st2110rx.h index 23a37399..1503cb4b 100644 --- a/media-proxy/include/mesh/st2110rx.h +++ b/media-proxy/include/mesh/st2110rx.h @@ -3,11 +3,9 @@ #include "st2110.h" -namespace mesh -{ +namespace mesh { -namespace connection -{ +namespace connection { /** * ST2110Rx @@ -15,8 +13,7 @@ namespace connection * Base abstract class of ST2110Rx. ST2110_20Rx/ST2110_22Rx/ST2110_30Rx * inherit this class. */ -template class ST2110Rx : public ST2110 -{ +template class ST2110Rx : public ST2110 { public: ST2110Rx() { @@ -105,8 +102,7 @@ template class ST2110Rx : public } }; -class ST2110_20Rx : public ST2110Rx -{ +class ST2110_20Rx : public ST2110Rx { public: ST2110_20Rx(); ~ST2110_20Rx(); @@ -117,8 +113,7 @@ class ST2110_20Rx : public ST2110Rx private: }; -class ST2110_22Rx : public ST2110Rx -{ +class ST2110_22Rx : public ST2110Rx { public: ST2110_22Rx(); ~ST2110_22Rx(); @@ -129,8 +124,7 @@ class ST2110_22Rx : public ST2110Rx private: }; -class ST2110_30Rx : public ST2110Rx -{ +class ST2110_30Rx : public ST2110Rx { public: ST2110_30Rx(); ~ST2110_30Rx(); diff --git a/media-proxy/include/mesh/st2110tx.h b/media-proxy/include/mesh/st2110tx.h index 6cd45747..4950457a 100644 --- a/media-proxy/include/mesh/st2110tx.h +++ b/media-proxy/include/mesh/st2110tx.h @@ -4,11 +4,9 @@ #include "st2110.h" #include -namespace mesh -{ +namespace mesh { -namespace connection -{ +namespace connection { /** * ST2110 @@ -16,8 +14,7 @@ namespace connection * Base abstract class of ST2110. ST2110_20Tx/ST2110_22Tx/ST2110_30Tx * inherit this class. */ -template class ST2110Tx : public ST2110 -{ +template class ST2110Tx : public ST2110 { public: ST2110Tx() { @@ -103,8 +100,7 @@ template class ST2110Tx : public private: }; -class ST2110_20Tx : public ST2110Tx -{ +class ST2110_20Tx : public ST2110Tx { public: ST2110_20Tx(); ~ST2110_20Tx(); @@ -115,8 +111,7 @@ class ST2110_20Tx : public ST2110Tx private: }; -class ST2110_22Tx : public ST2110Tx -{ +class ST2110_22Tx : public ST2110Tx { public: ST2110_22Tx(); ~ST2110_22Tx(); @@ -127,8 +122,7 @@ class ST2110_22Tx : public ST2110Tx private: }; -class ST2110_30Tx : public ST2110Tx -{ +class ST2110_30Tx : public ST2110Tx { public: ST2110_30Tx(); ~ST2110_30Tx(); diff --git a/media-proxy/src/mesh/st2110.cc b/media-proxy/src/mesh/st2110.cc index 3795dbb3..3eaac36c 100644 --- a/media-proxy/src/mesh/st2110.cc +++ b/media-proxy/src/mesh/st2110.cc @@ -1,10 +1,8 @@ #include "st2110.h" -namespace mesh -{ +namespace mesh { -namespace connection -{ +namespace connection { st_frame_fmt ST2110::mesh_video_format_to_st_format(int fmt) { diff --git a/media-proxy/src/mesh/st2110_20rx.cc b/media-proxy/src/mesh/st2110_20rx.cc index 7b8722b3..53e85731 100644 --- a/media-proxy/src/mesh/st2110_20rx.cc +++ b/media-proxy/src/mesh/st2110_20rx.cc @@ -1,10 +1,8 @@ #include "st2110rx.h" -namespace mesh -{ +namespace mesh { -namespace connection -{ +namespace connection { ST2110_20Rx::ST2110_20Rx() { diff --git a/media-proxy/src/mesh/st2110_20tx.cc b/media-proxy/src/mesh/st2110_20tx.cc index 988116d2..87e16a19 100644 --- a/media-proxy/src/mesh/st2110_20tx.cc +++ b/media-proxy/src/mesh/st2110_20tx.cc @@ -1,10 +1,8 @@ #include "st2110tx.h" -namespace mesh -{ +namespace mesh { -namespace connection -{ +namespace connection { ST2110_20Tx::ST2110_20Tx() { diff --git a/media-proxy/src/mesh/st2110_22rx.cc b/media-proxy/src/mesh/st2110_22rx.cc index 829b9bc9..40f4b2d7 100644 --- a/media-proxy/src/mesh/st2110_22rx.cc +++ b/media-proxy/src/mesh/st2110_22rx.cc @@ -1,10 +1,8 @@ #include "st2110rx.h" -namespace mesh -{ +namespace mesh { -namespace connection -{ +namespace connection { ST2110_22Rx::ST2110_22Rx() { diff --git a/media-proxy/src/mesh/st2110_22tx.cc b/media-proxy/src/mesh/st2110_22tx.cc index 85cf27e4..5bab24e9 100644 --- a/media-proxy/src/mesh/st2110_22tx.cc +++ b/media-proxy/src/mesh/st2110_22tx.cc @@ -1,10 +1,8 @@ #include "st2110tx.h" -namespace mesh -{ +namespace mesh { -namespace connection -{ +namespace connection { ST2110_22Tx::ST2110_22Tx() { diff --git a/media-proxy/src/mesh/st2110_30rx.cc b/media-proxy/src/mesh/st2110_30rx.cc index f84e53a8..3be6954d 100644 --- a/media-proxy/src/mesh/st2110_30rx.cc +++ b/media-proxy/src/mesh/st2110_30rx.cc @@ -1,10 +1,8 @@ #include "st2110rx.h" -namespace mesh -{ +namespace mesh { -namespace connection -{ +namespace connection { ST2110_30Rx::ST2110_30Rx() { diff --git a/media-proxy/src/mesh/st2110_30tx.cc b/media-proxy/src/mesh/st2110_30tx.cc index 2c765b2a..2ce6caa2 100644 --- a/media-proxy/src/mesh/st2110_30tx.cc +++ b/media-proxy/src/mesh/st2110_30tx.cc @@ -1,10 +1,8 @@ #include "st2110tx.h" -namespace mesh -{ +namespace mesh { -namespace connection -{ +namespace connection { ST2110_30Tx::ST2110_30Tx() { diff --git a/media-proxy/tests/st2110_tests.cc b/media-proxy/tests/st2110_tests.cc index abe10a13..c316ba8a 100644 --- a/media-proxy/tests/st2110_tests.cc +++ b/media-proxy/tests/st2110_tests.cc @@ -43,8 +43,7 @@ struct wrapper { uint32_t wrapper::received_packets_dummy1; uint32_t wrapper::received_packets_dummy2; -class EmulatedTransmitter : public connection::Connection -{ +class EmulatedTransmitter : public connection::Connection { public: EmulatedTransmitter(context::Context &ctx) { @@ -66,8 +65,7 @@ class EmulatedTransmitter : public connection::Connection } }; -class EmulatedReceiver : public connection::Connection -{ +class EmulatedReceiver : public connection::Connection { public: uint32_t received_packets_lossless; uint32_t received_packets_lossy; @@ -98,8 +96,7 @@ class EmulatedReceiver : public connection::Connection } }; -class EmulatedST2110_Tx : public connection::ST2110Tx -{ +class EmulatedST2110_Tx : public connection::ST2110Tx { public: EmulatedST2110_Tx() { @@ -118,8 +115,7 @@ class EmulatedST2110_Tx : public connection::ST2110Tx } }; -class EmulatedST2110_Rx : public connection::ST2110Rx -{ +class EmulatedST2110_Rx : public connection::ST2110Rx { public: EmulatedST2110_Rx() {