From 9e4e4272d3f686e750a13d2111b0fb7041db2f4a Mon Sep 17 00:00:00 2001 From: Aleksandr Nogikh Date: Tue, 31 Aug 2021 17:21:33 +0000 Subject: all: introduce a prog.Call constructor Create a constructor for the prog.Call type. It allows to reduce the duplication of code now and during further changes. --- prog/encoding.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'prog/encoding.go') diff --git a/prog/encoding.go b/prog/encoding.go index b389fc10d..de0e324b1 100644 --- a/prog/encoding.go +++ b/prog/encoding.go @@ -263,11 +263,8 @@ func (p *parser) parseProg() (*Prog, error) { if meta == nil { return nil, fmt.Errorf("unknown syscall %v", name) } - c := &Call{ - Meta: meta, - Ret: MakeReturnArg(meta.Ret), - Comment: p.comment, - } + c := MakeCall(meta, nil) + c.Comment = p.comment prog.Calls = append(prog.Calls, c) p.Parse('(') for i := 0; p.Char() != ')'; i++ { -- cgit mrf-deployment