summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-07-27 11:23:49 -0700
committerRuss Cox <rsc@golang.org>2009-07-27 11:23:49 -0700
commit2fbe664ef546cf6c0fc72bb94099d637d29a204d (patch)
tree8f7092a20a019ee4aedc8d070a6bc0c64cbf31d3
parentc8e43d6ee052cf72b1cd037baceb19f16ed9b038 (diff)
downloadgolang-2fbe664ef546cf6c0fc72bb94099d637d29a204d.tar.gz
fix build - broke with uint32 -> int change in reflect SliceHeader
TBR=r OCL=32225 CL=32225
-rw-r--r--src/pkg/gob/decode.go4
-rw-r--r--src/pkg/reflect/value.go10
2 files changed, 7 insertions, 7 deletions
diff --git a/src/pkg/gob/decode.go b/src/pkg/gob/decode.go
index a9148eb83..7e439e8e7 100644
--- a/src/pkg/gob/decode.go
+++ b/src/pkg/gob/decode.go
@@ -446,8 +446,8 @@ func decodeSlice(atyp *reflect.SliceType, state *decodeState, p uintptr, elemOp
// Always write a header at p.
hdrp := (*reflect.SliceHeader)(unsafe.Pointer(p));
hdrp.Data = uintptr(unsafe.Pointer(&data[0]));
- hdrp.Len = uint32(length);
- hdrp.Cap = uint32(length);
+ hdrp.Len = int(length);
+ hdrp.Cap = int(length);
return decodeArrayHelper(state, hdrp.Data, elemOp, elemWid, int(length), elemIndir);
}
diff --git a/src/pkg/reflect/value.go b/src/pkg/reflect/value.go
index 00772a87c..4dc130a6c 100644
--- a/src/pkg/reflect/value.go
+++ b/src/pkg/reflect/value.go
@@ -559,7 +559,7 @@ func (v *SliceValue) SetLen(n int) {
if n < 0 || n > int(s.Cap) {
panicln("SetLen", n, "with capacity", s.Cap);
}
- s.Len = uint32(n);
+ s.Len = n;
}
// Set assigns x to v.
@@ -581,8 +581,8 @@ func (v *SliceValue) Slice(beg, end int) *SliceValue {
typ := v.typ.(*SliceType);
s := new(SliceHeader);
s.Data = uintptr(v.addr()) + uintptr(beg) * typ.Elem().Size();
- s.Len = uint32(end - beg);
- s.Cap = uint32(cap - beg);
+ s.Len = end - beg;
+ s.Cap = cap - beg;
return newValue(typ, addr(s), v.canSet).(*SliceValue);
}
@@ -607,8 +607,8 @@ func MakeSlice(typ *SliceType, len, cap int) *SliceValue {
}
data := make([]uint8, size);
s.Data = uintptr(addr(&data[0]));
- s.Len = uint32(len);
- s.Cap = uint32(cap);
+ s.Len = len;
+ s.Cap = cap;
return newValue(typ, addr(s), true).(*SliceValue);
}