diff options
Diffstat (limited to 'libgo/go/strconv/atoi.go')
-rw-r--r-- | libgo/go/strconv/atoi.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/libgo/go/strconv/atoi.go b/libgo/go/strconv/atoi.go index f7b8456..5845942 100644 --- a/libgo/go/strconv/atoi.go +++ b/libgo/go/strconv/atoi.go @@ -13,7 +13,6 @@ type NumError struct { func (e *NumError) String() string { return `parsing "` + e.Num + `": ` + e.Error.String() } - func computeIntsize() uint { siz := uint(8) for 1<<siz != 0 { @@ -42,6 +41,8 @@ func cutoff64(base int) uint64 { // digits, err.Error = os.EINVAL; if the value corresponding // to s cannot be represented by a uint64, err.Error = os.ERANGE. func Btoui64(s string, b int) (n uint64, err os.Error) { + var cutoff uint64 + s0 := s switch { case len(s) < 1: @@ -68,12 +69,12 @@ func Btoui64(s string, b int) (n uint64, err os.Error) { } default: - err = os.ErrorString("invalid base " + Itoa(b)) + err = os.NewError("invalid base " + Itoa(b)) goto Error } n = 0 - cutoff := cutoff64(b) + cutoff = cutoff64(b) for i := 0; i < len(s); i++ { var v byte @@ -171,7 +172,6 @@ func Btoi64(s string, base int) (i int64, err os.Error) { // returns its result in an int64. func Atoi64(s string) (i int64, err os.Error) { return Btoi64(s, 10) } - // Atoui is like Atoui64 but returns its result as a uint. func Atoui(s string) (i uint, err os.Error) { i1, e1 := Atoui64(s) |