From f548311c20291a37b53e8a2ee029ff4d8de6836c Mon Sep 17 00:00:00 2001 From: Philippe Canal <pcanal@fnal.gov> Date: Mon, 9 Oct 2017 17:55:06 -0500 Subject: [PATCH] Formatting [NFC] --- core/base/inc/Rtypes.h | 62 ++++----- core/base/inc/TObject.h | 8 +- core/base/inc/TParameter.h | 3 +- core/base/inc/TROOT.h | 3 +- core/base/src/TROOT.cxx | 3 +- core/clingutils/res/TClingUtils.h | 2 +- core/clingutils/src/TClingUtils.cxx | 20 +-- core/cont/inc/THashTable.h | 2 +- core/cont/src/TClassTable.cxx | 21 +-- core/cont/src/THashList.cxx | 6 +- core/foundation/src/TClassEdit.cxx | 6 +- core/meta/inc/TClass.h | 8 +- .../src/TCheckHashRecurveRemoveConsistency.h | 70 +++++----- core/meta/src/TClass.cxx | 42 +++--- core/meta/src/TGenericClassInfo.cxx | 7 +- core/meta/src/TViewPubDataMembers.h | 2 +- core/meta/src/TViewPubFunctions.h | 2 +- core/meta/test/testHashRecursiveRemove.cxx | 122 +++++++++--------- core/metacling/src/TCling.cxx | 23 ++-- core/metacling/src/TCling.h | 2 +- graf2d/graf/inc/TImagePlugin.h | 3 +- graf2d/win32gdk/inc/TGWin32InterpreterProxy.h | 5 +- .../win32gdk/src/TGWin32InterpreterProxy.cxx | 6 +- html/inc/TDocInfo.h | 5 +- roofit/roofitcore/src/RooLinkedList.cxx | 10 +- roofit/roofitcore/src/RooSetPair.cxx | 4 +- 26 files changed, 241 insertions(+), 206 deletions(-) diff --git a/core/base/inc/Rtypes.h b/core/base/inc/Rtypes.h index c1b20fd6cb2..627c922a2bf 100644 --- a/core/base/inc/Rtypes.h +++ b/core/base/inc/Rtypes.h @@ -280,31 +280,35 @@ class ClassDefGenerateInitInstanceLocalInjector: // Common part of ClassDef definition. // DeclFileLine() is not part of it since CINT uses that as trigger for // the class comment string. -#define _ClassDefBase_(name,id, virtual_keyword, overrd) \ -private: \ - virtual_keyword Bool_t CheckTObjectHashConsistency() const overrd { \ - static std::atomic<UChar_t> recurseBlocker(0); \ - if (R__likely(recurseBlocker >= 2)) { \ - return ::ROOT::Internal::THashConsistencyHolder<name>::fgHashConsistency; \ - } else if (recurseBlocker == 1) { \ - return false; \ - } else if (recurseBlocker++ == 0) { \ - ::ROOT::Internal::THashConsistencyHolder<name>::fgHashConsistency = \ - ::ROOT::Internal::HasConsistentHashMember(Class_Name()) \ - || ::ROOT::Internal::HasConsistentHashMember(*IsA()); \ - ++recurseBlocker; \ - return ::ROOT::Internal::THashConsistencyHolder<name>::fgHashConsistency; \ - } \ - return false; /* unreacheable */ \ - } \ -public: \ - static Version_t Class_Version() { return id; } \ - virtual_keyword TClass *IsA() const overrd { return name::Class(); } \ - virtual_keyword void ShowMembers(TMemberInspector&insp) const overrd { ::ROOT::Class_ShowMembers(name::Class(), this, insp); } \ - void StreamerNVirtual(TBuffer&ClassDef_StreamerNVirtual_b) { name::Streamer(ClassDef_StreamerNVirtual_b); } \ +#define _ClassDefBase_(name, id, virtual_keyword, overrd) \ +private: \ + virtual_keyword Bool_t CheckTObjectHashConsistency() const overrd \ + { \ + static std::atomic<UChar_t> recurseBlocker(0); \ + if (R__likely(recurseBlocker >= 2)) { \ + return ::ROOT::Internal::THashConsistencyHolder<name>::fgHashConsistency; \ + } else if (recurseBlocker == 1) { \ + return false; \ + } else if (recurseBlocker++ == 0) { \ + ::ROOT::Internal::THashConsistencyHolder<name>::fgHashConsistency = \ + ::ROOT::Internal::HasConsistentHashMember(Class_Name()) || \ + ::ROOT::Internal::HasConsistentHashMember(*IsA()); \ + ++recurseBlocker; \ + return ::ROOT::Internal::THashConsistencyHolder<name>::fgHashConsistency; \ + } \ + return false; /* unreacheable */ \ + } \ + \ +public: \ + static Version_t Class_Version() { return id; } \ + virtual_keyword TClass *IsA() const overrd { return name::Class(); } \ + virtual_keyword void ShowMembers(TMemberInspector &insp) const overrd \ + { \ + ::ROOT::Class_ShowMembers(name::Class(), this, insp); \ + } \ + void StreamerNVirtual(TBuffer &ClassDef_StreamerNVirtual_b) { name::Streamer(ClassDef_StreamerNVirtual_b); } \ static const char *DeclFileName() { return __FILE__; } - #define _ClassDefOutline_(name,id, virtual_keyword, overrd) \ _ClassDefBase_(name,id, virtual_keyword, overrd) \ private: \ @@ -408,13 +412,11 @@ public: \ #define ClassDefT2(name,Tmpl) - - -#define templateClassImpUnique(name,key) \ - namespace ROOT { \ - static TNamed *_R__UNIQUE_(_NAME2_(R__dummyholder,key)) = \ - ::ROOT::RegisterClassTemplate(_QUOTE_(name), __FILE__, __LINE__); \ - R__UseDummy(_R__UNIQUE_(_NAME2_(R__dummyholder,key))); \ +#define templateClassImpUnique(name, key) \ + namespace ROOT { \ + static TNamed * \ + _R__UNIQUE_(_NAME2_(R__dummyholder, key)) = ::ROOT::RegisterClassTemplate(_QUOTE_(name), __FILE__, __LINE__); \ + R__UseDummy(_R__UNIQUE_(_NAME2_(R__dummyholder, key))); \ } #define templateClassImp(name) templateClassImpUnique(name,default) diff --git a/core/base/inc/TObject.h b/core/base/inc/TObject.h index d6a8ff4a19a..d0ded6ddbf9 100644 --- a/core/base/inc/TObject.h +++ b/core/base/inc/TObject.h @@ -308,8 +308,9 @@ inline ULong_t TObject::CheckedHash() // we guess-estimate that the version recording-then-testing-prior-check would start // saving cpu cycle when each object is inserted in average 1.5 times in a THashList/THashTable. - //if ( !fBits & kCheckedHash) { - if ( !CheckTObjectHashConsistency() ) fBits |= kInconsistent; + // if ( !fBits & kCheckedHash) { + if (!CheckTObjectHashConsistency()) + fBits |= kInconsistent; // fBits &= kChecked; //} return Hash(); @@ -327,7 +328,8 @@ inline ULong_t TObject::CheckedHash() /// Hash will always yield a not-found answer (Since anyway no hash /// can be guaranteed unique, there is always a check) -inline Bool_t TObject::HasInconsistentHash() const { +inline Bool_t TObject::HasInconsistentHash() const +{ return fBits & kInconsistent; } diff --git a/core/base/inc/TParameter.h b/core/base/inc/TParameter.h index 6d19c22f571..fb8900a9bfb 100644 --- a/core/base/inc/TParameter.h +++ b/core/base/inc/TParameter.h @@ -59,7 +59,8 @@ public: : fName(name), fVal(val) { Reset(); SetBit(kIsConst);} TParameter(const char *name, const AParamType &val, char mergemode) : fName(name), fVal(val) { SetMergeMode(mergemode); SetBit(kIsConst);} - virtual ~TParameter() { + virtual ~TParameter() + { // Required since we overload TObject::Hash. ROOT::CallRecursiveRemoveIfNeeded(*this); } diff --git a/core/base/inc/TROOT.h b/core/base/inc/TROOT.h index 21cca44ebfd..6c104df845b 100644 --- a/core/base/inc/TROOT.h +++ b/core/base/inc/TROOT.h @@ -379,7 +379,8 @@ namespace ROOT { /// and obj.TestBit(kMustCleanup) is true. /// Note: this reset the kMustCleanup bit to allow /// harmless multiple call to this function. - inline void CallRecursiveRemoveIfNeeded(TObject &obj) { + inline void CallRecursiveRemoveIfNeeded(TObject &obj) + { if (obj.TestBit(kMustCleanup)) { TROOT *root = ROOT::Internal::gROOTLocal; if (root && root != &obj && root->MustClean()) { diff --git a/core/base/src/TROOT.cxx b/core/base/src/TROOT.cxx index 0527d9b77b2..9f473fbfd38 100644 --- a/core/base/src/TROOT.cxx +++ b/core/base/src/TROOT.cxx @@ -2007,7 +2007,8 @@ void TROOT::InitInterpreter() fgRootInit = kTRUE; // initialize gClassTable is not already done - if (!gClassTable) new TClassTable; + if (!gClassTable) + new TClassTable; // Initialize all registered dictionaries. for (std::vector<ModuleHeaderInfo_t>::const_iterator diff --git a/core/clingutils/res/TClingUtils.h b/core/clingutils/res/TClingUtils.h index a0616ae860f..1fa0a2b18fb 100644 --- a/core/clingutils/res/TClingUtils.h +++ b/core/clingutils/res/TClingUtils.h @@ -446,7 +446,7 @@ void WritePointersSTL(const AnnotatedRecordDecl &cl, const cling::Interpreter &i int GetClassVersion(const clang::RecordDecl *cl, const cling::Interpreter &interp); //______________________________________________________________________________ -std::pair<bool,int> GetTrivialIntegralReturnValue(const clang::FunctionDecl *funcCV, const cling::Interpreter &interp); +std::pair<bool, int> GetTrivialIntegralReturnValue(const clang::FunctionDecl *funcCV, const cling::Interpreter &interp); //______________________________________________________________________________ int IsSTLContainer(const AnnotatedRecordDecl &annotated); diff --git a/core/clingutils/src/TClingUtils.cxx b/core/clingutils/src/TClingUtils.cxx index 7d7622f8ecc..8dd6ed79da7 100644 --- a/core/clingutils/src/TClingUtils.cxx +++ b/core/clingutils/src/TClingUtils.cxx @@ -2489,22 +2489,25 @@ int ROOT::TMetaUtils::GetClassVersion(const clang::RecordDecl *cl, const cling:: /// is indeed a trivial function with just a return of a value. /// The second element contains the value (or -1 is case of failure) -std::pair<bool,int> ROOT::TMetaUtils::GetTrivialIntegralReturnValue(const clang::FunctionDecl *funcCV, const cling::Interpreter& interp) +std::pair<bool, int> +ROOT::TMetaUtils::GetTrivialIntegralReturnValue(const clang::FunctionDecl *funcCV, const cling::Interpreter &interp) { - using res_t = std::pair<bool,int>; + using res_t = std::pair<bool, int>; const clang::CompoundStmt* FuncBody = llvm::dyn_cast_or_null<clang::CompoundStmt>(funcCV->getBody()); - if (!FuncBody) return res_t{false,-1}; + if (!FuncBody) + return res_t{false, -1}; if (FuncBody->size() != 1) { // This is a non-ClassDef(), complex function - it might depend on state // and thus we'll need the runtime and cannot determine the result // statically. - return res_t{false,-1}; + return res_t{false, -1}; } const clang::ReturnStmt* RetStmt = llvm::dyn_cast<clang::ReturnStmt>(FuncBody->body_back()); - if (!RetStmt) return res_t{false,-1}; + if (!RetStmt) + return res_t{false, -1}; const clang::Expr* RetExpr = RetStmt->getRetValue(); // ClassDef controls the content of Class_Version() but not the return // expression which is CPP expanded from what the user provided as second @@ -2513,15 +2516,14 @@ std::pair<bool,int> ROOT::TMetaUtils::GetTrivialIntegralReturnValue(const clang: // Go through ICE to be more general. llvm::APSInt RetRes; if (!RetExpr->isIntegerConstantExpr(RetRes, funcCV->getASTContext())) - return res_t{false,-1}; + return res_t{false, -1}; if (RetRes.isSigned()) { - return res_t{true,(Version_t)RetRes.getSExtValue()}; + return res_t{true, (Version_t)RetRes.getSExtValue()}; } // else - return res_t{true,(Version_t)RetRes.getZExtValue()}; + return res_t{true, (Version_t)RetRes.getZExtValue()}; } - //////////////////////////////////////////////////////////////////////////////// /// Is this an STL container. diff --git a/core/cont/inc/THashTable.h b/core/cont/inc/THashTable.h index f291dd280bb..90ba80614ee 100644 --- a/core/cont/inc/THashTable.h +++ b/core/cont/inc/THashTable.h @@ -87,7 +87,7 @@ inline Float_t THashTable::AverageCollisions() const inline Int_t THashTable::GetCheckedHashValue(TObject *obj) const { - Int_t i = Int_t(obj->CheckedHash() % fSize); // need intermediary i for Linux g++ + Int_t i = Int_t(obj->CheckedHash() % fSize); // need intermediary i for Linux g++ return i; } diff --git a/core/cont/src/TClassTable.cxx b/core/cont/src/TClassTable.cxx index a9c06c16fd2..a29a6e3f560 100644 --- a/core/cont/src/TClassTable.cxx +++ b/core/cont/src/TClassTable.cxx @@ -204,16 +204,17 @@ namespace ROOT { return slot; } - std::vector<std::unique_ptr<TClassRec> > &GetDelayedAddClass() { - static std::vector<std::unique_ptr<TClassRec> > delayedAddClass; + std::vector<std::unique_ptr<TClassRec>> &GetDelayedAddClass() + { + static std::vector<std::unique_ptr<TClassRec>> delayedAddClass; return delayedAddClass; } - std::vector<std::pair<const char*, const char*> > &GetDelayedAddClassAlternate() { - static std::vector<std::pair<const char*, const char*> > delayedAddClassAlternate; + std::vector<std::pair<const char *, const char *>> &GetDelayedAddClassAlternate() + { + static std::vector<std::pair<const char *, const char *>> delayedAddClassAlternate; return delayedAddClassAlternate; } - } //////////////////////////////////////////////////////////////////////////////// @@ -231,13 +232,13 @@ TClassTable::TClassTable() memset(fgAlternate, 0, fgSize*sizeof(TClassAlt*)); gClassTable = this; - for(auto &&r : GetDelayedAddClass()) { + for (auto &&r : GetDelayedAddClass()) { AddClass(r->fName, r->fId, *r->fInfo, r->fDict, r->fBits); }; GetDelayedAddClass().clear(); - for(auto &&r : GetDelayedAddClassAlternate()) { - AddAlternate(r.first,r.second); + for (auto &&r : GetDelayedAddClassAlternate()) { + AddAlternate(r.first, r.second); } GetDelayedAddClassAlternate().clear(); } @@ -752,9 +753,9 @@ void ROOT::AddClass(const char *cname, Version_t id, void ROOT::AddClassAlternate(const char *normName, const char *alternate) { if (!TROOT::Initialized() && !gClassTable) { - GetDelayedAddClassAlternate().emplace_back(normName,alternate); + GetDelayedAddClassAlternate().emplace_back(normName, alternate); } else { - TClassTable::AddAlternate(normName,alternate); + TClassTable::AddAlternate(normName, alternate); } } diff --git a/core/cont/src/THashList.cxx b/core/cont/src/THashList.cxx index b58cd0b0ced..b0368c0c902 100644 --- a/core/cont/src/THashList.cxx +++ b/core/cont/src/THashList.cxx @@ -278,11 +278,13 @@ void THashList::RecursiveRemove(TObject *obj) if (obj->HasInconsistentHash()) { // Remove obj in the list itself TObject *object = TList::Remove(obj); - if (object) fTable->RemoveSlow(object); + if (object) + fTable->RemoveSlow(object); } else if (fTable->FindObject(obj)) { TObject *object = TList::Remove(obj); - if (object) fTable->Remove(object); + if (object) + fTable->Remove(object); } // Scan again the list and invoke RecursiveRemove for all objects diff --git a/core/foundation/src/TClassEdit.cxx b/core/foundation/src/TClassEdit.cxx index 53b208b129f..38c8b1a5a24 100644 --- a/core/foundation/src/TClassEdit.cxx +++ b/core/foundation/src/TClassEdit.cxx @@ -1652,8 +1652,10 @@ string TClassEdit::ResolveTypedef(const char *tname, bool /* resolveAll */) // vector<MyObjTypedef> return vector<MyObj> // - if ( tname==0 || tname[0]==0 ) return ""; - if ( !gInterpreterHelper ) return tname; + if (tname == 0 || tname[0] == 0) + return ""; + if (!gInterpreterHelper) + return tname; std::string result; diff --git a/core/meta/inc/TClass.h b/core/meta/inc/TClass.h index 23f38d87d85..713220ca649 100644 --- a/core/meta/inc/TClass.h +++ b/core/meta/inc/TClass.h @@ -466,13 +466,15 @@ public: /// @brief Return 'true' if we can guarantee that if this class (or any class in /// this class inheritance hierarchy) overload TObject::Hash it also starts /// the RecursiveRemove process from its own destructor. - Bool_t HasConsistentHashMember() { - if (!fRuntimeProperties) SetRuntimeProperties(); + Bool_t HasConsistentHashMember() + { + if (!fRuntimeProperties) + SetRuntimeProperties(); return fRuntimeProperties.load() & ERuntimeProperties::kConsistentHash; } Bool_t HasDictionary() const; static Bool_t HasDictionarySelection(const char* clname); - Bool_t HasLocalHashMember() const; + Bool_t HasLocalHashMember() const; void GetMissingDictionaries(THashTable& result, bool recurse = false); void IgnoreTObjectStreamer(Bool_t ignore=kTRUE); Bool_t InheritsFrom(const char *cl) const; diff --git a/core/meta/src/TCheckHashRecurveRemoveConsistency.h b/core/meta/src/TCheckHashRecurveRemoveConsistency.h index 3cf451abcb1..e52ec78c495 100644 --- a/core/meta/src/TCheckHashRecurveRemoveConsistency.h +++ b/core/meta/src/TCheckHashRecurveRemoveConsistency.h @@ -9,8 +9,8 @@ * For the list of contributors see $ROOTSYS/README/CREDITS. * *************************************************************************/ - #ifndef ROOT_TCheckHashRecurveRemoveConsistency - #define ROOT_TCheckHashRecurveRemoveConsistency +#ifndef ROOT_TCheckHashRecurveRemoveConsistency +#define ROOT_TCheckHashRecurveRemoveConsistency #include "TBaseClass.h" #include "TClass.h" @@ -48,7 +48,8 @@ public: public: // Default constructors. Adds object to the list of // cleanups. - TCheckHashRecurveRemoveConsistency() { + TCheckHashRecurveRemoveConsistency() + { SetBit(kMustCleanup); gROOT->GetListOfCleanups()->Add(this); } @@ -59,28 +60,31 @@ public: // of cleanups). ~TCheckHashRecurveRemoveConsistency() = default; - void Add(TObject* obj) { + void Add(TObject *obj) + { obj->SetBit(kMustCleanup); - fCont.push_back(Value_t{obj->Hash(),obj}); + fCont.push_back(Value_t{obj->Hash(), obj}); } - void RecursiveRemove(TObject *obj) { + void RecursiveRemove(TObject *obj) + { // std::cout << "Recursive Remove called for: " << obj << '\n'; - for(auto p = fCont.begin(); p != fCont.end(); ++p) { + for (auto p = fCont.begin(); p != fCont.end(); ++p) { if (p->fObjectPtr == obj) { // std::cout << " Found object with hash = " << p->fRecordedHash << '\n'; // std::cout << " Current hash = " << obj->Hash() << '\n'; if (p->fRecordedHash == obj->Hash()) fCont.erase(p); - //else - //std::cout << " Error: the recorded hash and the one returned by Hash are distinct.\n"; + // else + // std::cout << " Error: the recorded hash and the one returned by Hash are distinct.\n"; break; } } } - void SlowRemove(TObject *obj) { - for(auto p = fCont.begin(); p != fCont.end(); ++p) { + void SlowRemove(TObject *obj) + { + for (auto p = fCont.begin(); p != fCont.end(); ++p) { if (p->fObjectPtr == obj) { fCont.erase(p); break; @@ -88,19 +92,21 @@ public: } } - bool CheckRecursiveRemove(TClass &classRef) { + bool CheckRecursiveRemove(TClass &classRef) + { if (!classRef.HasDefaultConstructor() || classRef.Property() & kIsAbstract) return false; // okay that's probably a false negative ... auto size = fCont.size(); - TObject *obj = (TObject *) classRef.DynamicCast(TObject::Class(), classRef.New(TClass::kDummyNew)); + TObject *obj = (TObject *)classRef.DynamicCast(TObject::Class(), classRef.New(TClass::kDummyNew)); Add(obj); delete obj; if (fCont.size() != size) { - //std::cerr << "Error: old= " << size << " new=" << fCont.size() << '\n'; - //std::cerr << "Error " << classRef.GetName() << - // " or one of its base classes override TObject::Hash but does not call TROOT::CallRecursiveRemoveIfNeeded in its destructor.\n"; + // std::cerr << "Error: old= " << size << " new=" << fCont.size() << '\n'; + // std::cerr << "Error " << classRef.GetName() << + // " or one of its base classes override TObject::Hash but does not call TROOT::CallRecursiveRemoveIfNeeded + // in its destructor.\n"; SlowRemove(obj); return false; } else { @@ -108,21 +114,24 @@ public: } } - TClass *FindMissingRecursiveRemove(TClass &classRef) { + TClass *FindMissingRecursiveRemove(TClass &classRef) + { if (classRef.HasLocalHashMember() && !CheckRecursiveRemove(classRef)) { return &classRef; } - for(auto base : ROOT::Detail::TRangeStaticCast<TBaseClass>(classRef.GetListOfBases())) { - TClass* baseCl = base->GetClassPointer(); + for (auto base : ROOT::Detail::TRangeStaticCast<TBaseClass>(classRef.GetListOfBases())) { + TClass *baseCl = base->GetClassPointer(); TClass *res = FindMissingRecursiveRemove(*baseCl); - if (res) return res; + if (res) + return res; } return nullptr; } - bool VerifyRecursiveRemove(const char *classname) { + bool VerifyRecursiveRemove(const char *classname) + { TClass *classPtr = TClass::GetClass(classname); if (classPtr) return VerifyRecursiveRemove(*classPtr); @@ -130,7 +139,8 @@ public: return true; } - bool VerifyRecursiveRemove(TClass &classRef) { + bool VerifyRecursiveRemove(TClass &classRef) + { // If the class does not inherit from TObject, the setup is always 'correct' // (or more exactly does not matter). if (!classRef.IsTObject()) @@ -148,20 +158,22 @@ public: // we have no ClassDef and thus can not get a good message from TObject::Error. constexpr const char *funcName = "ROOT::Internal::TCheckHashRecurveRemoveConsistency::CheckRecursiveRemove"; if (failing) { - ::Error(funcName,"The class %s overrides TObject::Hash but does not call TROOT::RecursiveRemove in its destructor.", - failing->GetName()); + ::Error(funcName, + "The class %s overrides TObject::Hash but does not call TROOT::RecursiveRemove in its destructor.", + failing->GetName()); } else { - ::Error(funcName,"The class %s " - "or one of its base classes override TObject::Hash but does not call TROOT::CallRecursiveRemoveIfNeeded in its destructor.\n", - classRef.GetName()); - + ::Error(funcName, "The class %s " + "or one of its base classes override TObject::Hash but does not call " + "TROOT::CallRecursiveRemoveIfNeeded in its destructor.\n", + classRef.GetName()); } return false; } return true; } - static bool Check(TClass &classRef) { + static bool Check(TClass &classRef) + { TCheckHashRecurveRemoveConsistency checker; return checker.VerifyRecursiveRemove(classRef); } diff --git a/core/meta/src/TClass.cxx b/core/meta/src/TClass.cxx index 0bb1659929c..bac687c5c93 100644 --- a/core/meta/src/TClass.cxx +++ b/core/meta/src/TClass.cxx @@ -3036,7 +3036,8 @@ TClass *TClass::GetClass(const char *name, Bool_t load, Bool_t silent) printf("TClass::GetClass: Header Parsing - The representation of %s was not found in the type system. A lookup in the interpreter is about to be tried: this can cause parsing. This can be avoided selecting %s in the linkdef/selection file.\n",normalizedName.c_str(), normalizedName.c_str()); } if (normalizedName.length()) { - auto cci = gInterpreter->CheckClassInfo(normalizedName.c_str(), kTRUE /* autoload */, kTRUE /*Only class, structs and ns*/); + auto cci = gInterpreter->CheckClassInfo(normalizedName.c_str(), kTRUE /* autoload */, + kTRUE /*Only class, structs and ns*/); // We could have an interpreted class with an inline ClassDef, in this case we do not // want to create an 'interpreted' TClass but we want the one triggered via the call to @@ -3047,11 +3048,12 @@ TClass *TClass::GetClass(const char *name, Bool_t load, Bool_t silent) auto ci = gInterpreter->ClassInfo_Factory(normalizedName.c_str()); auto funcDecl = gInterpreter->GetFunctionWithPrototype(ci, "Dictionary", "", false, ROOT::kExactMatch); auto method = gInterpreter->MethodInfo_Factory(funcDecl); - typedef void (*tcling_callfunc_Wrapper_t)(void*, int, void**, void*); + typedef void (*tcling_callfunc_Wrapper_t)(void *, int, void **, void *); auto funcPtr = (tcling_callfunc_Wrapper_t)gInterpreter->MethodInfo_InterfaceMethod(method); TClass *res = nullptr; - if (funcPtr) funcPtr(0,0,nullptr,&res); + if (funcPtr) + funcPtr(0, 0, nullptr, &res); // else // We could fallback to the interpreted case ... // For now just 'fail' (return nullptr) @@ -3064,14 +3066,14 @@ TClass *TClass::GetClass(const char *name, Bool_t load, Bool_t silent) // Get the normalized name based on the decl (currently the only way // to get the part to add or drop the default arguments as requested by the user) std::string alternative; - gInterpreter->GetInterpreterTypeName(normalizedName.c_str(),alternative,kTRUE); + gInterpreter->GetInterpreterTypeName(normalizedName.c_str(), alternative, kTRUE); const char *altname = alternative.c_str(); - if ( strncmp(altname,"std::",5)==0 ) { + if (strncmp(altname, "std::", 5) == 0) { // For namespace (for example std::__1), GetInterpreterTypeName does // not strip std::, so we must do it explicitly here. altname += 5; } - if (altname != normalizedName && strcmp(altname,name) != 0) { + if (altname != normalizedName && strcmp(altname, name) != 0) { // altname now contains the full name of the class including a possible // namespace if there has been a using namespace statement. @@ -3080,7 +3082,7 @@ TClass *TClass::GetClass(const char *name, Bool_t load, Bool_t silent) // two different space layout. To avoid an infinite recursion, we also // add the test on (altname != name) - return GetClass(altname,load); + return GetClass(altname, load); } TClass *ncl = gInterpreter->GenerateTClass(normalizedName.c_str(), /* emulation = */ kFALSE, silent); @@ -5796,7 +5798,7 @@ Long_t TClass::Property() const kl->fStreamerImpl = &TClass::StreamerExternal; } - if (const_cast<TClass*>(this)->GetClassMethodWithPrototype("Hash","",kTRUE)) { + if (const_cast<TClass *>(this)->GetClassMethodWithPrototype("Hash", "", kTRUE)) { kl->SetBit(kHasLocalHashMember); } @@ -5850,10 +5852,9 @@ void TClass::SetRuntimeProperties() if (ROOT::Internal::TCheckHashRecurveRemoveConsistency::Check(*this)) properties |= static_cast<UChar_t>(ERuntimeProperties::kConsistentHash); - const_cast<TClass*>(this)->fRuntimeProperties = properties; + const_cast<TClass *>(this)->fRuntimeProperties = properties; } - //////////////////////////////////////////////////////////////////////////////// /// Internal routine to set fStreamerImpl based on the value of /// fStreamerType. @@ -6956,21 +6957,19 @@ void TClass::RemoveStreamerInfo(Int_t slot) /// This routines is used for a small subset of the class for which we need /// the answer before gROOT is properly initialized. -Bool_t ROOT::Internal::HasConsistentHashMember(const char* cname) +Bool_t ROOT::Internal::HasConsistentHashMember(const char *cname) { // Hand selection of correct classes, those classes should be // cross-checked in testHashRecursiveRemove.cxx static const char *handVerified[] = { - "TEnvRec", "TDataType", "TObjArray", "TList", "THashList", - "TClass", "TCling", "TInterpreter", "TMethod", - "ROOT::Internal::TCheckHashRecurveRemoveConsistency", - "TDirectory", "TDirectoryFile", "TObject", - "TH1" - }; + "TEnvRec", "TDataType", "TObjArray", "TList", "THashList", + "TClass", "TCling", "TInterpreter", "TMethod", "ROOT::Internal::TCheckHashRecurveRemoveConsistency", + "TDirectory", "TDirectoryFile", "TObject", "TH1"}; if (cname && cname[0]) { - for(auto cursor : handVerified) { - if (strcmp(cname,cursor) == 0) return true; + for (auto cursor : handVerified) { + if (strcmp(cname, cursor) == 0) + return true; } } return false; @@ -7032,9 +7031,10 @@ Bool_t TClass::HasDefaultConstructor() const /// if (cl->IsTObject() && cl->HasLocalHashMember()) /// ~~~ -Bool_t TClass::HasLocalHashMember() const +Bool_t TClass::HasLocalHashMember() const { - if (fProperty==(-1)) Property(); + if (fProperty == (-1)) + Property(); return TestBit(kHasLocalHashMember); } diff --git a/core/meta/src/TGenericClassInfo.cxx b/core/meta/src/TGenericClassInfo.cxx index 9073af3a698..25b5a102807 100644 --- a/core/meta/src/TGenericClassInfo.cxx +++ b/core/meta/src/TGenericClassInfo.cxx @@ -39,12 +39,13 @@ namespace Internal { if (std::string_view(start, end - start).compare("T") == 0) { // PRETTY_FUNCTION with gcc 7.1.0 gives : // "static std::__cxx11::string ROOT::Internal::TTypeNameExtraction<T>::Get() - // [with T = ROOT::Internal::TCheckHashRecurveRemoveConsistency; std::__cxx11::string = std::__cxx11::basic_string<char>]") + // [with T = ROOT::Internal::TCheckHashRecurveRemoveConsistency; std::__cxx11::string = + // std::__cxx11::basic_string<char>]") constexpr static const char withTtag[] = "[with T = "; const char *startWithT = strstr(start, withTtag); startWithT += sizeof(withTtag) - 1; - const char* endWithT = strstr(startWithT, ";"); + const char *endWithT = strstr(startWithT, ";"); if (!endWithT) return ""; start = startWithT; @@ -77,7 +78,7 @@ namespace Internal { R__instance.SetDelete(Delete); R__instance.SetDeleteArray(DeleteArray); R__instance.SetDestructor(Destruct); - R__instance.SetImplFile("",-1); + R__instance.SetImplFile("", -1); } void TCDGIILIBase::SetName(const std::string& name, diff --git a/core/meta/src/TViewPubDataMembers.h b/core/meta/src/TViewPubDataMembers.h index b421ced6f47..9416f348de0 100644 --- a/core/meta/src/TViewPubDataMembers.h +++ b/core/meta/src/TViewPubDataMembers.h @@ -77,7 +77,7 @@ protected: TObject *Remove(TObjLink *lnk); public: - ClassDefInline(TViewPubDataMembers,0) + ClassDefInline(TViewPubDataMembers, 0) }; // Preventing warnings with -Weffc++ in GCC since it is a false positive for the TListIter destructor. diff --git a/core/meta/src/TViewPubFunctions.h b/core/meta/src/TViewPubFunctions.h index 2fb3916629f..939f984cc8a 100644 --- a/core/meta/src/TViewPubFunctions.h +++ b/core/meta/src/TViewPubFunctions.h @@ -77,7 +77,7 @@ protected: TObject *Remove(TObjLink *lnk); public: - ClassDefInline(TViewPubFunctions,0) //Doubly linked list with hashtable for lookup + ClassDefInline(TViewPubFunctions, 0) // Doubly linked list with hashtable for lookup }; // Preventing warnings with -Weffc++ in GCC since it is a false positive for the TListIter destructor. diff --git a/core/meta/test/testHashRecursiveRemove.cxx b/core/meta/test/testHashRecursiveRemove.cxx index 63d2cbbfe52..de495686204 100644 --- a/core/meta/test/testHashRecursiveRemove.cxx +++ b/core/meta/test/testHashRecursiveRemove.cxx @@ -5,7 +5,7 @@ #include "gtest/gtest.h" -const char* gCode = R"CODE( +const char *gCode = R"CODE( #include "TROOT.h" #include <iostream> @@ -119,24 +119,22 @@ const char* gCode = R"CODE( )CODE"; -class WrongSetup : public TObject -{ +class WrongSetup : public TObject { public: - virtual ULong_t Hash() const { return 6; } + virtual ULong_t Hash() const { return 6; } ClassDefInline(WrongSetup, 2); }; -class InlineCompiledOnly : public TObject -{ +class InlineCompiledOnly : public TObject { public: - virtual ULong_t Hash() const { return 6; } + virtual ULong_t Hash() const { return 6; } ClassDefInline(InlineCompiledOnly, 2); }; - -const char *gErrorOutput = R"OUTPUT(Error in <ROOT::Internal::TCheckHashRecurveRemoveConsistency::CheckRecursiveRemove>: The class FirstOverload overrides TObject::Hash but does not call TROOT::RecursiveRemove in its destructor. +const char *gErrorOutput = + R"OUTPUT(Error in <ROOT::Internal::TCheckHashRecurveRemoveConsistency::CheckRecursiveRemove>: The class FirstOverload overrides TObject::Hash but does not call TROOT::RecursiveRemove in its destructor. Error in <ROOT::Internal::TCheckHashRecurveRemoveConsistency::CheckRecursiveRemove>: The class SecondOverload overrides TObject::Hash but does not call TROOT::RecursiveRemove in its destructor. Error in <ROOT::Internal::TCheckHashRecurveRemoveConsistency::CheckRecursiveRemove>: The class FirstOverload overrides TObject::Hash but does not call TROOT::RecursiveRemove in its destructor. Error in <ROOT::Internal::TCheckHashRecurveRemoveConsistency::CheckRecursiveRemove>: The class FirstOverload overrides TObject::Hash but does not call TROOT::RecursiveRemove in its destructor. @@ -144,34 +142,34 @@ Error in <ROOT::Internal::TCheckHashRecurveRemoveConsistency::CheckRecursiveRemo Error in <ROOT::Internal::TCheckHashRecurveRemoveConsistency::CheckRecursiveRemove>: The class WrongSetup overrides TObject::Hash but does not call TROOT::RecursiveRemove in its destructor. )OUTPUT"; - -void DeclareFailingClasses() { +void DeclareFailingClasses() +{ gInterpreter->Declare(gCode); } -TEST(HashRecursiveRemove,GetClassClassDefInline) +TEST(HashRecursiveRemove, GetClassClassDefInline) { DeclareFailingClasses(); auto getcl = TClass::GetClass("FirstOverload"); - EXPECT_NE(nullptr,getcl); + EXPECT_NE(nullptr, getcl); - std::unique_ptr<TObject> obj((TObject*)getcl->New()); - EXPECT_NE(nullptr,obj.get()); + std::unique_ptr<TObject> obj((TObject *)getcl->New()); + EXPECT_NE(nullptr, obj.get()); auto isacl = obj->IsA(); - EXPECT_NE(nullptr,isacl); - EXPECT_EQ(getcl,isacl); + EXPECT_NE(nullptr, isacl); + EXPECT_EQ(getcl, isacl); getcl = TClass::GetClass("WrongSetup"); - EXPECT_NE(nullptr,getcl); + EXPECT_NE(nullptr, getcl); // EXPECT_NE(nullptr,TClass::GetClass("WrongSetup")); WrongSetup ws; isacl = ws.IsA(); - EXPECT_NE(nullptr,isacl); - EXPECT_EQ(getcl,isacl); + EXPECT_NE(nullptr, isacl); + EXPECT_EQ(getcl, isacl); getcl = TClass::GetClass("WrongSetup"); - EXPECT_EQ(getcl,isacl); + EXPECT_EQ(getcl, isacl); #if 0 // Due to the fact that a compile ClassDefInline does not @@ -185,19 +183,19 @@ TEST(HashRecursiveRemove,GetClassClassDefInline) //getcl = TClass::GetClass("InlineCompiledOnly"); //EXPECT_NE(nullptr,getcl); #else - EXPECT_EQ(nullptr,TClassTable::GetDict("InlineCompiledOnly")); + EXPECT_EQ(nullptr, TClassTable::GetDict("InlineCompiledOnly")); getcl = TClass::GetClass("InlineCompiledOnly"); - EXPECT_EQ(nullptr,getcl); + EXPECT_EQ(nullptr, getcl); #endif InlineCompiledOnly ico; isacl = ico.IsA(); - EXPECT_NE(nullptr,isacl); - //EXPECT_EQ(getcl,isacl); + EXPECT_NE(nullptr, isacl); + // EXPECT_EQ(getcl,isacl); getcl = TClass::GetClass("InlineCompiledOnly"); - EXPECT_EQ(getcl,isacl); + EXPECT_EQ(getcl, isacl); } -TEST(HashRecursiveRemove,RootClasses) +TEST(HashRecursiveRemove, RootClasses) { EXPECT_TRUE(TClass::GetClass("TObject")->HasConsistentHashMember()); EXPECT_TRUE(TClass::GetClass("TNamed")->HasConsistentHashMember()); @@ -211,16 +209,16 @@ TEST(HashRecursiveRemove,RootClasses) EXPECT_TRUE(TClass::GetClass("THashList")->HasConsistentHashMember()); EXPECT_TRUE(TClass::GetClass("TClass")->HasConsistentHashMember()); EXPECT_FALSE(TClass::GetClass("TInterpreter")->HasConsistentHashMember()); - //EXPECT_TRUE(TClass::GetClass("TCling")->HasConsistentHashMember()); + // EXPECT_TRUE(TClass::GetClass("TCling")->HasConsistentHashMember()); EXPECT_TRUE(TClass::GetClass("TMethod")->HasConsistentHashMember()); - //EXPECT_TRUE(TClass::GetClass("ROOT::Internal::TCheckHashRecurveRemoveConsistency")->HasConsistentHashMember()); + // EXPECT_TRUE(TClass::GetClass("ROOT::Internal::TCheckHashRecurveRemoveConsistency")->HasConsistentHashMember()); } -TEST(HashRecursiveRemove,FailingClasses) +TEST(HashRecursiveRemove, FailingClasses) { testing::internal::CaptureStderr(); - EXPECT_NE(nullptr,TClass::GetClass("FirstOverload")); + EXPECT_NE(nullptr, TClass::GetClass("FirstOverload")); EXPECT_FALSE(TClass::GetClass("FirstOverload")->HasConsistentHashMember()); EXPECT_FALSE(TClass::GetClass("SecondOverload")->HasConsistentHashMember()); EXPECT_FALSE(TClass::GetClass("SecondNoHash")->HasConsistentHashMember()); @@ -237,21 +235,21 @@ TEST(HashRecursiveRemove,FailingClasses) EXPECT_FALSE(WrongSetup::Class()->HasConsistentHashMember()); std::string output = testing::internal::GetCapturedStderr(); - EXPECT_EQ(gErrorOutput,output); + EXPECT_EQ(gErrorOutput, output); } bool CallCheckedHash(const char *clname) { auto cl = TClass::GetClass(clname); - EXPECT_NE(nullptr,cl); + EXPECT_NE(nullptr, cl); - std::unique_ptr<TObject> obj((TObject*)cl->New()); - EXPECT_NE(nullptr,obj.get()); + std::unique_ptr<TObject> obj((TObject *)cl->New()); + EXPECT_NE(nullptr, obj.get()); obj->CheckedHash(); return !obj->HasInconsistentHash(); } -TEST(HashRecursiveRemove,CheckedHashRootClasses) +TEST(HashRecursiveRemove, CheckedHashRootClasses) { EXPECT_TRUE(CallCheckedHash("TObject")); EXPECT_TRUE(CallCheckedHash("TNamed")); @@ -264,16 +262,16 @@ TEST(HashRecursiveRemove,CheckedHashRootClasses) EXPECT_TRUE(CallCheckedHash("THashList")); EXPECT_TRUE(CallCheckedHash("TClass")); EXPECT_TRUE(CallCheckedHash("TMethod")); - //EXPECT_TRUE(CallCheckedHash("ROOT::Internal::TCheckHashRecurveRemoveConsistency")); + // EXPECT_TRUE(CallCheckedHash("ROOT::Internal::TCheckHashRecurveRemoveConsistency")); - TObject* h1 = (TObject*)gInterpreter->Calc("new TH1I(\"histo1\",\"histo title\", 100, -10., 10.);"); + TObject *h1 = (TObject *)gInterpreter->Calc("new TH1I(\"histo1\",\"histo title\", 100, -10., 10.);"); EXPECT_FALSE(h1->HasInconsistentHash()); delete h1; } -TEST(HashRecursiveRemove,CheckedHashFailingClasses) +TEST(HashRecursiveRemove, CheckedHashFailingClasses) { - //testing::internal::CaptureStderr(); + // testing::internal::CaptureStderr(); EXPECT_FALSE(CallCheckedHash("FirstOverload")); EXPECT_FALSE(CallCheckedHash("SecondOverload")); @@ -286,8 +284,8 @@ TEST(HashRecursiveRemove,CheckedHashFailingClasses) EXPECT_FALSE(CallCheckedHash("ThirdInCorrect")); EXPECT_FALSE(CallCheckedHash("WrongSetup")); - //std::string output = testing::internal::GetCapturedStderr(); - //EXPECT_EQ(gErrorOutput,output); + // std::string output = testing::internal::GetCapturedStderr(); + // EXPECT_EQ(gErrorOutput,output); } #include "THashList.h" @@ -295,12 +293,12 @@ TEST(HashRecursiveRemove,CheckedHashFailingClasses) constexpr size_t kHowMany = 20000; -TEST(HashRecursiveRemove,SimpleDelete) +TEST(HashRecursiveRemove, SimpleDelete) { THashList cont; - for(size_t i = 0; i < kHowMany; ++i) { - TNamed *n = new TNamed(TString::Format("n%ld",i),TString("")); + for (size_t i = 0; i < kHowMany; ++i) { + TNamed *n = new TNamed(TString::Format("n%ld", i), TString("")); n->SetBit(kMustCleanup); cont.Add(n); } @@ -309,18 +307,18 @@ TEST(HashRecursiveRemove,SimpleDelete) EXPECT_EQ(0, cont.GetSize()); } -TEST(HashRecursiveRemove,SimpleDirectRemove) +TEST(HashRecursiveRemove, SimpleDirectRemove) { THashList cont; TList todelete; - for(size_t i = 0; i < kHowMany; ++i) { - TNamed *n = new TNamed(TString::Format("n%ld",i),TString("")); + for (size_t i = 0; i < kHowMany; ++i) { + TNamed *n = new TNamed(TString::Format("n%ld", i), TString("")); n->SetBit(kMustCleanup); cont.Add(n); todelete.Add(n); } - for(auto o : todelete) { + for (auto o : todelete) { cont.Remove(o); delete o; } @@ -330,44 +328,46 @@ TEST(HashRecursiveRemove,SimpleDirectRemove) EXPECT_EQ(0, cont.GetSize()); } -TEST(HashRecursiveRemove,DeleteWithRecursiveRemove) +TEST(HashRecursiveRemove, DeleteWithRecursiveRemove) { THashList cont; TList todelete; - for(size_t i = 0; i < kHowMany; ++i) { - TNamed *n = new TNamed(TString::Format("n%ld",i),TString("")); + for (size_t i = 0; i < kHowMany; ++i) { + TNamed *n = new TNamed(TString::Format("n%ld", i), TString("")); n->SetBit(kMustCleanup); cont.Add(n); todelete.Add(n); } gROOT->GetListOfCleanups()->Add(&cont); - for(auto o : todelete) - delete o; + for (auto o : todelete) + delete o; todelete.Clear("nodelete"); EXPECT_EQ(0, cont.GetSize()); } -TEST(HashRecursiveRemove,DeleteBadHashWithRecursiveRemove) +TEST(HashRecursiveRemove, DeleteBadHashWithRecursiveRemove) { THashList cont; TList todelete; - for(size_t i = 0; i < kHowMany / 4; ++i) { + for (size_t i = 0; i < kHowMany / 4; ++i) { TObject *o; - if (i%2) o = (TObject*)TClass::GetClass("FirstOverload")->New(); - else o = new WrongSetup; + if (i % 2) + o = (TObject *)TClass::GetClass("FirstOverload")->New(); + else + o = new WrongSetup; o->SetBit(kMustCleanup); cont.Add(o); todelete.Add(o); } gROOT->GetListOfCleanups()->Add(&cont); - for(auto o : todelete) { - delete o; + for (auto o : todelete) { + delete o; } EXPECT_EQ(0, cont.GetSize()); @@ -376,4 +376,4 @@ TEST(HashRecursiveRemove,DeleteBadHashWithRecursiveRemove) // Avoid spurrious/redundant error messages in case of failure. cont.Clear("nodelete"); - } +} diff --git a/core/metacling/src/TCling.cxx b/core/metacling/src/TCling.cxx index 1ec2cb6c700..16a7296fc23 100644 --- a/core/metacling/src/TCling.cxx +++ b/core/metacling/src/TCling.cxx @@ -3490,7 +3490,8 @@ void TCling::SetClassInfo(TClass* cl, Bool_t reload) /// In case of templates the idea is that everything between the outer /// '<' and '>' has to be skipped, e.g.: aap<pippo<noot>::klaas>::a_class -TInterpreter::ECheckClassInfo TCling::CheckClassInfo(const char* name, Bool_t autoload, Bool_t isClassOrNamespaceOnly /* = kFALSE*/ ) +TInterpreter::ECheckClassInfo +TCling::CheckClassInfo(const char *name, Bool_t autoload, Bool_t isClassOrNamespaceOnly /* = kFALSE*/) { R__LOCKGUARD(gInterpreterMutex); static const char *anonEnum = "anonymous enum "; @@ -3515,8 +3516,8 @@ TInterpreter::ECheckClassInfo TCling::CheckClassInfo(const char* name, Bool_t au // If we want to know if a class or a namespace with this name exists in the // interpreter and this is an enum in the type system, before or after loading // according to the autoload function argument, return kUnknown. - if (isClassOrNamespaceOnly && - TEnum::GetEnum(name, autoload ? TEnum::kAutoload : TEnum::kNone)) return kUnknown; + if (isClassOrNamespaceOnly && TEnum::GetEnum(name, autoload ? TEnum::kAutoload : TEnum::kNone)) + return kUnknown; const char *classname = name; @@ -3590,13 +3591,13 @@ TInterpreter::ECheckClassInfo TCling::CheckClassInfo(const char* name, Bool_t au if (hasDictionary.IsValid() && implLineFunc.IsValid()) { int lineNumber = 0; bool success = false; - std::tie(success,lineNumber) = + std::tie(success, lineNumber) = ROOT::TMetaUtils::GetTrivialIntegralReturnValue(implLineFunc.GetMethodDecl(), *fInterpreter); hasClassDefInline = success && (lineNumber == -1); } } - //fprintf(stderr,"CheckClassInfo: %s had dict=%d inline=%d\n",name,hasDictionary.IsValid() + // fprintf(stderr,"CheckClassInfo: %s had dict=%d inline=%d\n",name,hasDictionary.IsValid() // , hasClassDefInline); // We are now sure that the entry is not in fact an autoload entry. @@ -3613,8 +3614,10 @@ TInterpreter::ECheckClassInfo TCling::CheckClassInfo(const char* name, Bool_t au } SetClassAutoloading(storeAutoload); - if (decl) return kKnown; - else return kUnknown; + if (decl) + return kKnown; + else + return kUnknown; // Setting up iterator part of TClingTypedefInfo is too slow. // Copy the lookup code instead: @@ -5518,7 +5521,7 @@ UInt_t TCling::AutoParseImplRecurse(const char *cls, bool topLevel) std::vector<std::string> autoparseKeys; if (strchr(cls, '<')) { int nestedLoc = 0; - TClassEdit::GetSplit(cls+offset, autoparseKeys, nestedLoc, TClassEdit::kDropTrailStar); + TClassEdit::GetSplit(cls + offset, autoparseKeys, nestedLoc, TClassEdit::kDropTrailStar); // Check if we can skip the name of the template in the autoparses // Take all the scopes one by one. If all of them are in the AST, we do not // need to autoparse for that particular template. @@ -5531,8 +5534,8 @@ UInt_t TCling::AutoParseImplRecurse(const char *cls, bool topLevel) auto tokens = templateName.Tokenize("::"); clang::NamedDecl* previousScopeAsNamedDecl = nullptr; clang::DeclContext* previousScopeAsContext = fInterpreter->getCI()->getASTContext().getTranslationUnitDecl(); - if (TClassEdit::IsStdClass(cls+offset)) - previousScopeAsContext = fInterpreter->getSema().getStdNamespace(); + if (TClassEdit::IsStdClass(cls + offset)) + previousScopeAsContext = fInterpreter->getSema().getStdNamespace(); auto nTokens = tokens->GetEntries(); for (Int_t tk = 0; tk < nTokens; ++tk) { auto scopeObj = tokens->UncheckedAt(tk); diff --git a/core/metacling/src/TCling.h b/core/metacling/src/TCling.h index 4dbc2f3dbec..f726cf5ecea 100644 --- a/core/metacling/src/TCling.h +++ b/core/metacling/src/TCling.h @@ -226,7 +226,7 @@ public: // Public Interface void UpdateListOfTypes(); void SetClassInfo(TClass* cl, Bool_t reload = kFALSE); - ECheckClassInfo CheckClassInfo(const char* name, Bool_t autoload, Bool_t isClassOrNamespaceOnly = kFALSE); + ECheckClassInfo CheckClassInfo(const char *name, Bool_t autoload, Bool_t isClassOrNamespaceOnly = kFALSE); Bool_t CheckClassTemplate(const char *name); Long_t Calc(const char* line, EErrorCode* error = 0); diff --git a/graf2d/graf/inc/TImagePlugin.h b/graf2d/graf/inc/TImagePlugin.h index 1b9a3c15d58..8a297bef25a 100644 --- a/graf2d/graf/inc/TImagePlugin.h +++ b/graf2d/graf/inc/TImagePlugin.h @@ -26,7 +26,8 @@ protected: public: TImagePlugin(const char *ext) { fExtension = ext; } - virtual ~TImagePlugin() { + virtual ~TImagePlugin() + { // Required since we overload TObject::Hash. ROOT::CallRecursiveRemoveIfNeeded(*this); } diff --git a/graf2d/win32gdk/inc/TGWin32InterpreterProxy.h b/graf2d/win32gdk/inc/TGWin32InterpreterProxy.h index b13446ae592..011ed04b274 100644 --- a/graf2d/win32gdk/inc/TGWin32InterpreterProxy.h +++ b/graf2d/win32gdk/inc/TGWin32InterpreterProxy.h @@ -73,8 +73,9 @@ public: void UpdateListOfTypes(); void SetClassInfo(TClass *cl, Bool_t reload = kFALSE); - TInterpreter::ECheckClassInfo CheckClassInfo(const char *name, Bool_t autoload, Bool_t isClassOrNamespaceOnly = kFALSE); - Bool_t CheckClassTemplate(const char *name); + TInterpreter::ECheckClassInfo + CheckClassInfo(const char *name, Bool_t autoload, Bool_t isClassOrNamespaceOnly = kFALSE); + Bool_t CheckClassTemplate(const char *name); Long_t Calc(const char *line, EErrorCode* error = 0); void CreateListOfBaseClasses(TClass *cl); diff --git a/graf2d/win32gdk/src/TGWin32InterpreterProxy.cxx b/graf2d/win32gdk/src/TGWin32InterpreterProxy.cxx index 411827e795d..8345c83c99a 100644 --- a/graf2d/win32gdk/src/TGWin32InterpreterProxy.cxx +++ b/graf2d/win32gdk/src/TGWin32InterpreterProxy.cxx @@ -97,7 +97,8 @@ VOID_METHOD_ARG0_LOCK(Interpreter,UpdateListOfGlobals) VOID_METHOD_ARG0_LOCK(Interpreter,UpdateListOfGlobalFunctions) VOID_METHOD_ARG0_LOCK(Interpreter,UpdateListOfTypes) VOID_METHOD_ARG2_LOCK(Interpreter,SetClassInfo,TClass*,cl,Bool_t,reload) -RETURN_METHOD_ARG3(Interpreter,TInterpreter::ECheckClassInfo,CheckClassInfo,const char*,name,Bool_t,autoload,Bool_t,isClassOrNamespaceOnly) +RETURN_METHOD_ARG3(Interpreter, TInterpreter::ECheckClassInfo, CheckClassInfo, const char *, name, Bool_t, autoload, + Bool_t, isClassOrNamespaceOnly) RETURN_METHOD_ARG1(Interpreter,Bool_t,CheckClassTemplate,const char*,name) RETURN_METHOD_ARG2(Interpreter,Long_t,Calc,const char*,line,TInterpreter::EErrorCode*,error) VOID_METHOD_ARG1_LOCK(Interpreter,CreateListOfBaseClasses,TClass*,cl) @@ -119,6 +120,7 @@ RETURN_METHOD_ARG2(Interpreter,Long_t,ExecuteMacro,const char*,filename,TInterpr RETURN_METHOD_ARG1(Interpreter,Bool_t,SetErrorMessages,Bool_t,enable) VOID_METHOD_ARG1(Interpreter,SetProcessLineLock,Bool_t,lock,1) RETURN_METHOD_ARG1(Interpreter,const char*,TypeName,const char*,s) -//TInterpreter::ECheckClassInfo TGWin32InterpreterProxy::CheckClassInfo(const char* name) { return RealObject()->CheckClassInfo(name); } +// TInterpreter::ECheckClassInfo TGWin32InterpreterProxy::CheckClassInfo(const char* name) { return +// RealObject()->CheckClassInfo(name); } #endif diff --git a/html/inc/TDocInfo.h b/html/inc/TDocInfo.h index 82bb73d4a65..03faf651608 100644 --- a/html/inc/TDocInfo.h +++ b/html/inc/TDocInfo.h @@ -49,12 +49,13 @@ public: fDeclFileSysName(fsdecl), fImplFileSysName(fsimpl), fSelected(kTRUE) { } - virtual ~TClassDocInfo() { + virtual ~TClassDocInfo() + { // Required since we overload TObject::Hash. ROOT::CallRecursiveRemoveIfNeeded(*this); } - TDictionary* GetClass() const { return fClass; } + TDictionary *GetClass() const { return fClass; } virtual const char* GetName() const; const char* GetHtmlFileName() const { return fHtmlFileName; } const char* GetDeclFileName() const { return fDeclFileName; } diff --git a/roofit/roofitcore/src/RooLinkedList.cxx b/roofit/roofitcore/src/RooLinkedList.cxx index 05af5bdceaf..fec97898589 100644 --- a/roofit/roofitcore/src/RooLinkedList.cxx +++ b/roofit/roofitcore/src/RooLinkedList.cxx @@ -364,12 +364,12 @@ void RooLinkedList::setHashTableSize(Int_t size) RooLinkedList::~RooLinkedList() { - // Required since we overload TObject::Hash. - ROOT::CallRecursiveRemoveIfNeeded(*this); + // Required since we overload TObject::Hash. + ROOT::CallRecursiveRemoveIfNeeded(*this); - if (_htableName) { - delete _htableName ; - _htableName=0 ; + if (_htableName) { + delete _htableName; + _htableName = 0; } if (_htableLink) { delete _htableLink ; diff --git a/roofit/roofitcore/src/RooSetPair.cxx b/roofit/roofitcore/src/RooSetPair.cxx index cd743b16550..7bb8ddef00f 100644 --- a/roofit/roofitcore/src/RooSetPair.cxx +++ b/roofit/roofitcore/src/RooSetPair.cxx @@ -30,7 +30,7 @@ RooSetPair is a utility class that stores a pair of RooArgSets using namespace std; -ClassImp(RooSetPair); +ClassImp(RooSetPair); //////////////////////////////////////////////////////////////////////////////// /// RooSetPair destructor. @@ -40,5 +40,3 @@ RooSetPair::~RooSetPair() // Required since we overload TObject::Hash. ROOT::CallRecursiveRemoveIfNeeded(*this); } - - -- GitLab