summaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2009-11-09 12:07:39 -0800
committerRobert Griesemer <gri@golang.org>2009-11-09 12:07:39 -0800
commite940edc7a026293153ba09ece40e8092a2fc2463 (patch)
treec94a425c84b7a48f91a5d76a222effad70c9a88c /misc
parente067f862f1774ab89a2096a88571a94e3b9cd353 (diff)
downloadgolang-e940edc7a026293153ba09ece40e8092a2fc2463.tar.gz
remove semis after statements in one-statement statement lists
R=rsc, r http://go/go-review/1025029
Diffstat (limited to 'misc')
-rw-r--r--misc/cgo/gmp/fib.go4
-rw-r--r--misc/cgo/gmp/gmp.go24
-rw-r--r--misc/cgo/gmp/pi.go6
-rw-r--r--misc/cgo/stdio/fib.go2
-rw-r--r--misc/cgo/stdio/hello.go2
5 files changed, 19 insertions, 19 deletions
diff --git a/misc/cgo/gmp/fib.go b/misc/cgo/gmp/fib.go
index 02b98b108..1ff156ef2 100644
--- a/misc/cgo/gmp/fib.go
+++ b/misc/cgo/gmp/fib.go
@@ -22,7 +22,7 @@ func fibber(c chan *big.Int, out chan string, n int64) {
i := big.NewInt(n);
if n == 0 {
- c <- i;
+ c <- i
}
for {
j := <-c;
@@ -38,6 +38,6 @@ func main() {
go fibber(c, out, 0);
go fibber(c, out, 1);
for i := 0; i < 200; i++ {
- println(<-out);
+ println(<-out)
}
}
diff --git a/misc/cgo/gmp/gmp.go b/misc/cgo/gmp/gmp.go
index a876f9cbc..5a21c5384 100644
--- a/misc/cgo/gmp/gmp.go
+++ b/misc/cgo/gmp/gmp.go
@@ -130,7 +130,7 @@ func NewInt(x int64) *Int { return new(Int).SetInt64(x) }
// making zero values useful and gmp's decision not to.
func (z *Int) doinit() {
if z.init {
- return;
+ return
}
z.init = true;
C.mpz_init(&z.i[0]);
@@ -162,9 +162,9 @@ func (z *Int) Set(x *Int) *Int {
func (z *Int) SetBytes(b []byte) *Int {
z.doinit();
if len(b) == 0 {
- z.SetInt64(0);
+ z.SetInt64(0)
} else {
- C.mpz_import(&z.i[0], C.size_t(len(b)), 1, 1, 1, 0, unsafe.Pointer(&b[0]));
+ C.mpz_import(&z.i[0], C.size_t(len(b)), 1, 1, 1, 0, unsafe.Pointer(&b[0]))
}
return z;
}
@@ -183,12 +183,12 @@ func (z *Int) SetInt64(x int64) *Int {
func (z *Int) SetString(s string, base int) os.Error {
z.doinit();
if base < 2 || base > 36 {
- return os.EINVAL;
+ return os.EINVAL
}
p := C.CString(s);
defer C.free(unsafe.Pointer(p));
if C.mpz_set_str(&z.i[0], p, C.int(base)) < 0 {
- return os.EINVAL;
+ return os.EINVAL
}
return z;
}
@@ -196,7 +196,7 @@ func (z *Int) SetString(s string, base int) os.Error {
// String returns the decimal representation of z.
func (z *Int) String() string {
if z == nil {
- return "nil";
+ return "nil"
}
z.doinit();
p := C.mpz_get_str(nil, 10, &z.i[0]);
@@ -207,7 +207,7 @@ func (z *Int) String() string {
func (z *Int) destroy() {
if z.init {
- C.mpz_clear(&z.i[0]);
+ C.mpz_clear(&z.i[0])
}
z.init = false;
}
@@ -287,16 +287,16 @@ func (z *Int) Exp(x, y, m *Int) *Int {
y.doinit();
z.doinit();
if m == nil {
- C.mpz_pow_ui(&z.i[0], &x.i[0], C.mpz_get_ui(&y.i[0]));
+ C.mpz_pow_ui(&z.i[0], &x.i[0], C.mpz_get_ui(&y.i[0]))
} else {
- C.mpz_powm(&z.i[0], &x.i[0], &y.i[0], &m.i[0]);
+ C.mpz_powm(&z.i[0], &x.i[0], &y.i[0], &m.i[0])
}
return z;
}
func (z *Int) Int64() int64 {
if !z.init {
- return 0;
+ return 0
}
return int64(C.mpz_get_si(&z.i[0]));
}
@@ -334,9 +334,9 @@ func CmpInt(x, y *Int) int {
y.doinit();
switch cmp := C.mpz_cmp(&x.i[0], &y.i[0]); {
case cmp < 0:
- return -1;
+ return -1
case cmp == 0:
- return 0;
+ return 0
}
return +1;
}
diff --git a/misc/cgo/gmp/pi.go b/misc/cgo/gmp/pi.go
index b03fa2c11..61b88a417 100644
--- a/misc/cgo/gmp/pi.go
+++ b/misc/cgo/gmp/pi.go
@@ -54,13 +54,13 @@ var (
func extractDigit() int64 {
if big.CmpInt(numer, accum) > 0 {
- return -1;
+ return -1
}
tmp1.Lsh(numer, 1).Add(tmp1, numer).Add(tmp1, accum);
big.DivModInt(tmp1, tmp2, tmp1, denom);
tmp2.Add(tmp2, numer);
if big.CmpInt(tmp2, denom) >= 0 {
- return -1;
+ return -1
}
return tmp1.Int64();
}
@@ -95,7 +95,7 @@ func main() {
if i++; i%50 == 0 {
fmt.Printf("\n");
if i >= 1000 {
- break;
+ break
}
}
}
diff --git a/misc/cgo/stdio/fib.go b/misc/cgo/stdio/fib.go
index 972057e11..1e2336d5b 100644
--- a/misc/cgo/stdio/fib.go
+++ b/misc/cgo/stdio/fib.go
@@ -22,7 +22,7 @@ func fibber(c, out chan int64, i int64) {
runtime.LockOSThread();
if i == 0 {
- c <- i;
+ c <- i
}
for {
j := <-c;
diff --git a/misc/cgo/stdio/hello.go b/misc/cgo/stdio/hello.go
index c2555d008..47f9de02f 100644
--- a/misc/cgo/stdio/hello.go
+++ b/misc/cgo/stdio/hello.go
@@ -8,5 +8,5 @@ import "stdio"
func main() {
// stdio.Stdout.WriteString("hello, world\n");
- stdio.Puts("hello, world");
+ stdio.Puts("hello, world")
}