cmd/{5,6,8,9}g, cmd/internal/gc: use bools for is* and okfor*
No functional changes.
This diff was generated as follows:
* Manually edit cmd/internal/gc/go.go to update types and group variables.
* Manually edit initialization in cmd/internal/gc/align.go--localized s/1/true.
* Manually fix the handling of sign in cmd/internal/gc/walk.go in func bounded (near line 4000).
* Manually update go.y and regenerate y.go.
* Run gofmt -r many times to do the rest, using https://gist.github.com/josharian/0f61dbb2dff81f938e70.
toolstash -cmp on the stdlib comes back green.
Change-Id: I19766ed551714e51b325133e7138818d117b3a9a
Reviewed-on: https://go-review.googlesource.com/6530
Reviewed-by: Russ Cox <rsc@golang.org>
diff --git a/src/cmd/internal/gc/dcl.go b/src/cmd/internal/gc/dcl.go
index ceececd..0eef37b 100644
--- a/src/cmd/internal/gc/dcl.go
+++ b/src/cmd/internal/gc/dcl.go
@@ -778,14 +778,14 @@
return
}
- if t.Sym == nil && Isptr[t.Etype] != 0 {
+ if t.Sym == nil && Isptr[t.Etype] {
t = t.Type
if t.Etype == TINTER {
Yyerror("embedded type cannot be a pointer to interface")
}
}
- if Isptr[t.Etype] != 0 {
+ if Isptr[t.Etype] {
Yyerror("embedded type cannot be a pointer")
} else if t.Etype == TFORW && t.Embedlineno == 0 {
t.Embedlineno = lineno
@@ -1178,7 +1178,7 @@
return false
}
t := rcvr.Type
- if Isptr[t.Etype] == 0 {
+ if !Isptr[t.Etype] {
return false
}
t = t.Type
@@ -1241,7 +1241,7 @@
goto bad
}
s = t.Sym
- if s == nil && Isptr[t.Etype] != 0 {
+ if s == nil && Isptr[t.Etype] {
t = t.Type
if t == nil {
goto bad
@@ -1269,13 +1269,13 @@
}
if (spkg == nil || nsym.Pkg != spkg) && !exportname(nsym.Name) {
- if t0.Sym == nil && Isptr[t0.Etype] != 0 {
+ if t0.Sym == nil && Isptr[t0.Etype] {
p = fmt.Sprintf("(%v).%s.%s%s", Tconv(t0, obj.FmtLeft|obj.FmtShort), nsym.Pkg.Prefix, nsym.Name, suffix)
} else {
p = fmt.Sprintf("%v.%s.%s%s", Tconv(t0, obj.FmtLeft|obj.FmtShort), nsym.Pkg.Prefix, nsym.Name, suffix)
}
} else {
- if t0.Sym == nil && Isptr[t0.Etype] != 0 {
+ if t0.Sym == nil && Isptr[t0.Etype] {
p = fmt.Sprintf("(%v).%s%s", Tconv(t0, obj.FmtLeft|obj.FmtShort), nsym.Name, suffix)
} else {
p = fmt.Sprintf("%v.%s%s", Tconv(t0, obj.FmtLeft|obj.FmtShort), nsym.Name, suffix)
@@ -1358,7 +1358,7 @@
return
}
if t != nil {
- if Isptr[t.Etype] != 0 {
+ if Isptr[t.Etype] {
if t.Sym != nil {
Yyerror("invalid receiver type %v (%v is a pointer type)", Tconv(pa, 0), Tconv(t, 0))
return
@@ -1375,7 +1375,7 @@
return
}
- if Isptr[t.Etype] != 0 {
+ if Isptr[t.Etype] {
Yyerror("invalid receiver type %v (%v is a pointer type)", Tconv(pa, 0), Tconv(t, 0))
return
}