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/swt.go b/src/cmd/internal/gc/swt.go
index 64ab47e..cf40ffc 100644
--- a/src/cmd/internal/gc/swt.go
+++ b/src/cmd/internal/gc/swt.go
@@ -87,7 +87,7 @@
if t != nil {
var badtype *Type
switch {
- case okforeq[t.Etype] == 0:
+ case !okforeq[t.Etype]:
Yyerror("cannot switch on %v", Nconv(n.Ntest, obj.FmtLong))
case t.Etype == TARRAY && !Isfixedarray(t):
nilonly = "slice"
@@ -255,7 +255,7 @@
// handle the cases in order
for len(cc) > 0 {
// deal with expressions one at a time
- if okforcmp[t.Etype] == 0 || cc[0].typ != caseKindExprConst {
+ if !okforcmp[t.Etype] || cc[0].typ != caseKindExprConst {
a := s.walkCases(cc[:1])
cas = list(cas, a)
cc = cc[1:]