diff options
author | Ian Lance Taylor <iant@google.com> | 2011-01-21 18:19:03 +0000 |
---|---|---|
committer | Ian Lance Taylor <ian@gcc.gnu.org> | 2011-01-21 18:19:03 +0000 |
commit | ff5f50c52c421d75940ef9392211e3ab24d71332 (patch) | |
tree | 27d8768fb1d25696d3c40b42535eb5e073c278da /libgo/go/fmt/format.go | |
parent | d6ed1c8903e728f4233122554bab5910853338bd (diff) | |
download | gcc-ff5f50c52c421d75940ef9392211e3ab24d71332.zip gcc-ff5f50c52c421d75940ef9392211e3ab24d71332.tar.gz gcc-ff5f50c52c421d75940ef9392211e3ab24d71332.tar.bz2 |
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.
From-SVN: r169098
Diffstat (limited to 'libgo/go/fmt/format.go')
-rw-r--r-- | libgo/go/fmt/format.go | 44 |
1 files changed, 11 insertions, 33 deletions
diff --git a/libgo/go/fmt/format.go b/libgo/go/fmt/format.go index 3ec1cf1..86057bf 100644 --- a/libgo/go/fmt/format.go +++ b/libgo/go/fmt/format.go @@ -49,6 +49,7 @@ type fmt struct { plus bool sharp bool space bool + unicode bool zero bool } @@ -61,6 +62,7 @@ func (f *fmt) clearflags() { f.plus = false f.sharp = false f.space = false + f.unicode = false f.zero = false } @@ -213,6 +215,12 @@ func (f *fmt) integer(a int64, base uint64, signedness bool, digits string) { buf[i] = '0' } } + if f.unicode { + i-- + buf[i] = '+' + i-- + buf[i] = 'U' + } if negative { i-- @@ -255,6 +263,9 @@ func (f *fmt) fmt_sx(s string) { func (f *fmt) fmt_sX(s string) { t := "" for i := 0; i < len(s); i++ { + if i > 0 && f.space { + t += " " + } v := s[i] t += string(udigits[v>>4]) t += string(udigits[v&0xF]) @@ -385,36 +396,3 @@ func (f *fmt) fmt_c128(v complex128, verb int) { } f.buf.Write(irparenBytes) } - -// float -func (x *fmt) f(a float) { - if strconv.FloatSize == 32 { - x.fmt_f32(float32(a)) - } else { - x.fmt_f64(float64(a)) - } -} - -func (x *fmt) e(a float) { - if strconv.FloatSize == 32 { - x.fmt_e32(float32(a)) - } else { - x.fmt_e64(float64(a)) - } -} - -func (x *fmt) g(a float) { - if strconv.FloatSize == 32 { - x.fmt_g32(float32(a)) - } else { - x.fmt_g64(float64(a)) - } -} - -func (x *fmt) fb(a float) { - if strconv.FloatSize == 32 { - x.fmt_fb32(float32(a)) - } else { - x.fmt_fb64(float64(a)) - } -} |