delete float, complex - code changes

also:
	cmplx -> complex
	float64(1.0) -> 1.0
	float64(1) -> 1.0

R=gri, r, gri1, r2
CC=golang-dev
https://golang.org/cl/3991043
This commit is contained in:
Russ Cox 2011-01-19 23:09:00 -05:00
parent 0849944694
commit f2b5a07453
122 changed files with 3309 additions and 3523 deletions

View file

@ -333,7 +333,7 @@ func decComplex64(i *decInstr, state *decodeState, p unsafe.Pointer) {
p = *(*unsafe.Pointer)(p)
}
storeFloat32(i, state, p)
storeFloat32(i, state, unsafe.Pointer(uintptr(p)+uintptr(unsafe.Sizeof(float(0)))))
storeFloat32(i, state, unsafe.Pointer(uintptr(p)+uintptr(unsafe.Sizeof(float32(0)))))
}
func decComplex128(i *decInstr, state *decodeState, p unsafe.Pointer) {
@ -345,7 +345,7 @@ func decComplex128(i *decInstr, state *decodeState, p unsafe.Pointer) {
}
real := floatFromBits(uint64(state.decodeUint()))
imag := floatFromBits(uint64(state.decodeUint()))
*(*complex128)(p) = cmplx(real, imag)
*(*complex128)(p) = complex(real, imag)
}
// uint8 arrays are encoded as an unsigned count followed by the raw bytes.
@ -993,20 +993,6 @@ func (dec *Decoder) decode(wireId typeId, val reflect.Value) os.Error {
}
func init() {
var fop, cop decOp
switch reflect.Typeof(float(0)).Bits() {
case 32:
fop = decFloat32
cop = decComplex64
case 64:
fop = decFloat64
cop = decComplex128
default:
panic("gob: unknown size of float")
}
decOpMap[reflect.Float] = fop
decOpMap[reflect.Complex] = cop
var iop, uop decOp
switch reflect.Typeof(int(0)).Bits() {
case 32: