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());
154 if (reg.fOwner == &classRef) {
162 fRegister[bit].emplace_back(classRef, std::string(constant->GetName()), intentionalDup);
170 TClass *bcl = base->GetClassPointer();
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;
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++) {
273 result =
Check(*classPtr, verbosity) && result;
int Int_t
Signed integer 4 bytes (int).
unsigned char UChar_t
Unsigned Character 1 byte (unsigned char).
long long Long64_t
Portable signed long integer 8 bytes.
externTClassTable * gClassTable
Error("WriteTObject","The current directory (%s) is not associated with a file. The object (%s) has not been written.", GetName(), objname)
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...
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.
Long64_t GetValue() const
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.
TRangeCast< T, false > TRangeStaticCast
TRangeStaticCast is an adapter class that allows the typed iteration through a TCollection.
Info(TClass &o, std::string &&n, bool intentionalDup)
Info(const Info &)=default
std::string fConstantName