Skip to content

Commit

Permalink
x/arch: silent go vet warnings
Browse files Browse the repository at this point in the history
go vet  -all ./...
arm/armspec/spec.go:584:26: rsc.io/pdf.Text struct literal uses unkeyed fields
arm64/arm64spec/spec.go:688:26: rsc.io/pdf.Text struct literal uses unkeyed fields
loong64/loong64spec/spec.go:361:26: rsc.io/pdf.Text struct literal uses unkeyed fields
ppc64/ppc64map/map.go:290:5: unreachable code
ppc64/ppc64spec/spec.go:468:26: rsc.io/pdf.Text struct literal uses unkeyed fields
s390x/s390xmap/map.go:218:5: unreachable code
s390x/s390xspec/spec.go:1045:26: rsc.io/pdf.Text struct literal uses unkeyed fields
x86/x86spec/parse.go:513:26: rsc.io/pdf.Text struct literal uses unkeyed fields

Change-Id: I4f7e29c80231ebfc5287e0d5bb57edae5b712603
Reviewed-on: https://go-review.googlesource.com/c/arch/+/642738
Reviewed-by: Ian Lance Taylor <[email protected]>
Auto-Submit: Ian Lance Taylor <[email protected]>
Reviewed-by: Cherry Mui <[email protected]>
LUCI-TryBot-Result: Go LUCI <[email protected]>
Commit-Queue: Ian Lance Taylor <[email protected]>
  • Loading branch information
alirezaarzehgar authored and gopherbot committed Jan 17, 2025
1 parent bde81be commit ccff9d4
Show file tree
Hide file tree
Showing 9 changed files with 55 additions and 12 deletions.
9 changes: 8 additions & 1 deletion arm/armspec/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,14 @@ func findWords(chars []pdf.Text) (words []pdf.Text) {
f := ck.Font
f = strings.TrimSuffix(f, ",Italic")
f = strings.TrimSuffix(f, "-Italic")
words = append(words, pdf.Text{f, ck.FontSize, ck.X, ck.Y, end - ck.X, s})
words = append(words, pdf.Text{
Font: f,
FontSize: ck.FontSize,
X: ck.X,
Y: ck.Y,
W: end - ck.X,
S: s,
})
k = l
}
i = j
Expand Down
9 changes: 8 additions & 1 deletion arm64/arm64spec/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,14 @@ func findWords(chars []pdf.Text) (words []pdf.Text) {
f := ck.Font
f = strings.TrimSuffix(f, ",Italic")
f = strings.TrimSuffix(f, "-Italic")
words = append(words, pdf.Text{f, ck.FontSize, ck.X, ck.Y, end - ck.X, s})
words = append(words, pdf.Text{
Font: f,
FontSize: ck.FontSize,
X: ck.X,
Y: ck.Y,
W: end - ck.X,
S: s,
})
k = l
}
i = j
Expand Down
9 changes: 8 additions & 1 deletion loong64/loong64spec/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,14 @@ func findWords(chars []pdf.Text) (words []pdf.Text) {
break
}
f := ck.Font
words = append(words, pdf.Text{f, ck.FontSize, ck.X, ck.Y, end - ck.X, s})
words = append(words, pdf.Text{
Font: f,
FontSize: ck.FontSize,
X: ck.X,
Y: ck.Y,
W: end - ck.X,
S: s,
})
k = l
}
i = j
Expand Down
4 changes: 2 additions & 2 deletions ppc64/ppc64map/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import (
"flag"
"fmt"
gofmt "go/format"
asm "golang.org/x/arch/ppc64/ppc64asm"
"log"
"math/bits"
"os"
Expand All @@ -33,6 +32,8 @@ import (
"strconv"
"strings"
"text/template"

asm "golang.org/x/arch/ppc64/ppc64asm"
)

var format = flag.String("fmt", "text", "output format: text, decoder, asm")
Expand Down Expand Up @@ -287,7 +288,6 @@ func parseFields(encoding, text string, word int8) Args {
if j < 0 {
fmt.Fprintf(os.Stderr, "%s: wrong %d-th encoding field: %q\n", text, i, f)
panic("Invalid encoding entry.")
continue
}
k := strings.Index(f[j+1:], " ")
if k >= 0 {
Expand Down
9 changes: 8 additions & 1 deletion ppc64/ppc64spec/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,14 @@ func findWords(chars []pdf.Text) (words []pdf.Text) {
f := ck.Font
f = strings.TrimSuffix(f, ",Italic")
f = strings.TrimSuffix(f, "-Italic")
words = append(words, pdf.Text{f, ck.FontSize, ck.X, ck.Y, end - ck.X, s})
words = append(words, pdf.Text{
Font: f,
FontSize: ck.FontSize,
X: ck.X,
Y: ck.Y,
W: end - ck.X,
S: s,
})
k = l
}
i = j
Expand Down
4 changes: 2 additions & 2 deletions s390x/s390xmap/map.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ import (
"flag"
"fmt"
gofmt "go/format"
asm "golang.org/x/arch/s390x/s390xasm"
"log"
"os"
"regexp"
"strconv"
"strings"

asm "golang.org/x/arch/s390x/s390xasm"
)

var format = flag.String("fmt", "text", "output format: text, decoder, asm")
Expand Down Expand Up @@ -215,7 +216,6 @@ func parseFields(encoding, text string) Args {
if j < 0 {
fmt.Fprintf(os.Stderr, "%s: wrong %d-th encoding field: %q\n", text, i, f)
panic("Invalid encoding entry.")
continue
}
off, err = strconv.Atoi(f[j+1:])
if err != nil {
Expand Down
12 changes: 10 additions & 2 deletions s390x/s390xspec/spec.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ import (
"log"
"math"
"os"
"rsc.io/pdf"
"sort"
"strconv"
"strings"

"rsc.io/pdf"
)

type Inst struct {
Expand Down Expand Up @@ -1042,7 +1043,14 @@ func findWords(chars []pdf.Text) (words []pdf.Text) {
f := ck.Font
f = strings.TrimSuffix(f, ",Italic")
f = strings.TrimSuffix(f, "-Italic")
words = append(words, pdf.Text{f, ck.FontSize, ck.X, ck.Y, end - ck.X, s})
words = append(words, pdf.Text{
Font: f,
FontSize: ck.FontSize,
X: ck.X,
Y: ck.Y,
W: end - ck.X,
S: s,
})
k = l
}
i = j
Expand Down
2 changes: 1 addition & 1 deletion x86/x86asm/tables.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion x86/x86spec/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,14 @@ func findWords(chars []pdf.Text) (words []pdf.Text) {
f := ck.Font
f = strings.TrimSuffix(f, ",Italic")
f = strings.TrimSuffix(f, "-Italic")
words = append(words, pdf.Text{f, ck.FontSize, ck.X, ck.Y, end, s})
words = append(words, pdf.Text{
Font: f,
FontSize: ck.FontSize,
X: ck.X,
Y: ck.Y,
W: end,
S: s,
})
k = l
}
i = j
Expand Down

0 comments on commit ccff9d4

Please sign in to comment.