diff options
author | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-12-03 02:17:34 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-12-03 02:17:34 +0000 |
commit | 2fd401c8f190f1fe43e51a7f726f6ed6119a1f96 (patch) | |
tree | 7f76eff391f37fe6467ff4ffbc0c582c9959ea30 /libgo/go/encoding/ascii85/ascii85.go | |
parent | 02e9018f1616b23f1276151797216717b3564202 (diff) | |
download | gcc-2fd401c8f190f1fe43e51a7f726f6ed6119a1f96.zip gcc-2fd401c8f190f1fe43e51a7f726f6ed6119a1f96.tar.gz gcc-2fd401c8f190f1fe43e51a7f726f6ed6119a1f96.tar.bz2 |
libgo: Update to weekly.2011-11-02.
From-SVN: r181964
Diffstat (limited to 'libgo/go/encoding/ascii85/ascii85.go')
-rw-r--r-- | libgo/go/encoding/ascii85/ascii85.go | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/libgo/go/encoding/ascii85/ascii85.go b/libgo/go/encoding/ascii85/ascii85.go index ead0c24..6f592f3 100644 --- a/libgo/go/encoding/ascii85/ascii85.go +++ b/libgo/go/encoding/ascii85/ascii85.go @@ -8,7 +8,6 @@ package ascii85 import ( "io" - "os" "strconv" ) @@ -93,14 +92,14 @@ func MaxEncodedLen(n int) int { return (n + 3) / 4 * 5 } func NewEncoder(w io.Writer) io.WriteCloser { return &encoder{w: w} } type encoder struct { - err os.Error + err error w io.Writer buf [4]byte // buffered data waiting to be encoded nbuf int // number of bytes in buf out [1024]byte // output buffer } -func (e *encoder) Write(p []byte) (n int, err os.Error) { +func (e *encoder) Write(p []byte) (n int, err error) { if e.err != nil { return 0, e.err } @@ -152,7 +151,7 @@ func (e *encoder) Write(p []byte) (n int, err os.Error) { // Close flushes any pending output from the encoder. // It is an error to call Write after calling Close. -func (e *encoder) Close() os.Error { +func (e *encoder) Close() error { // If there's anything left in the buffer, flush it out if e.err == nil && e.nbuf > 0 { nout := Encode(e.out[0:], e.buf[0:e.nbuf]) @@ -168,7 +167,7 @@ func (e *encoder) Close() os.Error { type CorruptInputError int64 -func (e CorruptInputError) String() string { +func (e CorruptInputError) Error() string { return "illegal ascii85 data at input byte " + strconv.Itoa64(int64(e)) } @@ -186,7 +185,7 @@ func (e CorruptInputError) String() string { // // NewDecoder wraps an io.Reader interface around Decode. // -func Decode(dst, src []byte, flush bool) (ndst, nsrc int, err os.Error) { +func Decode(dst, src []byte, flush bool) (ndst, nsrc int, err error) { var v uint32 var nb int for i, b := range src { @@ -246,8 +245,8 @@ func Decode(dst, src []byte, flush bool) (ndst, nsrc int, err os.Error) { func NewDecoder(r io.Reader) io.Reader { return &decoder{r: r} } type decoder struct { - err os.Error - readErr os.Error + err error + readErr error r io.Reader end bool // saw end of message buf [1024]byte // leftover input @@ -256,7 +255,7 @@ type decoder struct { outbuf [1024]byte } -func (d *decoder) Read(p []byte) (n int, err os.Error) { +func (d *decoder) Read(p []byte) (n int, err error) { if len(p) == 0 { return 0, nil } |