~ubuntu-branches/ubuntu/vivid/golang/vivid

« back to all changes in this revision

Viewing changes to src/pkg/strconv/atoi.go

  • Committer: Bazaar Package Importer
  • Author(s): Ondřej Surý
  • Date: 2011-08-03 17:04:59 UTC
  • mfrom: (14.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20110803170459-wzd99m3567y80ila
Tags: 1:59-1
* Imported Upstream version 59
* Refresh patches to a new release
* Fix FTBFS on ARM (Closes: #634270)
* Update version.bash to work with Debian packaging and not hg
  repository

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
// digits, err.Error = os.EINVAL; if the value corresponding
43
43
// to s cannot be represented by a uint64, err.Error = os.ERANGE.
44
44
func Btoui64(s string, b int) (n uint64, err os.Error) {
 
45
        var cutoff uint64
 
46
 
45
47
        s0 := s
46
48
        switch {
47
49
        case len(s) < 1:
68
70
                }
69
71
 
70
72
        default:
71
 
                err = os.ErrorString("invalid base " + Itoa(b))
 
73
                err = os.NewError("invalid base " + Itoa(b))
72
74
                goto Error
73
75
        }
74
76
 
75
77
        n = 0
76
 
        cutoff := cutoff64(b)
 
78
        cutoff = cutoff64(b)
77
79
 
78
80
        for i := 0; i < len(s); i++ {
79
81
                var v byte