Skip to content

Commit d844bce

Browse files
committed
Second pass for clang-format
1 parent 64c7994 commit d844bce

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2886
-2817
lines changed

src/BarInterfaceBase.cxx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,13 @@
1717
#include "BarInterfaceBase.h"
1818
#include "Utilities/SmartPointer.h"
1919

20-
namespace AliceO2 {
21-
namespace roc {
20+
namespace AliceO2
21+
{
22+
namespace roc
23+
{
2224

2325
BarInterfaceBase::BarInterfaceBase(const Parameters& parameters)
24-
: mBarIndex(parameters.getChannelNumberRequired())
26+
: mBarIndex(parameters.getChannelNumberRequired())
2527
{
2628
auto id = parameters.getCardIdRequired();
2729
if (auto serial = boost::get<int>(&id)) {
@@ -39,7 +41,6 @@ BarInterfaceBase::BarInterfaceBase(std::shared_ptr<Pda::PdaBar> bar)
3941
mPdaBar = std::move(bar);
4042
}
4143

42-
4344
BarInterfaceBase::~BarInterfaceBase()
4445
{
4546
}
@@ -64,8 +65,7 @@ void BarInterfaceBase::modifyRegister(int index, int position, int width, uint32
6465
void BarInterfaceBase::log(std::string logMessage, InfoLogger::InfoLogger::Severity logLevel)
6566
{
6667
mLogger << logLevel;
67-
mLogger << "[PCI ID: " << mRocPciDevice->getPciAddress().toString() << " | bar" << getIndex() << "] : " <<
68-
logMessage << InfoLogger::InfoLogger::endm;
68+
mLogger << "[PCI ID: " << mRocPciDevice->getPciAddress().toString() << " | bar" << getIndex() << "] : " << logMessage << InfoLogger::InfoLogger::endm;
6969
}
7070

7171
} // namespace roc

src/CardConfigurator.cxx

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88
#include "ReadoutCard/CardConfigurator.h"
99
#include "ReadoutCard/ChannelFactory.h"
1010

11-
namespace AliceO2 {
12-
namespace roc {
11+
namespace AliceO2
12+
{
13+
namespace roc
14+
{
1315

1416
CardConfigurator::CardConfigurator(Parameters::CardIdType cardId, std::string pathToConfigFile, bool forceConfigure)
15-
{
17+
{
1618
auto parameters = Parameters::makeParameters(cardId, 2); //have to make parameters for this case, bar2
1719
try {
1820
parseConfigFile(pathToConfigFile, parameters);
@@ -38,7 +40,6 @@ CardConfigurator::CardConfigurator(Parameters& parameters, bool forceConfigure)
3840
}
3941
}
4042

41-
4243
/// pathToConfigFile: Has to start with "file:"
4344
void CardConfigurator::parseConfigFile(std::string pathToConfigFile, Parameters& parameters)
4445
{
@@ -56,7 +57,6 @@ void CardConfigurator::parseConfigFile(std::string pathToConfigFile, Parameters&
5657
GbtMode::type gbtMode = GbtMode::type::Gbt;
5758
DownstreamData::type downstreamData = DownstreamData::type::Ctp;
5859

59-
6060
//Open the file
6161
try {
6262
if (!strncmp(pathToConfigFile.c_str(), "file:", 5)) {
@@ -70,52 +70,52 @@ void CardConfigurator::parseConfigFile(std::string pathToConfigFile, Parameters&
7070
}
7171

7272
//* Global *//
73-
for (auto globalGroup: ConfigFileBrowser(&configFile, "cru")) { //Is there another way to do this?
73+
for (auto globalGroup : ConfigFileBrowser(&configFile, "cru")) { //Is there another way to do this?
7474
std::string parsedString;
7575
try {
7676
parsedString = configFile.getValue<std::string>(globalGroup + ".clock");
7777
clock = Clock::fromString(parsedString);
78-
} catch(...) {
78+
} catch (...) {
7979
throw std::runtime_error("Invalid or missing clock property");
8080
}
8181

8282
try {
8383
parsedString = configFile.getValue<std::string>(globalGroup + ".datapathmode");
8484
datapathMode = DatapathMode::fromString(parsedString);
85-
} catch(...) {
85+
} catch (...) {
8686
throw std::runtime_error("Invalid or missing datapath mode property");
8787
}
8888

8989
try {
9090
parsedString = configFile.getValue<std::string>(globalGroup + ".gbtmode");
9191
gbtMode = GbtMode::fromString(parsedString);
92-
} catch(...) {
92+
} catch (...) {
9393
throw("Invalid or missing gbtmode property");
9494
}
9595

9696
try {
9797
parsedString = configFile.getValue<std::string>(globalGroup + ".downstreamdata");
9898
downstreamData = DownstreamData::fromString(parsedString);
99-
} catch(...) {
99+
} catch (...) {
100100
throw("Invalid or missing downstreamdata property");
101101
}
102102

103103
try {
104104
loopback = configFile.getValue<bool>(globalGroup + ".loopback");
105-
} catch(...) {
105+
} catch (...) {
106106
throw("Invalid or missing loopback property");
107107
}
108108

109109
try {
110110
ponUpstream = configFile.getValue<bool>(globalGroup + ".ponupstream");
111-
} catch(...) {
111+
} catch (...) {
112112
throw("Invalid or missing ponupstream property");
113113
}
114114

115115
try {
116116
parsedString = configFile.getValue<std::string>(globalGroup + ".onuaddress");
117117
onuAddress = Hex::fromString(parsedString);
118-
} catch(...) {
118+
} catch (...) {
119119
throw("Invalid or missing onuAddress property");
120120
}
121121

@@ -128,7 +128,7 @@ void CardConfigurator::parseConfigFile(std::string pathToConfigFile, Parameters&
128128

129129
try {
130130
allowRejection = configFile.getValue<bool>(globalGroup + ".allowrejection");
131-
} catch(...) {
131+
} catch (...) {
132132
throw("Invalid or missing allowrejection property");
133133
}
134134
}
@@ -144,7 +144,7 @@ void CardConfigurator::parseConfigFile(std::string pathToConfigFile, Parameters&
144144
parameters.setAllowRejection(allowRejection);
145145

146146
//* Per link *//
147-
for (auto configGroup: ConfigFileBrowser(&configFile, "link")) {
147+
for (auto configGroup : ConfigFileBrowser(&configFile, "link")) {
148148

149149
bool enabled = false;
150150
std::string gbtMux;
@@ -154,8 +154,8 @@ void CardConfigurator::parseConfigFile(std::string pathToConfigFile, Parameters&
154154
try {
155155
enabled = configFile.getValue<bool>(configGroup + ".enabled");
156156
if (enabled) {
157-
for (int i=0; i<24; i++) {
158-
linkMask.insert((uint32_t) i);
157+
for (int i = 0; i < 24; i++) {
158+
linkMask.insert((uint32_t)i);
159159
}
160160
}
161161
} catch (...) {
@@ -164,18 +164,18 @@ void CardConfigurator::parseConfigFile(std::string pathToConfigFile, Parameters&
164164

165165
try {
166166
gbtMux = configFile.getValue<std::string>(configGroup + ".gbtmux");
167-
for (int i=0; i<24; i++) {
168-
gbtMuxMap.insert(std::make_pair((uint32_t) i, GbtMux::fromString(gbtMux)));
167+
for (int i = 0; i < 24; i++) {
168+
gbtMuxMap.insert(std::make_pair((uint32_t)i, GbtMux::fromString(gbtMux)));
169169
}
170-
} catch(...) {
170+
} catch (...) {
171171
throw("Invalid or missing gbt mux property for all links");
172172
}
173173
continue;
174174
}
175175

176176
/* configure for individual links */
177177
std::string linkIndexString = configGroup.substr(configGroup.find("k") + 1);
178-
uint32_t linkIndex = std::stoul(linkIndexString, NULL, 10);
178+
uint32_t linkIndex = std::stoul(linkIndexString, NULL, 10);
179179

180180
try {
181181
enabled = configFile.getValue<bool>(configGroup + ".enabled");
@@ -184,7 +184,7 @@ void CardConfigurator::parseConfigFile(std::string pathToConfigFile, Parameters&
184184
} else {
185185
linkMask.erase(linkIndex);
186186
}
187-
} catch(...) {
187+
} catch (...) {
188188
throw("Invalid or missing enabled property for link: " + linkIndexString);
189189
}
190190

@@ -195,7 +195,7 @@ void CardConfigurator::parseConfigFile(std::string pathToConfigFile, Parameters&
195195
} else {
196196
gbtMuxMap.insert(std::make_pair(linkIndex, GbtMux::fromString(gbtMux)));
197197
}
198-
} catch(...) {
198+
} catch (...) {
199199
throw("Invalid or missing gbt mux set for link: " + linkIndexString);
200200
}
201201
}

src/CardType.cxx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,19 @@
1616
#include "ReadoutCard/CardType.h"
1717
#include "Utilities/Enum.h"
1818

19-
namespace AliceO2 {
20-
namespace roc {
21-
namespace {
19+
namespace AliceO2
20+
{
21+
namespace roc
22+
{
23+
namespace
24+
{
2225

2326
static const auto converter = Utilities::makeEnumConverter<CardType::type>("CardType", {
24-
{ CardType::Unknown, "UNKNOWN" },
25-
{ CardType::Crorc, "CRORC" },
26-
{ CardType::Cru, "CRU" },
27-
{ CardType::Dummy, "DUMMY" },
28-
});
27+
{ CardType::Unknown, "UNKNOWN" },
28+
{ CardType::Crorc, "CRORC" },
29+
{ CardType::Cru, "CRU" },
30+
{ CardType::Dummy, "DUMMY" },
31+
});
2932

3033
} // Anonymous namespace
3134

src/ChannelPaths.cxx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,15 @@
1818

1919
namespace b = boost;
2020

21-
namespace AliceO2 {
22-
namespace roc {
23-
namespace {
21+
namespace AliceO2
22+
{
23+
namespace roc
24+
{
25+
namespace
26+
{
2427
static const char* DIR_SHAREDMEM = "/dev/shm/";
2528
static const char* FORMAT = "%s/AliceO2_RoC_%s_Channel_%i%s";
26-
}
29+
} // namespace
2730

2831
ChannelPaths::ChannelPaths(PciAddress pciAddress, int channel) : mPciAddress(pciAddress), mChannel(channel)
2932
{

src/CommandLineUtilities/Common.cxx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@
1818
#include <iomanip>
1919
#include <bitset>
2020

21-
namespace AliceO2 {
22-
namespace roc {
23-
namespace CommandLineUtilities {
24-
namespace Common {
21+
namespace AliceO2
22+
{
23+
namespace roc
24+
{
25+
namespace CommandLineUtilities
26+
{
27+
namespace Common
28+
{
2529

2630
using std::cout;
2731
using std::endl;
@@ -43,7 +47,7 @@ std::string make32hexString(uint32_t bits)
4347
{
4448
std::ostringstream oss;
4549
oss << std::hex << std::setw(4) << std::setfill('0') << uint16_t(bits >> 16)
46-
<< "." << std::hex << std::setw(4) << std::setfill('0') << uint16_t(bits);
50+
<< "." << std::hex << std::setw(4) << std::setfill('0') << uint16_t(bits);
4751
return oss.str();
4852
}
4953

@@ -58,9 +62,9 @@ std::string makeRegisterString(int address, uint32_t value)
5862
{
5963
std::ostringstream oss;
6064
oss << " 0x" << makeRegisterAddressString(address)
61-
<< " => 0x" << make32hexString(value)
62-
<< " = 0b" << make32bitString(value)
63-
<< " = " << value;
65+
<< " => 0x" << make32hexString(value)
66+
<< " = 0b" << make32bitString(value)
67+
<< " = " << value;
6468
return oss.str();
6569
}
6670

0 commit comments

Comments
 (0)