From 867edcf019d0d81f44dad1833d0e59c22666acfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Mon, 13 May 2024 14:03:21 +0200 Subject: [PATCH] clang-format: adjust constructor initializer style --- .clang-format | 1 + source/AdapterIO.cpp | 12 ++++++++++-- source/HttpUtils.cpp | 6 +++++- source/RadioApp.cpp | 6 +++++- source/RadioSettings.cpp | 11 ++++++++--- source/StationFinder.cpp | 14 +++++++++++--- source/StationFinderRadioNetwork.cpp | 10 ++++++++-- source/StationListView.cpp | 9 +++++++-- source/StationPanel.cpp | 4 +++- source/StreamIO.h | 4 +++- 10 files changed, 61 insertions(+), 16 deletions(-) diff --git a/.clang-format b/.clang-format index a36c471..36f63b7 100644 --- a/.clang-format +++ b/.clang-format @@ -17,4 +17,5 @@ BreakBeforeBraces: Custom AllowShortEnumsOnASingleLine: false SeparateDefinitionBlocks: Leave MaxEmptyLinesToKeep: 2 +PackConstructorInitializers: Never diff --git a/source/AdapterIO.cpp b/source/AdapterIO.cpp index 24838cf..866934f 100644 --- a/source/AdapterIO.cpp +++ b/source/AdapterIO.cpp @@ -204,7 +204,12 @@ class RelativePositionIO : public BPositionIO { BAdapterIO::BAdapterIO(int32 flags, bigtime_t timeout) - : fFlags(flags), fBuffer(NULL), fTotalSize(0), fOpened(false), fSeekSem(-1), fInputAdapter(NULL) + : fFlags(flags), + fBuffer(NULL), + fTotalSize(0), + fOpened(false), + fSeekSem(-1), + fInputAdapter(NULL) { CALLED(); @@ -433,7 +438,10 @@ BAdapterIO::_EvaluateWait(off_t pos, off_t size) } -BInputAdapter::BInputAdapter(BAdapterIO* io) : fIO(io) {} +BInputAdapter::BInputAdapter(BAdapterIO* io) + : fIO(io) +{ +} BInputAdapter::~BInputAdapter() {} diff --git a/source/HttpUtils.cpp b/source/HttpUtils.cpp index 39dd1f4..c359959 100644 --- a/source/HttpUtils.cpp +++ b/source/HttpUtils.cpp @@ -28,7 +28,11 @@ class DataLimit : public BUrlProtocolListener, public BDataIO { public: - DataLimit(BDataIO* sink, size_t limit) : fSink(sink), fLimit(limit) {} + DataLimit(BDataIO* sink, size_t limit) + : fSink(sink), + fLimit(limit) + { + } ssize_t Write(const void* buffer, size_t size) override { diff --git a/source/RadioApp.cpp b/source/RadioApp.cpp index 460145e..9951305 100644 --- a/source/RadioApp.cpp +++ b/source/RadioApp.cpp @@ -29,7 +29,11 @@ #define B_TRANSLATION_CONTEXT "RadioApp" -RadioApp::RadioApp() : BApplication(kAppSignature), fArgvMessage(NULL) {} +RadioApp::RadioApp() + : BApplication(kAppSignature), + fArgvMessage(NULL) +{ +} RadioApp::~RadioApp() {} diff --git a/source/RadioSettings.cpp b/source/RadioSettings.cpp index cd33084..72d571c 100644 --- a/source/RadioSettings.cpp +++ b/source/RadioSettings.cpp @@ -28,7 +28,10 @@ const char* kSettingsFileName = "StreamRadio.settings"; -StationsList::StationsList() : BObjectList() {} +StationsList::StationsList() + : BObjectList() +{ +} StationsList::~StationsList() @@ -113,14 +116,16 @@ StationsList::Save() } -RadioSettings::RadioSettings() : BMessage() +RadioSettings::RadioSettings() + : BMessage() { Stations = new StationsList(); _Load(); } -RadioSettings::RadioSettings(const RadioSettings& orig) : BMessage(orig) +RadioSettings::RadioSettings(const RadioSettings& orig) + : BMessage(orig) { Stations = new StationsList(); Stations->AddList(orig.Stations); diff --git a/source/StationFinder.cpp b/source/StationFinder.cpp index b5b58b4..9f56d4d 100644 --- a/source/StationFinder.cpp +++ b/source/StationFinder.cpp @@ -60,11 +60,16 @@ StationFinderServices::Name(int i) } -FindByCapability::FindByCapability(char* name) : fName(name), fKeywords() {} +FindByCapability::FindByCapability(char* name) + : fName(name), + fKeywords() +{ +} FindByCapability::FindByCapability(char* name, char* keyWords, char* delimiter) - : fName(name), fKeywords() + : fName(name), + fKeywords() { SetKeyWords(keyWords, delimiter); } @@ -106,7 +111,10 @@ FindByCapability::SetKeyWords(char* keyWords, char* delimiter) StationFinderService::StationFinderService() - : serviceName("unknown"), serviceHomePage(""), serviceLogo(NULL), findByCapabilities(5, true) + : serviceName("unknown"), + serviceHomePage(""), + serviceLogo(NULL), + findByCapabilities(5, true) { } diff --git a/source/StationFinderRadioNetwork.cpp b/source/StationFinderRadioNetwork.cpp index 183eaca..4774b11 100644 --- a/source/StationFinderRadioNetwork.cpp +++ b/source/StationFinderRadioNetwork.cpp @@ -38,11 +38,17 @@ const char* StationFinderRadioNetwork::kBaseUrl = "https://all.api.radio-browser BString StationFinderRadioNetwork::sCachedServerUrl = B_EMPTY_STRING; -IconLookup::IconLookup(Station* station, BUrl iconUrl) : fStation(station), fIconUrl(iconUrl) {} +IconLookup::IconLookup(Station* station, BUrl iconUrl) + : fStation(station), + fIconUrl(iconUrl) +{ +} StationFinderRadioNetwork::StationFinderRadioNetwork() - : StationFinderService(), fIconLookupThread(-1), fIconLookupList(100, true) + : StationFinderService(), + fIconLookupThread(-1), + fIconLookupList(100, true) { serviceName.SetTo(B_TRANSLATE("Community Radio Browser")); serviceHomePage.SetUrlString("https://www.radio-browser.info"); diff --git a/source/StationListView.cpp b/source/StationListView.cpp index 003f5ee..244abb6 100644 --- a/source/StationListView.cpp +++ b/source/StationListView.cpp @@ -35,7 +35,10 @@ StationListViewItem::StationListViewItem(Station* station) - : BListItem(0, true), fPlayer(NULL), fStation(station), fList(NULL) + : BListItem(0, true), + fPlayer(NULL), + fStation(station), + fList(NULL) { SetHeight(SLV_HEIGHT); } @@ -181,7 +184,9 @@ StationListViewItem::SetFillRatio(float fillRatio) StationListView::StationListView(bool canPlay) - : BListView("Stations", B_SINGLE_SELECTION_LIST), fPlayMsg(NULL), fCanPlay(canPlay) + : BListView("Stations", B_SINGLE_SELECTION_LIST), + fPlayMsg(NULL), + fCanPlay(canPlay) { SetResizingMode(B_FOLLOW_ALL_SIDES); SetExplicitMinSize(BSize(300, 2 * SLV_HEIGHT)); diff --git a/source/StationPanel.cpp b/source/StationPanel.cpp index ddaac44..63ed65f 100644 --- a/source/StationPanel.cpp +++ b/source/StationPanel.cpp @@ -34,7 +34,9 @@ StationPanel::StationPanel(MainWindow* mainWindow, bool expanded) - : BView("stationpanel", B_WILL_DRAW), fStationItem(NULL), fMainWindow(mainWindow) + : BView("stationpanel", B_WILL_DRAW), + fStationItem(NULL), + fMainWindow(mainWindow) { SetResizingMode(B_FOLLOW_LEFT_RIGHT | B_FOLLOW_BOTTOM); SetExplicitAlignment(BAlignment(B_ALIGN_USE_FULL_WIDTH, B_ALIGN_VERTICAL_UNSET)); diff --git a/source/StreamIO.h b/source/StreamIO.h index 23bb17e..6b696e5 100644 --- a/source/StreamIO.h +++ b/source/StreamIO.h @@ -40,7 +40,9 @@ typedef ssize_t (StreamIO::*DataFunc)(const char* data, size_t size, int next); class DataFuncs { public: - DataFuncs() : fSize(10), fLast(-1) + DataFuncs() + : fSize(10), + fLast(-1) { for (int i = 0; i < fSize; i++) fFuncs[i] = NULL;