1
0
mirror of https://github.com/golang/go synced 2024-11-22 01:44:40 -07:00

convert non-pkg go files to whole-package compilation.

mostly removing forward declarations.

R=r
DELTA=138  (2 added, 127 deleted, 9 changed)
OCL=33068
CL=33099
This commit is contained in:
Russ Cox 2009-08-12 13:18:54 -07:00
parent eda49f331f
commit 5b62b19d43
13 changed files with 11 additions and 140 deletions

View File

@ -41,8 +41,6 @@ var chnames string
var chnameserial int
var seqno int
func Init();
func mkdch() *dch {
c := chnameserial % len(chnames);
chnameserial++;

View File

@ -50,8 +50,6 @@ var chnames string
var chnameserial int
var seqno int
func Init();
func mkdch() *dch {
c := chnameserial % len(chnames);
chnameserial++;

View File

@ -1,23 +0,0 @@
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// $G $D/$F.go && $L $F.$A && ./$A.out
// Forward declarations
package main
func f (x int) ; // this works
func f (x int) {}
func i (x, y int) ; // this works
func i (x, y int) {}
func g (x int) float ; // BUG this doesn't
func g (x int) float { return 0.0 }
func h (x int) (u int, v int) ; // BUG this doesn't
func h (x int) (u int, v int) { return; }
func main() {}

View File

@ -1,29 +0,0 @@
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// $G $D/$F.go && $L $F.$A && ./$A.out
package main
type S struct {
};
func (p *S) M1a() ;
func (p *S) M2a() {
p.M1a();
}
func (p *S) M1a() {} // this works
func (p *S) M1b() int;
func (p *S) M2b() {
p.M1b();
}
func (p *S) M1b() int { return 0 } // BUG this doesn't
func main() {}

View File

@ -9,7 +9,7 @@ package P
var x int
func foo() {
print(P.x); // P should be defined between the outermost "universe" scope and the global scope
print(P.x); // ERROR "undefined"
}
/*

View File

@ -87,9 +87,6 @@ func (m *HashMap) Probe (key *KeyType) *Entry {
}
func (m *HashMap) Resize();
func (m *HashMap) Lookup (key *KeyType, insert bool) *Entry {
// Find a matching entry.
var p *Entry = m.Probe(key);

View File

@ -19,6 +19,5 @@ type I2 interface {
}
type T int
func (t T) bar() I1;
func (t T) foo() I2 { return t }
func (t T) bar() I1 { return t }

View File

@ -6,8 +6,6 @@
package main
func simple(ia,ib,ic int) (oa,ob int);
func
main()
{

View File

@ -13,8 +13,6 @@ type C struct
x func(p *C)int;
}
func g(p *C)int;
func
(this *C) f()int
{

View File

@ -36,8 +36,6 @@ type Slist struct {
}
func (this *Slist) Print();
func (this *Slist) Car() *Slist {
return this.list.car;
}
@ -67,9 +65,6 @@ func (slist *Slist) Free() {
// free(slist);
}
func OpenFile();
func Parse() *Slist;
//Slist* atom(byte *s, int i);
var token int;

View File

@ -7,8 +7,6 @@
package main
func fun(ia,ib,ic int)int;
func
main()
{

View File

@ -2,67 +2,10 @@
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# DO NOT EDIT. Automatically generated by gobuild.
# gobuild -m >Makefile
include $(GOROOT)/src/Make.$(GOARCH)
D=
TARG=iterable
GOFILES=\
iterable.go\
O_arm=5
O_amd64=6
O_386=8
OS=568vq
O=$(O_$(GOARCH))
GC=$(O)g -I_obj
CC=$(O)c -FVw
AS=$(O)a
AR=6ar
default: packages
clean:
rm -rf *.[$(OS)] *.a [$(OS)].out _obj
test: packages
gotest
coverage: packages
gotest
6cov -g `pwd` | grep -v '_test\.go:'
%.$O: %.go
$(GC) $*.go
%.$O: %.c
$(CC) $*.c
%.$O: %.s
$(AS) $*.s
O1=\
iterable.$O\
phases: a1
_obj$D/iterable.a: phases
a1: $(O1)
$(AR) grc _obj$D/iterable.a iterable.$O
rm -f $(O1)
newpkg: clean
mkdir -p _obj$D
$(AR) grc _obj$D/iterable.a
$(O1): newpkg
$(O2): a1
nuke: clean
rm -f $(GOROOT)/pkg$D/iterable.a
packages: _obj$D/iterable.a
install: packages
test -d $(GOROOT)/pkg && mkdir -p $(GOROOT)/pkg$D
cp _obj$D/iterable.a $(GOROOT)/pkg$D/iterable.a
include $(GOROOT)/src/Make.pkg

View File

@ -5,7 +5,6 @@
package iterable
import (
"iterable";
"testing";
)