Skip to content

Commit

Permalink
groot/rdict: drop deprecated reflect.PtrTo in favor of reflect.PointerTo
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastien Binet <[email protected]>
  • Loading branch information
sbinet committed Oct 22, 2024
1 parent ef7e11a commit badd785
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions groot/rdict/streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ func (bld *streamerBuilder) genStdVectorOf(typ reflect.Type, name string, offset
case reflect.Struct:
ename = fmt.Sprintf("vector<%s>", typenameOf(typ))
etype = rmeta.Any
if isTObject(typ) || isTObject(reflect.PtrTo(typ)) {
if isTObject(typ) || isTObject(reflect.PointerTo(typ)) {
etype = rmeta.Object
}
case reflect.Slice:
Expand Down Expand Up @@ -162,7 +162,7 @@ func (bld *streamerBuilder) genPtr(typ reflect.Type, name string, offset int32)
// panic(fmt.Errorf("rdict: invalid ptr-to type %v", typ))
// }

ptr := reflect.PtrTo(typ)
ptr := reflect.PointerTo(typ)
se := StreamerElement{
named: *rbase.NewNamed(name, ""),
etype: rmeta.AnyP,
Expand Down Expand Up @@ -282,7 +282,7 @@ func (bld *streamerBuilder) genArrayOf(n int, typ reflect.Type, name string, off
},
}
case reflect.Struct:
if isTObject(typ) || isTObject(reflect.PtrTo(typ)) {
if isTObject(typ) || isTObject(reflect.PointerTo(typ)) {
return &StreamerObject{
StreamerElement{
named: *rbase.NewNamed(name, ""),
Expand Down Expand Up @@ -715,7 +715,7 @@ func offsetOf(field reflect.StructField) int32 {

func (bld *streamerBuilder) sizeOf(typ reflect.Type) int32 {
// FIXME(sbinet): compute ROOT-compatible size.
if ptr := reflect.PtrTo(typ); isTObject(ptr) || isTObject(typ) {
if ptr := reflect.PointerTo(typ); isTObject(ptr) || isTObject(typ) {
name := typenameOf(typ)
switch name {
case "TObjString":
Expand All @@ -740,7 +740,7 @@ func typenameOf(typ reflect.Type) string {
return name
}
}
if ptr := reflect.PtrTo(typ); isTObject(ptr) {
if ptr := reflect.PointerTo(typ); isTObject(ptr) {
name := reflect.New(typ).Interface().(root.Object).Class()
return name
}
Expand Down
4 changes: 2 additions & 2 deletions groot/rdict/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ func TypeFromSE(ctx rbytes.StreamerInfoContext, se rbytes.StreamerElement) (refl
if err != nil {
return nil, fmt.Errorf("rdict: could not create type for ptr-to-object %q: %w", typename, err)
}
typ = reflect.PtrTo(typ)
typ = reflect.PointerTo(typ)
return typeFromDescr(typ, typename, alen, se.ArrayDims()), nil

case *StreamerSTL:
Expand Down Expand Up @@ -555,7 +555,7 @@ func typeFromDescr(typ reflect.Type, typename string, alen int, dims []int32) re
if typename[len(typename)-1-i] != '*' {
break
}
typ = reflect.PtrTo(typ)
typ = reflect.PointerTo(typ)
}

return typ
Expand Down

0 comments on commit badd785

Please sign in to comment.