diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-21 18:19:03 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-01-21 18:19:03 +0000 |
commit | 48080209fa53b6ea88c86e9f445c431b4cd1e47b (patch) | |
tree | 27d8768fb1d25696d3c40b42535eb5e073c278da /libgo/go/encoding/binary/binary.go | |
parent | bff898fbbe4358a4b7e337852df4d6043e0bd3f5 (diff) | |
download | ppe42-gcc-48080209fa53b6ea88c86e9f445c431b4cd1e47b.tar.gz ppe42-gcc-48080209fa53b6ea88c86e9f445c431b4cd1e47b.zip |
Remove the types float and complex.
Update to current version of Go library.
Update testsuite for removed types.
* go-lang.c (go_langhook_init): Omit float_type_size when calling
go_create_gogo.
* go-c.h: Update declaration of go_create_gogo.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@169098 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/encoding/binary/binary.go')
-rw-r--r-- | libgo/go/encoding/binary/binary.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libgo/go/encoding/binary/binary.go b/libgo/go/encoding/binary/binary.go index ebc2ae8b7cf..77ff3a9f3ef 100644 --- a/libgo/go/encoding/binary/binary.go +++ b/libgo/go/encoding/binary/binary.go @@ -198,6 +198,10 @@ func sizeof(v reflect.Type) int { return sum case *reflect.UintType, *reflect.IntType, *reflect.FloatType, *reflect.ComplexType: + switch t := t.Kind(); t { + case reflect.Int, reflect.Uint, reflect.Uintptr: + return -1 + } return int(v.Size()) } return -1 @@ -327,12 +331,12 @@ func (d *decoder) value(v reflect.Value) { case *reflect.ComplexValue: switch v.Type().Kind() { case reflect.Complex64: - v.Set(cmplx( + v.Set(complex( float64(math.Float32frombits(d.uint32())), float64(math.Float32frombits(d.uint32())), )) case reflect.Complex128: - v.Set(cmplx( + v.Set(complex( math.Float64frombits(d.uint64()), math.Float64frombits(d.uint64()), )) |