aboutsummaryrefslogtreecommitdiff
path: root/test/fixedbugs
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2008-12-19 03:05:37 -0800
committerRuss Cox <rsc@golang.org>2008-12-19 03:05:37 -0800
commit08ca30bbfad04d3ca1bf7ae75c291b91ecb00aef (patch)
tree183e8cd345f5f895d2cbc36dd8f8be93640303c3 /test/fixedbugs
parentd47d888ba663014e6aa8ca043e694f4b2a5898b8 (diff)
downloadgo-08ca30bbfad04d3ca1bf7ae75c291b91ecb00aef.tar.xz
change *map to map; *chan to chan; new(T) to new(*T)
fix bugs left over from *[] to [] conversion. TBR=r OCL=21576 CL=21581
Diffstat (limited to 'test/fixedbugs')
-rw-r--r--test/fixedbugs/bug011.go2
-rw-r--r--test/fixedbugs/bug026.go4
-rw-r--r--test/fixedbugs/bug027.go14
-rw-r--r--test/fixedbugs/bug038.go2
-rw-r--r--test/fixedbugs/bug045.go2
-rw-r--r--test/fixedbugs/bug054.go8
-rw-r--r--test/fixedbugs/bug058.go4
-rw-r--r--test/fixedbugs/bug059.go2
-rw-r--r--test/fixedbugs/bug066.go2
-rw-r--r--test/fixedbugs/bug067.go2
-rw-r--r--test/fixedbugs/bug069.go2
-rw-r--r--test/fixedbugs/bug071.go2
-rw-r--r--test/fixedbugs/bug075.go4
-rw-r--r--test/fixedbugs/bug078.go2
-rw-r--r--test/fixedbugs/bug084.go2
-rw-r--r--test/fixedbugs/bug099.go2
-rw-r--r--test/fixedbugs/bug111.go2
-rw-r--r--test/fixedbugs/bug118.go2
18 files changed, 30 insertions, 30 deletions
diff --git a/test/fixedbugs/bug011.go b/test/fixedbugs/bug011.go
index 63673c0865..c2d9cde6c0 100644
--- a/test/fixedbugs/bug011.go
+++ b/test/fixedbugs/bug011.go
@@ -16,7 +16,7 @@ func (t *T) m(a int, b float) int {
}
func main() {
- var t *T = new(T);
+ var t *T = new(*T);
t.x = 1;
t.y = 2;
r10 := t.m(1, 3.0);
diff --git a/test/fixedbugs/bug026.go b/test/fixedbugs/bug026.go
index 1d97c18ae5..d8a1d77851 100644
--- a/test/fixedbugs/bug026.go
+++ b/test/fixedbugs/bug026.go
@@ -18,8 +18,8 @@ func (v *Vector) Insert(i int, e Element) {
func main() {
type I struct { val int; }; // BUG: can't be local; works if global
- v := new(Vector);
- v.Insert(0, new(I));
+ v := new(*Vector);
+ v.Insert(0, new(*I));
}
/*
check: main_sigs_I: not defined
diff --git a/test/fixedbugs/bug027.go b/test/fixedbugs/bug027.go
index 2c595cb830..95bc064127 100644
--- a/test/fixedbugs/bug027.go
+++ b/test/fixedbugs/bug027.go
@@ -15,9 +15,9 @@ type Vector struct {
}
func New() *Vector {
- v := new(Vector);
+ v := new(*Vector);
v.nelem = 0;
- v.elem = new([10]Element);
+ v.elem = new(*[10]Element);
return v;
}
@@ -33,11 +33,11 @@ func (v *Vector) Insert(e Element) {
type I struct { val int; }; // BUG: can't be local;
func main() {
- i0 := new(I); i0.val = 0;
- i1 := new(I); i1.val = 11;
- i2 := new(I); i2.val = 222;
- i3 := new(I); i3.val = 3333;
- i4 := new(I); i4.val = 44444;
+ i0 := new(*I); i0.val = 0;
+ i1 := new(*I); i1.val = 11;
+ i2 := new(*I); i2.val = 222;
+ i3 := new(*I); i3.val = 3333;
+ i4 := new(*I); i4.val = 44444;
v := New();
print("hi\n");
v.Insert(i4);
diff --git a/test/fixedbugs/bug038.go b/test/fixedbugs/bug038.go
index 7585376a36..444a04252b 100644
--- a/test/fixedbugs/bug038.go
+++ b/test/fixedbugs/bug038.go
@@ -9,5 +9,5 @@ package main
func main() {
var z [3]byte;
- z := new([3]byte); // BUG redeclaration
+ z := new(*[3]byte); // BUG redeclaration
}
diff --git a/test/fixedbugs/bug045.go b/test/fixedbugs/bug045.go
index d8a712c6da..9e94f44739 100644
--- a/test/fixedbugs/bug045.go
+++ b/test/fixedbugs/bug045.go
@@ -13,7 +13,7 @@ type T struct {
func main() {
var ta []*T;
- ta = new([1]*T);
+ ta = new(*[1]*T);
ta[0] = nil;
}
/*
diff --git a/test/fixedbugs/bug054.go b/test/fixedbugs/bug054.go
index decf5841df..f4d7c27faa 100644
--- a/test/fixedbugs/bug054.go
+++ b/test/fixedbugs/bug054.go
@@ -30,12 +30,12 @@ func (s *TStruct) field(i int) *TStruct {
}
func main() {
- v := new(Vector);
- v.elem = new([10]Element);
- t := new(TStruct);
+ v := new(*Vector);
+ v.elem = new(*[10]Element);
+ t := new(*TStruct);
t.name = "hi";
v.elem[0] = t;
- s := new(TStruct);
+ s := new(*TStruct);
s.name = "foo";
s.fields = v;
if s.field(0).name != "hi" {
diff --git a/test/fixedbugs/bug058.go b/test/fixedbugs/bug058.go
index f44181546b..2cfe19de4a 100644
--- a/test/fixedbugs/bug058.go
+++ b/test/fixedbugs/bug058.go
@@ -7,8 +7,8 @@
package main
type Box struct {};
-var m *map[string] *Box;
-
+var m map[string] *Box;
+
func main() {
m := new(map[string] *Box);
s := "foo";
diff --git a/test/fixedbugs/bug059.go b/test/fixedbugs/bug059.go
index 5a29ed1f09..55c05f6806 100644
--- a/test/fixedbugs/bug059.go
+++ b/test/fixedbugs/bug059.go
@@ -20,7 +20,7 @@ func P(a []string) string {
func main() {
m := new(map[string] []string);
- as := new([2]string);
+ as := new(*[2]string);
as[0] = "0";
as[1] = "1";
m["0"] = as;
diff --git a/test/fixedbugs/bug066.go b/test/fixedbugs/bug066.go
index ab69257920..4f64152aec 100644
--- a/test/fixedbugs/bug066.go
+++ b/test/fixedbugs/bug066.go
@@ -12,7 +12,7 @@ type (
)
type Scope struct {
- entries *map[string] *Object;
+ entries map[string] *Object;
}
diff --git a/test/fixedbugs/bug067.go b/test/fixedbugs/bug067.go
index fd22cd6f89..1e747ebba8 100644
--- a/test/fixedbugs/bug067.go
+++ b/test/fixedbugs/bug067.go
@@ -6,7 +6,7 @@
package main
-var c *chan int
+var c chan int
func main() {
c = new(chan int);
diff --git a/test/fixedbugs/bug069.go b/test/fixedbugs/bug069.go
index 51e034d654..2e538469b3 100644
--- a/test/fixedbugs/bug069.go
+++ b/test/fixedbugs/bug069.go
@@ -13,6 +13,6 @@ func main(){
i, ok = <-c; // works
- ca := new([2]*chan int);
+ ca := new(*[2]chan int);
i, ok = <-(ca[0]); // fails: c.go:11: bad shape across assignment - cr=1 cl=2
}
diff --git a/test/fixedbugs/bug071.go b/test/fixedbugs/bug071.go
index 8af54626ee..665a441bdb 100644
--- a/test/fixedbugs/bug071.go
+++ b/test/fixedbugs/bug071.go
@@ -14,7 +14,7 @@ func (u *rat) pr() {
}
type dch struct {
- dat *chan *rat;
+ dat chan *rat;
}
func dosplit(in *dch){
diff --git a/test/fixedbugs/bug075.go b/test/fixedbugs/bug075.go
index 01b0fe0e7f..c1b8647453 100644
--- a/test/fixedbugs/bug075.go
+++ b/test/fixedbugs/bug075.go
@@ -6,9 +6,9 @@
package main
-type T struct { m *map[int]int }
+type T struct { m map[int]int }
func main() {
- t := new(T);
+ t := new(*T);
t.m = new(map[int]int);
var x int;
var ok bool;
diff --git a/test/fixedbugs/bug078.go b/test/fixedbugs/bug078.go
index 3ffadb7d00..ddd3faeba4 100644
--- a/test/fixedbugs/bug078.go
+++ b/test/fixedbugs/bug078.go
@@ -6,7 +6,7 @@
package main
-func dosplit(wait *chan int ){
+func dosplit(wait chan int ){
select {
case <-wait:
}
diff --git a/test/fixedbugs/bug084.go b/test/fixedbugs/bug084.go
index a5ccdb37c5..138b6da4b1 100644
--- a/test/fixedbugs/bug084.go
+++ b/test/fixedbugs/bug084.go
@@ -18,6 +18,6 @@ var arith Service
func main() {
c := new(chan string);
- a := new(Service);
+ a := new(*Service);
go a.Serve(1234);
}
diff --git a/test/fixedbugs/bug099.go b/test/fixedbugs/bug099.go
index f76f0e873c..2b1776c1f5 100644
--- a/test/fixedbugs/bug099.go
+++ b/test/fixedbugs/bug099.go
@@ -18,7 +18,7 @@ func (s *S) F() int { return 1 }
// if you take it out (and the 0s below)
// then the bug goes away.
func NewI(i int) I {
- return new(S)
+ return new(*S)
}
// Uses interface method.
diff --git a/test/fixedbugs/bug111.go b/test/fixedbugs/bug111.go
index 39da9b4dd6..ee61cd8302 100644
--- a/test/fixedbugs/bug111.go
+++ b/test/fixedbugs/bug111.go
@@ -22,7 +22,7 @@ func (s *Stucky) Me() Iffy {
}
func main() {
- s := new(Stucky);
+ s := new(*Stucky);
i := s.Me();
j := i.Me();
j.Me();
diff --git a/test/fixedbugs/bug118.go b/test/fixedbugs/bug118.go
index 778b533c76..d508d83533 100644
--- a/test/fixedbugs/bug118.go
+++ b/test/fixedbugs/bug118.go
@@ -6,7 +6,7 @@
package main
-export func Send(c *chan int) int {
+export func Send(c chan int) int {
select {
default:
return 1;