Skip to content

Commit

Permalink
[NFC] clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
pcanal committed Jan 30, 2025
1 parent c3ad9e9 commit d63bac9
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions core/meta/inc/TEnum.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class TEnum : public TDictionary {
EDataType fUnderlyingType = kInt_t; // Type (size) used to store the enum in memory

enum EStatusBits {
kBitIsScopedEnum = BIT(14), ///< The enum is an enum class.
kBitIsValid = BIT(15) ///< The TEnum object was read from file (assumed valid)
kBitIsScopedEnum = BIT(14), ///< The enum is an enum class.
kBitIsValid = BIT(15) ///< The TEnum object was read from file (assumed valid)
};

public:
Expand Down
9 changes: 5 additions & 4 deletions core/meta/src/TDataMember.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,8 @@ void TDataMember::Init(bool afterReading)
if (enumdesc)
fDataType = TDataType::GetDataType(enumdesc->GetUnderlyingType());
else
fDataType = gROOT->GetType("Int_t", kTRUE); // In rare instance we are called before Int_t has been added to the list of types in TROOT, the kTRUE insures it is there.
fDataType = gROOT->GetType("Int_t", kTRUE); // In rare instance we are called before Int_t has been added to
// the list of types in TROOT, the kTRUE insures it is there.
}
// if (!fDataType)
// Error("TDataMember", "basic data type %s not found in list of basic types",
Expand Down Expand Up @@ -511,15 +512,15 @@ Longptr_t TDataMember::GetOffsetCint() const
Int_t TDataMember::GetUnitSize() const
{
if (IsaPointer()) return sizeof(void*);
if (IsEnum())
{
if (IsEnum()) {
auto e = TEnum::GetEnum(GetTypeName());
if (e)
return TDataType::GetDataType(e->GetUnderlyingType())->Size();
else
return sizeof(Int_t);
}
if (IsBasic()) return GetDataType()->Size();
if (IsBasic())
return GetDataType()->Size();

TClass *cl = TClass::GetClass(GetTypeName());
if (!cl) cl = TClass::GetClass(GetTrueTypeName());
Expand Down
2 changes: 1 addition & 1 deletion core/meta/src/TStreamerElement.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1895,7 +1895,7 @@ TClass *TStreamerSTL::GetClassPointer() const
if ( arglist.fElements[1].size() >= 2 ) {
auto enumdesc = TEnum::GetEnum(arglist.fElements[1].c_str());
if (enumdesc || gCling->ClassInfo_IsEnum(arglist.fElements[1].c_str())) {
((TStreamerElement*)this)->fNewClass = cl;
((TStreamerElement *)this)->fNewClass = cl;
if (proxy->HasPointers())
cl = TClass::GetClass("vector<Int_t*>");
else
Expand Down
2 changes: 1 addition & 1 deletion io/io/inc/TStreamerInfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ class TStreamerInfo : public TVirtualStreamerInfo {
Int_t WriteBufferAux (TBuffer &b, const T &arr, TCompInfo *const*const compinfo, Int_t first, Int_t last, Int_t narr,Int_t eoffset,Int_t mode);

//WARNING this class version must be the same as TVirtualStreamerInfo
ClassDefOverride(TStreamerInfo, 10) //Streamer information for one class version
ClassDefOverride(TStreamerInfo, 10) // Streamer information for one class version
};


Expand Down
2 changes: 1 addition & 1 deletion io/io/src/TGenCollectionProxy.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ TGenCollectionProxy::Value::Value(const std::string& inside_type, Bool_t silent,
} else {
fSize = fundType->Size();
}
} else if (auto e = TEnum::GetEnum( intype.c_str(), TEnum::kNone) ) {
} else if (auto e = TEnum::GetEnum(intype.c_str(), TEnum::kNone)) {
R__ASSERT(e->IsValid());
// This is a known enum.
fCase = kIsEnum;
Expand Down
11 changes: 5 additions & 6 deletions io/io/src/TStreamerInfo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -641,18 +641,17 @@ void TStreamerInfo::Build(Bool_t isTransient)
element = new TStreamerBasicType(dmName, dmTitle, offset, dtype, dmFull);
}
if (dm->IsEnum()) {
if (auto enumdesc = TEnum::GetEnum(dm->GetFullTypeName(), TEnum::kNone))
{
if (auto enumdesc = TEnum::GetEnum(dm->GetFullTypeName(), TEnum::kNone)) {
// When introducing support for non-default sized enum, it was
// decided to keep the file format unchanged and to always
// store the enum constant as an int.
auto memType = enumdesc->GetUnderlyingType();
if (TDataType::GetDataType(memType)->Size() > 4) {
// 4 is the onfile space for an Int_t.
Error(
"Build",
"Discarding %s %s::%s because the underlying type (%s) for the enum %s is larger than 4 bytes and may result in data loss.",
dmFull, GetName(), dmName, TDataType::GetTypeName(memType), dm->GetFullTypeName());
Error("Build",
"Discarding %s %s::%s because the underlying type (%s) for the enum %s is larger than 4 bytes "
"and may result in data loss.",
dmFull, GetName(), dmName, TDataType::GetTypeName(memType), dm->GetFullTypeName());
continue;
}
element->SetType(TStreamerInfo::kInt);
Expand Down
4 changes: 2 additions & 2 deletions tree/treeplayer/src/TTreeReaderArray.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -583,8 +583,8 @@ void ROOT::Internal::TTreeReaderArrayBase::CreateProxy()
if ((left_datatype && left_datatype->GetType() == kInt_t && right_enum) ||
(right_datatype && right_datatype->GetType() == kInt_t && left_enum))
return true;
if ((left_datatype && right_enum && left_datatype->GetType() == right_enum->GetUnderlyingType())
|| (right_datatype && left_enum && right_datatype->GetType() == left_enum->GetUnderlyingType()))
if ((left_datatype && right_enum && left_datatype->GetType() == right_enum->GetUnderlyingType()) ||
(right_datatype && left_enum && right_datatype->GetType() == left_enum->GetUnderlyingType()))
return true;
if (!left_datatype || !right_datatype)
return false;
Expand Down
4 changes: 2 additions & 2 deletions tree/treeplayer/src/TTreeReaderValue.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,8 @@ void ROOT::Internal::TTreeReaderValueBase::CreateProxy()
if ((dictdt && dictdt->GetType() == kInt_t && actualenum) ||
(actualdt && actualdt->GetType() == kInt_t && dictenum))
complainAboutMismatch = false;
if ((dictdt && actualenum && dictdt->GetType() == actualenum->GetUnderlyingType())
||(actualdt && dictenum && actualdt->GetType() == dictenum->GetUnderlyingType()))
if ((dictdt && actualenum && dictdt->GetType() == actualenum->GetUnderlyingType()) ||
(actualdt && dictenum && actualdt->GetType() == dictenum->GetUnderlyingType()))
complainAboutMismatch = false;
}
if (complainAboutMismatch) {
Expand Down

0 comments on commit d63bac9

Please sign in to comment.