Skip to content

Commit 075c792

Browse files
clang-format: re-format for clang-18
clang-format-18 isn't compatible with the clang-format-17 output, so we need to reformat the code with the latest version. The way clang-18 handles lambda formatting also changed, so we have made changes to the organization default style format to better handle lambda formatting. See I5e08687e696dd240402a2780158664b7113def0e for updated style. See Iea0776aaa7edd483fa395e23de25ebf5a6288f71 for clang-18 enablement. Change-Id: I21d2ca8065f24fd73509229c517f5caf48934b60 Signed-off-by: Patrick Williams <[email protected]>
1 parent 80b80ac commit 075c792

Some content is hidden

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

61 files changed

+660
-675
lines changed

.clang-format

+4-3
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ IndentWidth: 4
8787
IndentWrappedFunctionNames: true
8888
InsertNewlineAtEOF: true
8989
KeepEmptyLinesAtTheStartOfBlocks: false
90-
LambdaBodyIndentation: OuterScope
90+
LambdaBodyIndentation: Signature
9191
LineEnding: LF
9292
MacroBlockBegin: ''
9393
MacroBlockEnd: ''
@@ -98,13 +98,14 @@ ObjCSpaceAfterProperty: false
9898
ObjCSpaceBeforeProtocolList: true
9999
PackConstructorInitializers: BinPack
100100
PenaltyBreakAssignment: 25
101-
PenaltyBreakBeforeFirstCallParameter: 19
101+
PenaltyBreakBeforeFirstCallParameter: 50
102102
PenaltyBreakComment: 300
103103
PenaltyBreakFirstLessLess: 120
104104
PenaltyBreakString: 1000
105+
PenaltyBreakTemplateDeclaration: 10
105106
PenaltyExcessCharacter: 1000000
106107
PenaltyReturnTypeOnItsOwnLine: 60
107-
PenaltyIndentedWhitespace: 0
108+
PenaltyIndentedWhitespace: 1
108109
PointerAlignment: Left
109110
QualifierAlignment: Left
110111
ReferenceAlignment: Left

elog_block.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ class Block : public BlockIface
4343
Block(sdbusplus::bus_t& bus, const std::string& path, uint32_t entryId) :
4444
BlockIface(bus, path.c_str()), entryId(entryId)
4545
{
46-
std::string entryPath{std::string(OBJ_ENTRY) + '/' +
47-
std::to_string(entryId)};
48-
AssociationList assoc{std::make_tuple(std::string{"blocking_error"},
49-
std::string{"blocking_obj"},
50-
entryPath)};
46+
std::string entryPath{
47+
std::string(OBJ_ENTRY) + '/' + std::to_string(entryId)};
48+
AssociationList assoc{
49+
std::make_tuple(std::string{"blocking_error"},
50+
std::string{"blocking_obj"}, entryPath)};
5151
associations(std::move(assoc));
5252
};
5353

elog_entry.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,8 @@ class Entry : public EntryIfaces
7979
associations(std::move(objects), true);
8080
// Store a copy of associations in case we need to recreate
8181
assocs = associations();
82-
sdbusplus::server::xyz::openbmc_project::logging::Entry::resolved(false,
83-
true);
82+
sdbusplus::server::xyz::openbmc_project::logging::Entry::resolved(
83+
false, true);
8484

8585
version(fwVersion, true);
8686
purpose(VersionPurpose::BMC, true);

elog_meta.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ void build<
4949
auto iter = metadata.find(match);
5050
if (metadata.end() != iter)
5151
{
52-
list.emplace_back(std::make_tuple(CALLOUT_FWD_ASSOCIATION,
53-
CALLOUT_REV_ASSOCIATION,
54-
std::string(iter->second.c_str())));
52+
list.emplace_back(
53+
std::make_tuple(CALLOUT_FWD_ASSOCIATION, CALLOUT_REV_ASSOCIATION,
54+
std::string(iter->second.c_str())));
5555
}
5656
}
5757

elog_meta.hpp

+7-9
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,16 @@ void build(const std::string& match, const std::vector<std::string>& data,
8181
// for this metadata.
8282
using namespace example::xyz::openbmc_project::example::elog;
8383
template <>
84-
inline void
85-
build<TestErrorTwo::DEV_ID>(const std::string& /*match*/,
86-
const std::vector<std::string>& /*data*/,
87-
AssociationList& /*list*/)
84+
inline void build<TestErrorTwo::DEV_ID>(
85+
const std::string& /*match*/, const std::vector<std::string>& /*data*/,
86+
AssociationList& /*list*/)
8887
{}
8988

9089
template <>
91-
inline void
92-
build<example::xyz::openbmc_project::example::device::Callout::
93-
CALLOUT_DEVICE_PATH_TEST>(const std::string& match,
94-
const std::vector<std::string>& data,
95-
AssociationList& list)
90+
inline void build<example::xyz::openbmc_project::example::device::Callout::
91+
CALLOUT_DEVICE_PATH_TEST>(
92+
const std::string& match, const std::vector<std::string>& data,
93+
AssociationList& list)
9694
{
9795
std::map<std::string, std::string> metadata;
9896
parse(data, metadata);

elog_serialize.hpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ bool deserialize(const fs::path& path, Entry& e);
3838
* be placed.
3939
* @return fs::path - pathname of persisted error file
4040
*/
41-
fs::path
42-
getEntrySerializePath(uint32_t id,
43-
const fs::path& dir = fs::path(ERRLOG_PERSIST_PATH));
41+
fs::path getEntrySerializePath(
42+
uint32_t id, const fs::path& dir = fs::path(ERRLOG_PERSIST_PATH));
4443

4544
} // namespace logging
4645
} // namespace phosphor

extensions/openpower-pels/bcd_time.hpp

+2-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,8 @@ struct BCDTime
3030
BCDTime(uint8_t yearMSB, uint8_t yearLSB, uint8_t month, uint8_t day,
3131
uint8_t hour, uint8_t minutes, uint8_t seconds,
3232
uint8_t hundredths) :
33-
yearMSB(yearMSB),
34-
yearLSB(yearLSB), month(month), day(day), hour(hour), minutes(minutes),
35-
seconds(seconds), hundredths(hundredths)
33+
yearMSB(yearMSB), yearLSB(yearLSB), month(month), day(day), hour(hour),
34+
minutes(minutes), seconds(seconds), hundredths(hundredths)
3635
{}
3736

3837
bool operator==(const BCDTime& right) const;

extensions/openpower-pels/callout.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ Callout::Callout(CalloutPriority priority, const std::string& locationCode,
9696

9797
setLocationCode(locationCode);
9898

99-
_fruIdentity = std::make_unique<FRUIdentity>(partNumber, ccin,
100-
serialNumber);
99+
_fruIdentity =
100+
std::make_unique<FRUIdentity>(partNumber, ccin, serialNumber);
101101

102102
if (!mrus.empty())
103103
{
@@ -132,8 +132,8 @@ Callout::Callout(CalloutPriority priority, const std::string& symbolicFRU,
132132

133133
setLocationCode(locationCode);
134134

135-
_fruIdentity = std::make_unique<FRUIdentity>(symbolicFRU, type,
136-
trustedLocationCode);
135+
_fruIdentity =
136+
std::make_unique<FRUIdentity>(symbolicFRU, type, trustedLocationCode);
137137

138138
_size = flattenedSize();
139139
}

extensions/openpower-pels/callouts.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,9 @@ void Callouts::addCallout(std::unique_ptr<Callout> callout)
5555
bool shouldAdd = true;
5656

5757
// Check if there is already a callout for this FRU
58-
auto it = std::ranges::find_if(
59-
_callouts, [&callout](const auto& c) { return *callout == *c; });
58+
auto it = std::ranges::find_if(_callouts, [&callout](const auto& c) {
59+
return *callout == *c;
60+
});
6061

6162
// If the callout already exists, but the new one has a higher
6263
// priority, change the existing callout's priority to this

0 commit comments

Comments
 (0)