Commit b50ff580 authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

cmd/internal/ld: minor int to bool cleanup

Change-Id: I3078385f5e7c92fbf99af7c4ae8918c86b9f86c9
Reviewed-on: https://go-review.googlesource.com/6500Reviewed-by: default avatarRuss Cox <rsc@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
parent ce1c9247
...@@ -266,7 +266,7 @@ var version int ...@@ -266,7 +266,7 @@ var version int
// Set if we see an object compiled by the host compiler that is not // Set if we see an object compiled by the host compiler that is not
// from a package that is known to support internal linking mode. // from a package that is known to support internal linking mode.
var externalobj int = 0 var externalobj = false
var goroot string var goroot string
...@@ -394,7 +394,7 @@ func loadlib() { ...@@ -394,7 +394,7 @@ func loadlib() {
} }
if Linkmode == LinkAuto { if Linkmode == LinkAuto {
if iscgo && externalobj != 0 { if iscgo && externalobj {
Linkmode = LinkExternal Linkmode = LinkExternal
} else { } else {
Linkmode = LinkInternal Linkmode = LinkInternal
...@@ -670,10 +670,10 @@ var internalpkg = []string{ ...@@ -670,10 +670,10 @@ var internalpkg = []string{
} }
func ldhostobj(ld func(*Biobuf, string, int64, string), f *Biobuf, pkg string, length int64, pn string, file string) { func ldhostobj(ld func(*Biobuf, string, int64, string), f *Biobuf, pkg string, length int64, pn string, file string) {
isinternal := 0 isinternal := false
for i := 0; i < len(internalpkg); i++ { for i := 0; i < len(internalpkg); i++ {
if pkg == internalpkg[i] { if pkg == internalpkg[i] {
isinternal = 1 isinternal = true
break break
} }
} }
...@@ -686,12 +686,12 @@ func ldhostobj(ld func(*Biobuf, string, int64, string), f *Biobuf, pkg string, l ...@@ -686,12 +686,12 @@ func ldhostobj(ld func(*Biobuf, string, int64, string), f *Biobuf, pkg string, l
// these relocation types. // these relocation types.
if HEADTYPE == Hdragonfly { if HEADTYPE == Hdragonfly {
if pkg == "net" || pkg == "os/user" { if pkg == "net" || pkg == "os/user" {
isinternal = 0 isinternal = false
} }
} }
if isinternal == 0 { if !isinternal {
externalobj = 1 externalobj = true
} }
hostobj = append(hostobj, Hostobj{}) hostobj = append(hostobj, Hostobj{})
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment