Skip to content

Commit

Permalink
io: Workaround TDataType legacy type for enums (part2)
Browse files Browse the repository at this point in the history
  • Loading branch information
pcanal committed Nov 22, 2024
1 parent c0503be commit a9b72fd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions io/io/src/TStreamerInfo.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,7 @@ void TStreamerInfo::Build(Bool_t isTransient)
if (auto enumdesc = TEnum::GetEnum(dm->GetFullTypeName(), TEnum::kNone))
{
// NOTE: We might simplify this by having the dm->fDataType being 'correct'.
// If we do we need to also make sure to update the old type accordingly
element->SetNewType(enumdesc->GetUnderlyingType());
element->SetType(TStreamerInfo::kInt);
}
Expand Down Expand Up @@ -2186,6 +2187,13 @@ void TStreamerInfo::BuildOld()
// All the values of EDataType have the same semantic in EReadWrite
newType = (EReadWrite)theType->GetType();
}
if (dm->IsEnum()) {
if (auto enumdesc = TEnum::GetEnum(dm->GetFullTypeName(), TEnum::kNone))
{
// NOTE: We might simplify this by having the dm->fDataType being 'correct'.
newType = enumdesc->GetUnderlyingType();
}
}
if ((newType == ::kChar_t) && dmIsPtr && !isArray && !hasCount) {
newType = ::kCharStar;
} else if (dmIsPtr) {
Expand Down

0 comments on commit a9b72fd

Please sign in to comment.