104 Error(
"TStatusBitsChecker::ConvertBit",
"In %s the value of %s is %lld which was not produced by BIT macro.",
105 classRef.
GetName(), constantName, constant);
110 double fraction = std::frexp(constant, &backshift);
117 if (backshift < 0 || std::abs(0.5 - fraction) > 0.00001f) {
118 Error(
"TStatusBitsChecker::ConvertBit",
"In %s the value of %s is %lld which was not produced by BIT macro.",
119 classRef.
GetName(), constantName, constant);
123 if (backshift > 24) {
124 Error(
"TStatusBitsChecker::ConvertBit",
"In %s the value of %s is %lld (>23) which is ignored by SetBit.",
125 classRef.
GetName(), constantName, constant);
146 bool intentionalDup = exceptionBits && exceptionBits->
GetConstant(constant->GetName());
148 auto value = constant->GetValue();
154 if (
reg.fOwner == &classRef) {
162 fRegister[bit].emplace_back(classRef, std::string(constant->GetName()), intentionalDup);
170 TClass *bcl = base->GetClassPointer();
184 RegisterBits(classRef);
187 for (
auto &
cursor : fRegister) {
188 for (
auto &constant :
cursor.second) {
189 Printf(
"Bit %3d declared in %s as %s",
cursor.first, constant.fOwner->GetName(),
190 constant.fConstantName.c_str());
195 bool issuedHeader =
false;
197 for (
auto &
cursor : fRegister) {
198 unsigned int nDuplicate = 0;
199 for (
auto &constant :
cursor.second) {
200 if (!constant.fIntentionalDup)
203 if (nDuplicate > 1) {
205 Error(
"TStatusBitsChecker",
"In %s class hierarchy, there are duplicates bits:", classRef.
GetName());
208 for (
auto &constant :
cursor.second) {
209 if (!constant.fIntentionalDup) {
210 Error(
"TStatusBitsChecker",
" Bit %3d used in %s as %s",
cursor.first, constant.fOwner->GetName(),
211 constant.fConstantName.c_str());
238 return Check(*cl, verbose);
255 std::set<std::string> rootLibs;
256 TList classesDeclFileNotFound;
257 TList classesImplFileNotFound;
260 for (
Int_t i = 0; i < totalNumberOfClasses; i++) {
R__EXTERN TClassTable * gClassTable
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t cursor
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char cname
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void reg
void Printf(const char *fmt,...)
Formats a string in a circular formatting buffer and prints the string.
std::map< UChar_t, std::list< Info > > fRegister
! Register of bits seen so far.
Registry()
Default constructor. Implemented in source file to allow hiding of the Info struct.
bool Check(TClass &classRef, bool verbose=false)
Return false and print error messages if there is any unexpected duplicates BIT constant in the class...
void RegisterBits(TClass &classRef)
Add to fRegister the Info about the bits in this class and its base classes.
~Registry()
Default destructor. Implemented in source file to allow hiding of the Info struct.
static bool Check(TClass &classRef, bool verbose=false)
Return false and print error messages if there is any unexpected duplicates BIT constant in the class...
static UChar_t ConvertToBit(Long64_t constant, TClass &classRef, const char *constantName)
Figure out which bit the constant has been set from/to.
static bool CheckAllClasses(bool verbosity=false)
Return false and print error messages if there is any unexpected duplicates BIT constant in any of th...
static char * Next()
Returns next class from sorted class table.
TClass instances represent classes, structs and namespaces in the ROOT type system.
TList * GetListOfEnums(Bool_t load=kTRUE)
Return a list containing the TEnums of a class.
TList * GetListOfBases()
Return list containing the TBaseClass(es) of a class.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
The TEnum class implements the enum type.
const TSeqCollection * GetConstants() const
const TEnumConstant * GetConstant(const char *name) const
TObject * FindObject(const char *name) const override
Find an object in this list using its name.
const char * GetName() const override
Returns name of object.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
Info(TClass &o, std::string &&n, bool intentionalDup)
Info(const Info &)=default
std::string fConstantName