Skip to content

Commit d481d2c

Browse files
committed
[NFC] clang-format white space
1 parent 197d3ba commit d481d2c

File tree

18 files changed

+176
-203
lines changed

18 files changed

+176
-203
lines changed

core/clingutils/res/TClingUtils.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -568,13 +568,11 @@ void WriteClassInit(std::ostream& finalString,
568568
bool& needCollectionProxy);
569569

570570
//______________________________________________________________________________
571-
void WriteStandaloneReadRules(std::ostream &finalString, bool rawrules,
572-
std::vector<std::string> &standaloneTargets,
571+
void WriteStandaloneReadRules(std::ostream &finalString, bool rawrules, std::vector<std::string> &standaloneTargets,
573572
const cling::Interpreter &interp);
574573

575574
//______________________________________________________________________________
576-
void WriteRulesRegistration(std::ostream &finalString,
577-
const std::string &dictName,
575+
void WriteRulesRegistration(std::ostream &finalString, const std::string &dictName,
578576
const std::vector<std::string> &standaloneTargets);
579577

580578
//______________________________________________________________________________

core/clingutils/src/TClingUtils.cxx

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1823,7 +1823,7 @@ void ROOT::TMetaUtils::WriteClassInit(std::ostream& finalString,
18231823
int i = 0;
18241824
finalString << "\n // Schema evolution read functions\n";
18251825
std::list<ROOT::SchemaRuleMap_t>::iterator rIt = rulesIt1->second.fRules.begin();
1826-
while( rIt != rulesIt1->second.fRules.end() ) {
1826+
while (rIt != rulesIt1->second.fRules.end()) {
18271827

18281828
//--------------------------------------------------------------------
18291829
// Check if the rules refer to valid data members
@@ -1858,7 +1858,7 @@ void ROOT::TMetaUtils::WriteClassInit(std::ostream& finalString,
18581858
int i = 0;
18591859
finalString << "\n // Schema evolution read raw functions\n";
18601860
std::list<ROOT::SchemaRuleMap_t>::iterator rIt = rulesIt2->second.fRules.begin();
1861-
while( rIt != rulesIt2->second.fRules.end() ) {
1861+
while (rIt != rulesIt2->second.fRules.end()) {
18621862

18631863
//--------------------------------------------------------------------
18641864
// Check if the rules refer to valid data members
@@ -2052,14 +2052,14 @@ void ROOT::TMetaUtils::WriteClassInit(std::ostream& finalString,
20522052

20532053
if( rulesIt1 != ROOT::gReadRules.end() ) {
20542054
finalString << "\n" << " // the io read rules" << "\n" << " std::vector<::ROOT::Internal::TSchemaHelper> readrules(" << rulesIt1->second.size() << ");" << "\n";
2055-
ROOT::WriteSchemaList( rulesIt1->second.fRules, "readrules", finalString );
2055+
ROOT::WriteSchemaList(rulesIt1->second.fRules, "readrules", finalString);
20562056
finalString << " instance.SetReadRules( readrules );" << "\n";
20572057
rulesIt1->second.fGenerated = true;
20582058
}
20592059

20602060
if( rulesIt2 != ROOT::gReadRawRules.end() ) {
20612061
finalString << "\n" << " // the io read raw rules" << "\n" << " std::vector<::ROOT::Internal::TSchemaHelper> readrawrules(" << rulesIt2->second.size() << ");" << "\n";
2062-
ROOT::WriteSchemaList( rulesIt2->second.fRules, "readrawrules", finalString );
2062+
ROOT::WriteSchemaList(rulesIt2->second.fRules, "readrawrules", finalString);
20632063
finalString << " instance.SetReadRawRules( readrawrules );" << "\n";
20642064
rulesIt2->second.fGenerated = true;
20652065
}
@@ -2193,19 +2193,17 @@ void ROOT::TMetaUtils::WriteClassInit(std::ostream& finalString,
21932193

21942194
void ROOT::TMetaUtils::WriteStandaloneReadRules(std::ostream &finalString, bool rawrules,
21952195
std::vector<std::string> &standaloneTargets,
2196-
const cling::Interpreter& interp)
2196+
const cling::Interpreter &interp)
21972197
{
2198-
for (auto &rulesIt1 : rawrules? ROOT::gReadRawRules : ROOT::gReadRules) {
2198+
for (auto &rulesIt1 : rawrules ? ROOT::gReadRawRules : ROOT::gReadRules) {
21992199
if (!rulesIt1.second.fGenerated) {
22002200
const clang::Type *typeptr = nullptr;
2201-
const clang::CXXRecordDecl *target
2202-
= ROOT::TMetaUtils::ScopeSearch(rulesIt1.first.c_str(), interp,
2203-
true /*diag*/, &typeptr);
2204-
2201+
const clang::CXXRecordDecl *target =
2202+
ROOT::TMetaUtils::ScopeSearch(rulesIt1.first.c_str(), interp, true /*diag*/, &typeptr);
22052203

22062204
if (!target && !rulesIt1.second.fTargetDecl) {
22072205
ROOT::TMetaUtils::Warning(nullptr, "%d Rule(s) for target class %s was not used!\n", rulesIt1.second.size(),
2208-
rulesIt1.first.c_str());
2206+
rulesIt1.first.c_str());
22092207
continue;
22102208
}
22112209

@@ -2256,8 +2254,7 @@ void ROOT::TMetaUtils::WriteStandaloneReadRules(std::ostream &finalString, bool
22562254
}
22572255
}
22582256

2259-
void ROOT::TMetaUtils::WriteRulesRegistration(std::ostream &finalString,
2260-
const std::string &dictName,
2257+
void ROOT::TMetaUtils::WriteRulesRegistration(std::ostream &finalString, const std::string &dictName,
22612258
const std::vector<std::string> &standaloneTargets)
22622259
{
22632260
std::string functionname("RecordReadRules_");
@@ -2267,35 +2264,39 @@ void ROOT::TMetaUtils::WriteRulesRegistration(std::ostream &finalString,
22672264
finalString << " // Registration Schema evolution read functions\n";
22682265
finalString << " int " << functionname << "() {" << "\n";
22692266
if (!standaloneTargets.empty())
2270-
finalString << "\n" << " ::ROOT::Internal::TSchemaHelper* rule;" << "\n";
2271-
for (const auto &target : standaloneTargets)
2272-
{
2267+
finalString << "\n"
2268+
<< " ::ROOT::Internal::TSchemaHelper* rule;" << "\n";
2269+
for (const auto &target : standaloneTargets) {
22732270
std::string name;
22742271
TClassEdit::GetNormalizedName(name, target);
22752272

2276-
ROOT::SchemaRuleClassMap_t::iterator rulesIt1 = ROOT::gReadRules.find( target.c_str() );
2273+
ROOT::SchemaRuleClassMap_t::iterator rulesIt1 = ROOT::gReadRules.find(target.c_str());
22772274
finalString << " {\n";
22782275
if (rulesIt1 != ROOT::gReadRules.end()) {
22792276
finalString << " // the io read rules for " << target << "\n";
2280-
finalString << " std::vector<::ROOT::Internal::TSchemaHelper> readrules(" << rulesIt1->second.size() << ");" << "\n";
2281-
ROOT::WriteSchemaList( rulesIt1->second.fRules, "readrules", finalString );
2282-
finalString << " TClass::RegisterReadRules(TSchemaRule::kReadRule, \"" << name << "\", std::move(readrules));\n";
2277+
finalString << " std::vector<::ROOT::Internal::TSchemaHelper> readrules(" << rulesIt1->second.size()
2278+
<< ");" << "\n";
2279+
ROOT::WriteSchemaList(rulesIt1->second.fRules, "readrules", finalString);
2280+
finalString << " TClass::RegisterReadRules(TSchemaRule::kReadRule, \"" << name
2281+
<< "\", std::move(readrules));\n";
22832282
rulesIt1->second.fGenerated = true;
22842283
}
2285-
ROOT::SchemaRuleClassMap_t::iterator rulesIt2 = ROOT::gReadRawRules.find( target.c_str() );
2284+
ROOT::SchemaRuleClassMap_t::iterator rulesIt2 = ROOT::gReadRawRules.find(target.c_str());
22862285
if (rulesIt2 != ROOT::gReadRawRules.end()) {
22872286
finalString << "\n // the io read raw rules for " << target << "\n";
2288-
finalString << " std::vector<::ROOT::Internal::TSchemaHelper> readrawrules(" << rulesIt2->second.size() << ");" << "\n";
2289-
ROOT::WriteSchemaList( rulesIt2->second.fRules, "readrawrules", finalString );
2290-
finalString << " TClass::RegisterReadRules(TSchemaRule::kReadRawRule, \"" << name << "\", std::move(readrawrules));\n";
2287+
finalString << " std::vector<::ROOT::Internal::TSchemaHelper> readrawrules(" << rulesIt2->second.size()
2288+
<< ");" << "\n";
2289+
ROOT::WriteSchemaList(rulesIt2->second.fRules, "readrawrules", finalString);
2290+
finalString << " TClass::RegisterReadRules(TSchemaRule::kReadRawRule, \"" << name
2291+
<< "\", std::move(readrawrules));\n";
22912292
rulesIt2->second.fGenerated = true;
22922293
}
22932294
finalString << " }\n";
22942295
}
22952296
finalString << " return 0;\n";
22962297
finalString << " }\n";
22972298
finalString << " static int _R__UNIQUE_DICT_(ReadRules_" << dictName << ") = " << functionname << "();";
2298-
finalString<< "R__UseDummy(_R__UNIQUE_DICT_(ReadRules_" << dictName << "));" << "\n";
2299+
finalString << "R__UseDummy(_R__UNIQUE_DICT_(ReadRules_" << dictName << "));" << "\n";
22992300
finalString << "} // namespace ROOT" << "\n";
23002301
}
23012302

core/dictgen/src/rootcling_impl.cxx

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2649,15 +2649,9 @@ int FinalizeStreamerInfoWriting(cling::Interpreter &interp, bool writeEmptyRootP
26492649

26502650
////////////////////////////////////////////////////////////////////////////////
26512651

2652-
int GenerateFullDict(std::ostream &dictStream,
2653-
std::string dictName,
2654-
cling::Interpreter &interp,
2655-
RScanner &scan,
2656-
const ROOT::TMetaUtils::RConstructorTypes &ctorTypes,
2657-
bool isSplit,
2658-
bool isGenreflex,
2659-
bool isSelXML,
2660-
bool writeEmptyRootPCM)
2652+
int GenerateFullDict(std::ostream &dictStream, std::string dictName, cling::Interpreter &interp, RScanner &scan,
2653+
const ROOT::TMetaUtils::RConstructorTypes &ctorTypes, bool isSplit, bool isGenreflex,
2654+
bool isSelXML, bool writeEmptyRootPCM)
26612655
{
26622656
ROOT::TMetaUtils::TNormalizedCtxt normCtxt(interp.getLookupHelper());
26632657

@@ -4967,15 +4961,8 @@ int RootClingMain(int argc,
49674961
rootclingRetCode += FinalizeStreamerInfoWriting(interp);
49684962
}
49694963
} else {
4970-
rootclingRetCode += GenerateFullDict(*splitDictStream,
4971-
modGen.GetDictionaryName(),
4972-
interp,
4973-
scan,
4974-
constructorTypes,
4975-
gOptSplit,
4976-
isGenreflex,
4977-
isSelXML,
4978-
gOptWriteEmptyRootPCM);
4964+
rootclingRetCode += GenerateFullDict(*splitDictStream, modGen.GetDictionaryName(), interp, scan, constructorTypes,
4965+
gOptSplit, isGenreflex, isSelXML, gOptWriteEmptyRootPCM);
49794966
}
49804967

49814968
if (rootclingRetCode != 0) {

core/foundation/res/RConversionRuleParser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#include "DllImport.h"
1616

1717
namespace clang {
18-
class CXXRecordDecl;
18+
class CXXRecordDecl;
1919
}
2020

2121
namespace ROOT

core/foundation/src/RConversionRuleParser.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ namespace ROOT
864864
//////////////////////////////////////////////////////////////////////////
865865

866866
for( it = gReadRules.begin(); it != gReadRules.end(); ++it ) {
867-
for( rule = it->second.fRules.begin(); rule != it->second.fRules.end(); ++rule ) {
867+
for (rule = it->second.fRules.begin(); rule != it->second.fRules.end(); ++rule) {
868868
attr = rule->find( "include" );
869869
if( attr == rule->end() ) continue;
870870
TSchemaRuleProcessor::SplitList( attr->second, tmp );
@@ -877,7 +877,7 @@ namespace ROOT
877877
//////////////////////////////////////////////////////////////////////////
878878

879879
for( it = gReadRawRules.begin(); it != gReadRawRules.end(); ++it ) {
880-
for( rule = it->second.fRules.begin(); rule != it->second.fRules.end(); ++rule ) {
880+
for (rule = it->second.fRules.begin(); rule != it->second.fRules.end(); ++rule) {
881881
attr = rule->find( "include" );
882882
if( attr == rule->end() ) continue;
883883
TSchemaRuleProcessor::SplitList( attr->second, tmp );
@@ -926,7 +926,7 @@ namespace ROOT
926926
gReadRules[normalizedTargetName].fRules = lst;
927927
}
928928
else
929-
it->second.fRules.push_back( rule );
929+
it->second.fRules.push_back(rule);
930930
}
931931

932932
/////////////////////////////////////////////////////////////////////////////
@@ -961,7 +961,7 @@ namespace ROOT
961961
gReadRawRules[normalizedTargetName].fRules = lst;
962962
}
963963
else
964-
it->second.fRules.push_back( rule );
964+
it->second.fRules.push_back(rule);
965965
}
966966

967967

core/meta/inc/TClass.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,8 @@ friend class TStreamerInfo;
545545
Long_t Property() const override;
546546
Int_t ReadBuffer(TBuffer &b, void *pointer, Int_t version, UInt_t start, UInt_t count);
547547
Int_t ReadBuffer(TBuffer &b, void *pointer);
548-
static void RegisterReadRules(ROOT::TSchemaRule::RuleType_t, const char *classname, std::vector<::ROOT::Internal::TSchemaHelper> &&rules);
548+
static void RegisterReadRules(ROOT::TSchemaRule::RuleType_t, const char *classname,
549+
std::vector<::ROOT::Internal::TSchemaHelper> &&rules);
549550
void RegisterStreamerInfo(TVirtualStreamerInfo *info);
550551
void RemoveStreamerInfo(Int_t slot);
551552
void ReplaceWith(TClass *newcl) const;

core/meta/inc/TSchemaRule.h

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ class TVirtualObject;
1515
class TObjArray;
1616
namespace ROOT {
1717
namespace Internal {
18-
struct TSchemaHelper;
19-
}
18+
struct TSchemaHelper;
2019
}
20+
} // namespace ROOT
2121

2222
namespace ROOT {
2323

@@ -47,17 +47,14 @@ namespace ROOT {
4747

4848
Int_t GetPointerLevel() const { return fPointerLevel; }
4949

50-
const char* GetUnderlyingTypeName() const
51-
{
52-
return fTitle;
53-
}
50+
const char* GetUnderlyingTypeName() const { return fTitle; }
5451

5552
// The source can be declared with:
5653
// "%s %s%s;", GetTypeForDeclaration().Data(), GetName(), GetDimensions);
5754
TString GetTypeForDeclaration()
5855
{
5956
TString type = fTitle;
60-
for(Int_t s = 0; s < fPointerLevel; ++s)
57+
for (Int_t s = 0; s < fPointerLevel; ++s)
6158
type.Append('*');
6259
return type;
6360
}
@@ -81,7 +78,7 @@ namespace ROOT {
8178
typedef void (*ReadRawFuncPtr_t)( char*, TBuffer&);
8279

8380
TSchemaRule();
84-
TSchemaRule(RuleType_t type, const char *targetClass, const ROOT::Internal::TSchemaHelper& helper);
81+
TSchemaRule(RuleType_t type, const char *targetClass, const ROOT::Internal::TSchemaHelper &helper);
8582
virtual ~TSchemaRule();
8683

8784
TSchemaRule( const TSchemaRule& rhs );

core/meta/src/TClass.cxx

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1719,17 +1719,19 @@ void TClass::Init(const char *name, Version_t cversion,
17191719
// std::pairs have implicit conversions
17201720
GetSchemaRules(kTRUE);
17211721
}
1722-
for(auto ruletype : {ROOT::TSchemaRule::kReadRule, ROOT::TSchemaRule::kReadRawRule}) {
1722+
for (auto ruletype : {ROOT::TSchemaRule::kReadRule, ROOT::TSchemaRule::kReadRawRule}) {
17231723
auto &registry = GetReadRulesRegistry(ruletype);
17241724
auto rulesiter = registry.find(GetName());
17251725
if (rulesiter != registry.end()) {
1726-
auto rset = GetSchemaRules( kTRUE );
1727-
for(const auto &helper : rulesiter->second) {
1726+
auto rset = GetSchemaRules(kTRUE);
1727+
for (const auto &helper : rulesiter->second) {
17281728
auto rule = new ROOT::TSchemaRule(ruletype, GetName(), helper);
17291729
TString errmsg;
1730-
if( !rset->AddRule( rule, ROOT::Detail::TSchemaRuleSet::kCheckAll, &errmsg ) ) {
1731-
Warning( "Init", "The rule for class: \"%s\": version, \"%s\" and data members: \"%s\" has been skipped because %s.",
1732-
GetName(), helper.fVersion.c_str(), helper.fTarget.c_str(), errmsg.Data() );
1730+
if (!rset->AddRule(rule, ROOT::Detail::TSchemaRuleSet::kCheckAll, &errmsg)) {
1731+
Warning(
1732+
"Init",
1733+
"The rule for class: \"%s\": version, \"%s\" and data members: \"%s\" has been skipped because %s.",
1734+
GetName(), helper.fVersion.c_str(), helper.fTarget.c_str(), errmsg.Data());
17331735
delete rule;
17341736
}
17351737
}
@@ -3624,16 +3626,16 @@ TRealData* TClass::GetRealData(const char* name) const
36243626
// Try ignoring the array dimensions.
36253627
std::string::size_type firstBracket = givenName.find_first_of("[");
36263628
std::string nameNoDim(givenName.substr(0, firstBracket));
3627-
TObjLink* lnk = fRealData->FirstLink();
3629+
TObjLink *lnk = fRealData->FirstLink();
36283630
while (lnk) {
3629-
TObject* obj = lnk->GetObject();
3631+
TObject *obj = lnk->GetObject();
36303632
std::string objName(obj->GetName());
36313633
std::string::size_type pos = objName.find_first_of("[");
36323634
if (pos != std::string::npos) {
36333635
objName.erase(pos);
36343636
}
36353637
if (objName == nameNoDim) {
3636-
return static_cast<TRealData*>(obj);
3638+
return static_cast<TRealData *>(obj);
36373639
}
36383640
lnk = lnk->Next();
36393641
}
@@ -6918,10 +6920,10 @@ void TClass::StreamerTObject(const TClass* pThis, void *object, TBuffer &b, cons
69186920
////////////////////////////////////////////////////////////////////////////////
69196921
/// Case of TObjects when fIsOffsetStreamerSet is known to have been set.
69206922

6921-
void TClass::StreamerTObjectInitialized(const TClass* pThis, void *object, TBuffer &b, const TClass *onfile_class)
6923+
void TClass::StreamerTObjectInitialized(const TClass *pThis, void *object, TBuffer &b, const TClass *onfile_class)
69226924
{
69236925
if (R__likely(onfile_class == nullptr || pThis == onfile_class)) {
6924-
TObject *tobj = (TObject*)((Longptr_t)object + pThis->fOffsetStreamer);
6926+
TObject *tobj = (TObject *)((Longptr_t)object + pThis->fOffsetStreamer);
69256927
tobj->Streamer(b);
69266928
} else {
69276929
// This is the case where we are reading an object of a derived class
@@ -7409,20 +7411,22 @@ TVirtualStreamerInfo *TClass::FindConversionStreamerInfo( const TClass* cl, UInt
74097411
/// Rules will end up here if they are created in a dictionary file that does not
74107412
/// contain the dictionary for the target class.
74117413

7412-
void TClass::RegisterReadRules(ROOT::TSchemaRule::RuleType_t type,
7413-
const char *classname, std::vector<::ROOT::Internal::TSchemaHelper> &&rules)
7414+
void TClass::RegisterReadRules(ROOT::TSchemaRule::RuleType_t type, const char *classname,
7415+
std::vector<::ROOT::Internal::TSchemaHelper> &&rules)
74147416
{
74157417
R__WRITE_LOCKGUARD(ROOT::gCoreMutex);
74167418

74177419
auto cl = TClass::GetClass(classname, false, false);
74187420
if (cl) {
7419-
auto rset = cl->GetSchemaRules( kTRUE );
7420-
for(const auto &it : rules) {
7421+
auto rset = cl->GetSchemaRules(kTRUE);
7422+
for (const auto &it : rules) {
74217423
auto rule = new ROOT::TSchemaRule(type, cl->GetName(), it);
74227424
TString errmsg;
7423-
if( !rset->AddRule( rule, ROOT::Detail::TSchemaRuleSet::kCheckAll, &errmsg ) ) {
7424-
::Warning( "TGenericClassInfo", "The rule for class: \"%s\": version, \"%s\" and data members: \"%s\" has been skipped because %s.",
7425-
cl->GetName(), it.fVersion.c_str(), it.fTarget.c_str(), errmsg.Data() );
7425+
if (!rset->AddRule(rule, ROOT::Detail::TSchemaRuleSet::kCheckAll, &errmsg)) {
7426+
::Warning(
7427+
"TGenericClassInfo",
7428+
"The rule for class: \"%s\": version, \"%s\" and data members: \"%s\" has been skipped because %s.",
7429+
cl->GetName(), it.fVersion.c_str(), it.fTarget.c_str(), errmsg.Data());
74267430
delete rule;
74277431
}
74287432
}

core/meta/src/TGenericClassInfo.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ namespace Internal {
334334
rule = new TSchemaRule(ProcessReadRules ? TSchemaRule::kReadRule : TSchemaRule::kReadRawRule,
335335
fClass->GetName(), *it);
336336

337-
if( !rset->AddRule( rule, TSchemaRuleSet::kCheckAll, &errmsg ) ) {
337+
if (!rset->AddRule(rule, TSchemaRuleSet::kCheckAll, &errmsg)) {
338338
::Warning( "TGenericClassInfo", "The rule for class: \"%s\": version, \"%s\" and data members: \"%s\" has been skipped because %s.",
339339
GetClassName(), it->fVersion.c_str(), it->fTarget.c_str(), errmsg.Data() );
340340
delete rule;

0 commit comments

Comments
 (0)