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/hash | |
parent | 02e9018f1616b23f1276151797216717b3564202 (diff) | |
download | gcc-2fd401c8f190f1fe43e51a7f726f6ed6119a1f96.tar.gz |
libgo: Update to weekly.2011-11-02.
From-SVN: r181964
Diffstat (limited to 'libgo/go/hash')
-rw-r--r-- | libgo/go/hash/adler32/adler32.go | 7 | ||||
-rw-r--r-- | libgo/go/hash/crc32/crc32.go | 3 | ||||
-rw-r--r-- | libgo/go/hash/crc64/crc64.go | 7 | ||||
-rw-r--r-- | libgo/go/hash/fnv/fnv.go | 9 |
4 files changed, 9 insertions, 17 deletions
diff --git a/libgo/go/hash/adler32/adler32.go b/libgo/go/hash/adler32/adler32.go index 84943d9ae4c..10bed2f05e4 100644 --- a/libgo/go/hash/adler32/adler32.go +++ b/libgo/go/hash/adler32/adler32.go @@ -11,10 +11,7 @@ // significant-byte first (network) order. package adler32 -import ( - "hash" - "os" -) +import "hash" const ( mod = 65521 @@ -67,7 +64,7 @@ func finish(a, b uint32) uint32 { return b<<16 | a } -func (d *digest) Write(p []byte) (nn int, err os.Error) { +func (d *digest) Write(p []byte) (nn int, err error) { d.a, d.b = update(d.a, d.b, p) return len(p), nil } diff --git a/libgo/go/hash/crc32/crc32.go b/libgo/go/hash/crc32/crc32.go index 0245b1ee8a8..5980ec0dc98 100644 --- a/libgo/go/hash/crc32/crc32.go +++ b/libgo/go/hash/crc32/crc32.go @@ -9,7 +9,6 @@ package crc32 import ( "hash" - "os" "sync" ) @@ -113,7 +112,7 @@ func Update(crc uint32, tab *Table, p []byte) uint32 { return update(crc, tab, p) } -func (d *digest) Write(p []byte) (n int, err os.Error) { +func (d *digest) Write(p []byte) (n int, err error) { d.crc = Update(d.crc, d.tab, p) return len(p), nil } diff --git a/libgo/go/hash/crc64/crc64.go b/libgo/go/hash/crc64/crc64.go index ae37e781cd0..42e53c3a5bd 100644 --- a/libgo/go/hash/crc64/crc64.go +++ b/libgo/go/hash/crc64/crc64.go @@ -7,10 +7,7 @@ // information. package crc64 -import ( - "hash" - "os" -) +import "hash" // The size of a CRC-64 checksum in bytes. const Size = 8 @@ -71,7 +68,7 @@ func Update(crc uint64, tab *Table, p []byte) uint64 { return update(crc, tab, p) } -func (d *digest) Write(p []byte) (n int, err os.Error) { +func (d *digest) Write(p []byte) (n int, err error) { d.crc = update(d.crc, d.tab, p) return len(p), nil } diff --git a/libgo/go/hash/fnv/fnv.go b/libgo/go/hash/fnv/fnv.go index 3ff7d7c75d7..ce3ed0d0f40 100644 --- a/libgo/go/hash/fnv/fnv.go +++ b/libgo/go/hash/fnv/fnv.go @@ -10,7 +10,6 @@ package fnv import ( "encoding/binary" "hash" - "os" ) type ( @@ -61,7 +60,7 @@ func (s *sum32a) Sum32() uint32 { return uint32(*s) } func (s *sum64) Sum64() uint64 { return uint64(*s) } func (s *sum64a) Sum64() uint64 { return uint64(*s) } -func (s *sum32) Write(data []byte) (int, os.Error) { +func (s *sum32) Write(data []byte) (int, error) { hash := *s for _, c := range data { hash *= prime32 @@ -71,7 +70,7 @@ func (s *sum32) Write(data []byte) (int, os.Error) { return len(data), nil } -func (s *sum32a) Write(data []byte) (int, os.Error) { +func (s *sum32a) Write(data []byte) (int, error) { hash := *s for _, c := range data { hash ^= sum32a(c) @@ -81,7 +80,7 @@ func (s *sum32a) Write(data []byte) (int, os.Error) { return len(data), nil } -func (s *sum64) Write(data []byte) (int, os.Error) { +func (s *sum64) Write(data []byte) (int, error) { hash := *s for _, c := range data { hash *= prime64 @@ -91,7 +90,7 @@ func (s *sum64) Write(data []byte) (int, os.Error) { return len(data), nil } -func (s *sum64a) Write(data []byte) (int, os.Error) { +func (s *sum64a) Write(data []byte) (int, error) { hash := *s for _, c := range data { hash ^= sum64a(c) |