fix warning
This commit is contained in:
@@ -55,7 +55,7 @@ func main() {
|
|||||||
if e == nil {
|
if e == nil {
|
||||||
enc := json.NewEncoder(os.Stdout)
|
enc := json.NewEncoder(os.Stdout)
|
||||||
enc.SetIndent("", " ")
|
enc.SetIndent("", " ")
|
||||||
enc.Encode(doc)
|
check(enc.Encode(doc))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = e
|
err = e
|
||||||
@@ -63,3 +63,9 @@ func main() {
|
|||||||
fmt.Fprintln(os.Stderr, err)
|
fmt.Fprintln(os.Stderr, err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func check(err error) {
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -189,6 +189,7 @@ func (p *parser) newError(errMsg string) *ParseTypeError {
|
|||||||
return &ParseTypeError{QualType: p.s.Source(), ErrMsg: errMsg}
|
return &ParseTypeError{QualType: p.s.Source(), ErrMsg: errMsg}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO(xsw): check expect results
|
||||||
func (p *parser) expect(tokExp token.Token) error {
|
func (p *parser) expect(tokExp token.Token) error {
|
||||||
p.next()
|
p.next()
|
||||||
if p.tok != tokExp {
|
if p.tok != tokExp {
|
||||||
@@ -330,6 +331,7 @@ func (p *parser) parseFunc(pkg *types.Package, t types.Type, inFlags int) (ret t
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
_ = inFlags
|
||||||
return ctypes.NewFunc(types.NewTuple(args...), results, variadic), nil
|
return ctypes.NewFunc(types.NewTuple(args...), results, variadic), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ func NewPointer(typ types.Type) types.Type {
|
|||||||
}
|
}
|
||||||
case *types.Signature:
|
case *types.Signature:
|
||||||
if gogen.IsCSignature(t) {
|
if gogen.IsCSignature(t) {
|
||||||
return types.NewSignature(nil, t.Params(), t.Results(), t.Variadic())
|
return types.NewSignatureType(nil, nil, nil, t.Params(), t.Results(), t.Variadic())
|
||||||
}
|
}
|
||||||
case *types.Named:
|
case *types.Named:
|
||||||
if typ == ValistTag {
|
if typ == ValistTag {
|
||||||
|
|||||||
Reference in New Issue
Block a user