use new strconv API

All but 3 cases (in gcimporter.go and hixie.go)
are automatic conversions using gofix.

No attempt is made to use the new Append functions
even though there are definitely opportunities.

R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/5447069
This commit is contained in:
Russ Cox 2011-12-05 15:48:46 -05:00
parent efbeaedb64
commit 2666b815a3
57 changed files with 150 additions and 153 deletions

View file

@ -355,7 +355,7 @@ func (p *Package) guessKinds(f *File) []*Name {
// with enum-derived constants. Otherwise
// in the cgo -godefs output half the constants
// are in hex and half are in whatever the #define used.
i, err := strconv.Btoi64(n.Define, 0)
i, err := strconv.ParseInt(n.Define, 0, 64)
if err == nil {
n.Const = fmt.Sprintf("%#x", i)
} else {
@ -1333,7 +1333,7 @@ func (c *typeConv) Opaque(n int64) ast.Expr {
func (c *typeConv) intExpr(n int64) ast.Expr {
return &ast.BasicLit{
Kind: token.INT,
Value: strconv.Itoa64(n),
Value: strconv.FormatInt(n, 10),
}
}