internal/pipewire: implement Long type
All checks were successful
Test / Create distribution (push) Successful in 37s
Test / Sandbox (push) Successful in 1m42s
Test / Hakurei (push) Successful in 2m30s
Test / Hpkg (push) Successful in 3m20s
Test / Sandbox (race detector) (push) Successful in 4m19s
Test / Hakurei (race detector) (push) Successful in 5m10s
Test / Flake checks (push) Successful in 1m37s
All checks were successful
Test / Create distribution (push) Successful in 37s
Test / Sandbox (push) Successful in 1m42s
Test / Hakurei (push) Successful in 2m30s
Test / Hpkg (push) Successful in 3m20s
Test / Sandbox (race detector) (push) Successful in 4m19s
Test / Hakurei (race detector) (push) Successful in 5m10s
Test / Flake checks (push) Successful in 1m37s
Thankfully no special case here. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
parent
2e465c94da
commit
463f8836e6
@ -143,6 +143,11 @@ func marshalValueAppendRaw(data []byte, v reflect.Value) ([]byte, error) {
|
|||||||
data = binary.NativeEndian.AppendUint32(data, Word(v.Int()))
|
data = binary.NativeEndian.AppendUint32(data, Word(v.Int()))
|
||||||
return data, nil
|
return data, nil
|
||||||
|
|
||||||
|
case reflect.Int64:
|
||||||
|
data = binary.NativeEndian.AppendUint32(data, SPA_TYPE_Long)
|
||||||
|
data = binary.NativeEndian.AppendUint64(data, uint64(v.Int()))
|
||||||
|
return data, nil
|
||||||
|
|
||||||
case reflect.Struct:
|
case reflect.Struct:
|
||||||
data = binary.NativeEndian.AppendUint32(data, SPA_TYPE_Struct)
|
data = binary.NativeEndian.AppendUint32(data, SPA_TYPE_Struct)
|
||||||
var err error
|
var err error
|
||||||
@ -270,6 +275,14 @@ func unmarshalValue(data []byte, v reflect.Value, wireSizeP *Word) error {
|
|||||||
v.SetInt(int64(binary.NativeEndian.Uint32(data)))
|
v.SetInt(int64(binary.NativeEndian.Uint32(data)))
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
|
case reflect.Int64:
|
||||||
|
*wireSizeP = 8
|
||||||
|
if err := unmarshalCheckTypeBounds(&data, SPA_TYPE_Long, wireSizeP); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
v.SetInt(int64(binary.NativeEndian.Uint64(data)))
|
||||||
|
return nil
|
||||||
|
|
||||||
case reflect.Struct:
|
case reflect.Struct:
|
||||||
*wireSizeP = 0
|
*wireSizeP = 0
|
||||||
if err := unmarshalCheckTypeBounds(&data, SPA_TYPE_Struct, wireSizeP); err != nil {
|
if err := unmarshalCheckTypeBounds(&data, SPA_TYPE_Struct, wireSizeP); err != nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user