]> Cypherpunks repositories - gostls13.git/commitdiff
cmd: remove unnecessary type conversions
authorMatthew Dempsky <mdempsky@google.com>
Fri, 15 Apr 2016 02:04:45 +0000 (19:04 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Fri, 15 Apr 2016 02:32:10 +0000 (02:32 +0000)
CL generated mechanically with github.com/mdempsky/unconvert.

Change-Id: Ic590315cbc7026163a1b3f8ea306ba35f1a53256
Reviewed-on: https://go-review.googlesource.com/22103
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Michael Hudson-Doyle <michael.hudson@canonical.com>
37 files changed:
src/cmd/asm/internal/asm/asm.go
src/cmd/cgo/ast.go
src/cmd/compile/internal/s390x/peep.go
src/cmd/go/http.go
src/cmd/go/vcs.go
src/cmd/internal/obj/arm64/obj7.go
src/cmd/internal/obj/data.go
src/cmd/internal/obj/mips/asm0.go
src/cmd/internal/obj/objfile.go
src/cmd/internal/obj/pcln.go
src/cmd/internal/obj/ppc64/asm9.go
src/cmd/internal/obj/util.go
src/cmd/internal/obj/x86/asm6.go
src/cmd/internal/objfile/plan9obj.go
src/cmd/internal/pprof/profile/legacy_profile.go
src/cmd/internal/unvendor/golang.org/x/arch/arm/armasm/decode.go
src/cmd/internal/unvendor/golang.org/x/arch/x86/x86asm/decode.go
src/cmd/link/internal/amd64/asm.go
src/cmd/link/internal/arm/asm.go
src/cmd/link/internal/arm64/asm.go
src/cmd/link/internal/ld/data.go
src/cmd/link/internal/ld/decodesym.go
src/cmd/link/internal/ld/dwarf.go
src/cmd/link/internal/ld/elf.go
src/cmd/link/internal/ld/ldelf.go
src/cmd/link/internal/ld/ldmacho.go
src/cmd/link/internal/ld/ldpe.go
src/cmd/link/internal/ld/lib.go
src/cmd/link/internal/ld/macho.go
src/cmd/link/internal/ld/objfile.go
src/cmd/link/internal/ld/pcln.go
src/cmd/link/internal/ld/pe.go
src/cmd/link/internal/ld/symtab.go
src/cmd/link/internal/mips64/asm.go
src/cmd/link/internal/ppc64/asm.go
src/cmd/link/internal/x86/asm.go
src/cmd/vet/structtag.go

index d674914c6773fbed586aa832efa694de2c639678..24906e2cce200c5e5f218f8ba911c178e130cd2c 100644 (file)
@@ -59,7 +59,7 @@ func (p *Parser) append(prog *obj.Prog, cond string, doLabel bool) {
                }
                p.pendingLabels = p.pendingLabels[0:0]
        }
-       prog.Pc = int64(p.pc)
+       prog.Pc = p.pc
        if *flags.Debug {
                fmt.Println(p.histLineNum, prog)
        }
@@ -371,7 +371,7 @@ func (p *Parser) asmJump(op obj.As, cond string, a []obj.Addr) {
                                Offset: p.getConstant(prog, op, &a[0]),
                        }
                        reg := int16(p.getConstant(prog, op, &a[1]))
-                       reg, ok := p.arch.RegisterNumber("R", int16(reg))
+                       reg, ok := p.arch.RegisterNumber("R", reg)
                        if !ok {
                                p.errorf("bad register number %d", reg)
                                return
index 2859d59750dc5cf6bce4426ddf752b1c066b812c..823da43c1d00e213e2d77c09b05906cc527a2d0b 100644 (file)
@@ -73,7 +73,7 @@ func (f *File) ReadGo(name string) {
                }
                for _, spec := range d.Specs {
                        s, ok := spec.(*ast.ImportSpec)
-                       if !ok || string(s.Path.Value) != `"C"` {
+                       if !ok || s.Path.Value != `"C"` {
                                continue
                        }
                        sawC = true
@@ -106,7 +106,7 @@ func (f *File) ReadGo(name string) {
                ws := 0
                for _, spec := range d.Specs {
                        s, ok := spec.(*ast.ImportSpec)
-                       if !ok || string(s.Path.Value) != `"C"` {
+                       if !ok || s.Path.Value != `"C"` {
                                d.Specs[ws] = spec
                                ws++
                        }
@@ -147,7 +147,7 @@ func commentText(g *ast.CommentGroup) string {
        }
        var pieces []string
        for _, com := range g.List {
-               c := string(com.Text)
+               c := com.Text
                // Remove comment markers.
                // The parser has given us exactly the comment text.
                switch c[1] {
@@ -242,11 +242,11 @@ func (f *File) saveExport(x interface{}, context string) {
                return
        }
        for _, c := range n.Doc.List {
-               if !strings.HasPrefix(string(c.Text), "//export ") {
+               if !strings.HasPrefix(c.Text, "//export ") {
                        continue
                }
 
-               name := strings.TrimSpace(string(c.Text[9:]))
+               name := strings.TrimSpace(c.Text[9:])
                if name == "" {
                        error_(c.Pos(), "export missing name")
                }
index 86258d67da383a357e715bc0e30fe1b3fc6ecb06..cd6a8c5d8cfb7f889afafb3cc927dfe0ef0a44c8 100644 (file)
@@ -135,7 +135,7 @@ func pushback(r0 *gc.Flow) {
                }
        }
 
-       t := obj.Prog(*r0.Prog)
+       t := *r0.Prog
        for r = gc.Uniqp(r0); ; r = gc.Uniqp(r) {
                p0 = r.Link.Prog
                p := r.Prog
@@ -162,7 +162,7 @@ func pushback(r0 *gc.Flow) {
 
        if gc.Debug['P'] != 0 && gc.Debug['v'] != 0 {
                fmt.Printf("\tafter\n")
-               for r := (*gc.Flow)(b); ; r = r.Link {
+               for r := b; ; r = r.Link {
                        fmt.Printf("\t%v\n", r.Prog)
                        if r == r0 {
                                break
index 19e1fe4f771681c63e4c0520ece3ee6dead45121..05ea50304998d6bebf89f13d29310634f1054ee3 100644 (file)
@@ -30,7 +30,7 @@ var httpClient = http.DefaultClient
 // when we're connecting to https servers that might not be there
 // or might be using self-signed certificates.
 var impatientInsecureHTTPClient = &http.Client{
-       Timeout: time.Duration(5 * time.Second),
+       Timeout: 5 * time.Second,
        Transport: &http.Transport{
                TLSClientConfig: &tls.Config{
                        InsecureSkipVerify: true,
index e3342999fa9ecd9f26b8808bbd7ab8f67c66a514..4ff71f216831252f454ad64d4d7b3f364d367a46 100644 (file)
@@ -253,7 +253,7 @@ func bzrResolveRepo(vcsBzr *vcsCmd, rootDir, remoteRepo string) (realRepo string
                return "", fmt.Errorf("unable to parse output of bzr info")
        }
        out = out[:i]
-       return strings.TrimSpace(string(out)), nil
+       return strings.TrimSpace(out), nil
 }
 
 // vcsSvn describes how to use Subversion.
@@ -294,7 +294,7 @@ func svnRemoteRepo(vcsSvn *vcsCmd, rootDir string) (remoteRepo string, err error
                return "", fmt.Errorf("unable to parse output of svn info")
        }
        out = out[:i]
-       return strings.TrimSpace(string(out)), nil
+       return strings.TrimSpace(out), nil
 }
 
 func (v *vcsCmd) String() string {
index d833beeb2db1fe69ae0daeb037d2d6ab9e9144b3..ffa1b416d682635b8c2e672736cec90ba6cb1541 100644 (file)
@@ -250,7 +250,7 @@ func progedit(ctxt *obj.Link, p *obj.Prog) {
                if p.From.Type == obj.TYPE_FCONST {
                        f32 := float32(p.From.Val.(float64))
                        i32 := math.Float32bits(f32)
-                       literal := fmt.Sprintf("$f32.%08x", uint32(i32))
+                       literal := fmt.Sprintf("$f32.%08x", i32)
                        s := obj.Linklookup(ctxt, literal, 0)
                        s.Size = 4
                        p.From.Type = obj.TYPE_MEM
@@ -263,7 +263,7 @@ func progedit(ctxt *obj.Link, p *obj.Prog) {
        case AFMOVD:
                if p.From.Type == obj.TYPE_FCONST {
                        i64 := math.Float64bits(p.From.Val.(float64))
-                       literal := fmt.Sprintf("$f64.%016x", uint64(i64))
+                       literal := fmt.Sprintf("$f64.%016x", i64)
                        s := obj.Linklookup(ctxt, literal, 0)
                        s.Size = 8
                        p.From.Type = obj.TYPE_MEM
index d7f0840bc140e76f104871d07b40ed52adf6ce82..5fe4cb10a5b166527a29f734d77fff024e91b176 100644 (file)
@@ -183,7 +183,7 @@ func Setuintxx(ctxt *Link, s *LSym, off int64, v uint64, wid int64) int64 {
        case 4:
                ctxt.Arch.ByteOrder.PutUint32(s.P[off:], uint32(v))
        case 8:
-               ctxt.Arch.ByteOrder.PutUint64(s.P[off:], uint64(v))
+               ctxt.Arch.ByteOrder.PutUint64(s.P[off:], v)
        }
 
        return off + wid
index 13e7600c211ef79db4be9a5124704cbdd2bc3feb..73d6cabbcb384ab97ef4934574207518c4bdf841 100644 (file)
@@ -1024,7 +1024,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
                o1 = OP_IRR(opirr(ctxt, p.As), uint32(v), uint32(r), uint32(p.To.Reg))
 
        case 5: /* syscall */
-               o1 = uint32(oprrr(ctxt, p.As))
+               o1 = oprrr(ctxt, p.As)
 
        case 6: /* beq r1,[r2],sbra */
                v := int32(0)
index 60505dfbb5cffcbb9e17b1b27b339eaecbf9d39a..17175ebf06b20832241553d753f00c7013cf7b81 100644 (file)
@@ -371,9 +371,9 @@ func (w *objWriter) writeSymDebug(s *LSym) {
                        name = "TLS"
                }
                if ctxt.Arch.InFamily(sys.ARM, sys.PPC64) {
-                       fmt.Fprintf(ctxt.Bso, "\trel %d+%d t=%d %s+%x\n", int(r.Off), r.Siz, r.Type, name, uint64(int64(r.Add)))
+                       fmt.Fprintf(ctxt.Bso, "\trel %d+%d t=%d %s+%x\n", int(r.Off), r.Siz, r.Type, name, uint64(r.Add))
                } else {
-                       fmt.Fprintf(ctxt.Bso, "\trel %d+%d t=%d %s+%d\n", int(r.Off), r.Siz, r.Type, name, int64(r.Add))
+                       fmt.Fprintf(ctxt.Bso, "\trel %d+%d t=%d %s+%d\n", int(r.Off), r.Siz, r.Type, name, r.Add)
                }
        }
 }
@@ -473,7 +473,7 @@ func (w *objWriter) writeSym(s *LSym) {
 
 func (w *objWriter) writeInt(sval int64) {
        var v uint64
-       uv := (uint64(sval) << 1) ^ uint64(int64(sval>>63))
+       uv := (uint64(sval) << 1) ^ uint64(sval>>63)
        p := w.varintbuf[:]
        for v = uv; v >= 0x80; v >>= 7 {
                p[0] = uint8(v | 0x80)
index eca7531f3cf690369efad0a1b431b99074da321b..a086be9f66414ac5a10b4635be6f315811aeeca3 100644 (file)
@@ -64,7 +64,7 @@ func funcpctab(ctxt *Link, dst *Pcdata, func_ *LSym, desc string, valfunc func(*
                if val == oldval && started != 0 {
                        val = valfunc(ctxt, func_, val, p, 1, arg)
                        if ctxt.Debugpcln != 0 {
-                               fmt.Fprintf(ctxt.Bso, "%6x %6s %v\n", uint64(int64(p.Pc)), "", p)
+                               fmt.Fprintf(ctxt.Bso, "%6x %6s %v\n", uint64(p.Pc), "", p)
                        }
                        continue
                }
@@ -76,7 +76,7 @@ func funcpctab(ctxt *Link, dst *Pcdata, func_ *LSym, desc string, valfunc func(*
                if p.Link != nil && p.Link.Pc == p.Pc {
                        val = valfunc(ctxt, func_, val, p, 1, arg)
                        if ctxt.Debugpcln != 0 {
-                               fmt.Fprintf(ctxt.Bso, "%6x %6s %v\n", uint64(int64(p.Pc)), "", p)
+                               fmt.Fprintf(ctxt.Bso, "%6x %6s %v\n", uint64(p.Pc), "", p)
                        }
                        continue
                }
@@ -96,7 +96,7 @@ func funcpctab(ctxt *Link, dst *Pcdata, func_ *LSym, desc string, valfunc func(*
                // where the 0x80 bit indicates that the integer continues.
 
                if ctxt.Debugpcln != 0 {
-                       fmt.Fprintf(ctxt.Bso, "%6x %6d %v\n", uint64(int64(p.Pc)), val, p)
+                       fmt.Fprintf(ctxt.Bso, "%6x %6d %v\n", uint64(p.Pc), val, p)
                }
 
                if started != 0 {
@@ -118,7 +118,7 @@ func funcpctab(ctxt *Link, dst *Pcdata, func_ *LSym, desc string, valfunc func(*
 
        if started != 0 {
                if ctxt.Debugpcln != 0 {
-                       fmt.Fprintf(ctxt.Bso, "%6x done\n", uint64(int64(func_.Text.Pc)+func_.Size))
+                       fmt.Fprintf(ctxt.Bso, "%6x done\n", uint64(func_.Text.Pc+func_.Size))
                }
                addvarint(ctxt, dst, uint32((func_.Size-pc)/int64(ctxt.Arch.MinLC)))
                addvarint(ctxt, dst, 0) // terminator
@@ -164,7 +164,7 @@ func pctofileline(ctxt *Link, sym *LSym, oldval int32, p *Prog, phase int32, arg
                if file == f {
                        pcln.Lastfile = f
                        pcln.Lastindex = int(i)
-                       return int32(i)
+                       return i
                }
        }
        pcln.File = append(pcln.File, f)
index e793f268033429f3c4c061ed128b8609758813da..f786f3c4434df3d1583e8183f7138665660300c8 100644 (file)
@@ -1384,7 +1384,7 @@ const (
 // which relocation to use with a load or store and only supports the needed
 // instructions.
 func opform(ctxt *obj.Link, insn uint32) int {
-       switch uint32(insn) {
+       switch insn {
        default:
                ctxt.Diag("bad insn in loadform: %x", insn)
        case OPVCC(58, 0, 0, 0), // ld
@@ -2198,9 +2198,9 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
                }
                v := oprrr(ctxt, p.As)
                t := v & (1<<10 | 1) /* OE|Rc */
-               o1 = AOP_RRR(uint32(v)&^uint32(t), REGTMP, uint32(r), uint32(p.From.Reg))
+               o1 = AOP_RRR(v&^t, REGTMP, uint32(r), uint32(p.From.Reg))
                o2 = AOP_RRR(OP_MULLW, REGTMP, REGTMP, uint32(p.From.Reg))
-               o3 = AOP_RRR(OP_SUBF|uint32(t), uint32(p.To.Reg), REGTMP, uint32(r))
+               o3 = AOP_RRR(OP_SUBF|t, uint32(p.To.Reg), REGTMP, uint32(r))
                if p.As == AREMU {
                        o4 = o3
 
@@ -2216,9 +2216,9 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
                }
                v := oprrr(ctxt, p.As)
                t := v & (1<<10 | 1) /* OE|Rc */
-               o1 = AOP_RRR(uint32(v)&^uint32(t), REGTMP, uint32(r), uint32(p.From.Reg))
+               o1 = AOP_RRR(v&^t, REGTMP, uint32(r), uint32(p.From.Reg))
                o2 = AOP_RRR(OP_MULLD, REGTMP, REGTMP, uint32(p.From.Reg))
-               o3 = AOP_RRR(OP_SUBF|uint32(t), uint32(p.To.Reg), REGTMP, uint32(r))
+               o3 = AOP_RRR(OP_SUBF|t, uint32(p.To.Reg), REGTMP, uint32(r))
 
        case 52: /* mtfsbNx cr(n) */
                v := regoff(ctxt, &p.From) & 31
@@ -2485,7 +2485,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
                        ctxt.Diag("invalid offset against tls var %v", p)
                }
                o1 = AOP_IRR(OP_ADDIS, uint32(p.To.Reg), REG_R2, 0)
-               o2 = AOP_IRR(uint32(opload(ctxt, AMOVD)), uint32(p.To.Reg), uint32(p.To.Reg), 0)
+               o2 = AOP_IRR(opload(ctxt, AMOVD), uint32(p.To.Reg), uint32(p.To.Reg), 0)
                rel := obj.Addrel(ctxt.Cursym)
                rel.Off = int32(ctxt.Pc)
                rel.Siz = 8
@@ -2499,7 +2499,7 @@ func asmout(ctxt *obj.Link, p *obj.Prog, o *Optab, out []uint32) {
                }
 
                o1 = AOP_IRR(OP_ADDIS, uint32(p.To.Reg), REG_R2, 0)
-               o2 = AOP_IRR(uint32(opload(ctxt, AMOVD)), uint32(p.To.Reg), uint32(p.To.Reg), 0)
+               o2 = AOP_IRR(opload(ctxt, AMOVD), uint32(p.To.Reg), uint32(p.To.Reg), 0)
                rel := obj.Addrel(ctxt.Cursym)
                rel.Off = int32(ctxt.Pc)
                rel.Siz = 8
index 04e6a76e1a71abaca3180ee41e9871d8248d3143..294cedcb0a25a3512a9f446c09836f1c098fb258 100644 (file)
@@ -279,7 +279,7 @@ func Dconv(p *Prog, a *Addr) string {
 
        case TYPE_SHIFT:
                v := int(a.Offset)
-               op := string("<<>>->@>"[((v>>5)&3)<<1:])
+               op := "<<>>->@>"[((v>>5)&3)<<1:]
                if v&(1<<4) != 0 {
                        str = fmt.Sprintf("R%d%c%cR%d", v&15, op[0], op[1], (v>>8)&15)
                } else {
index e806a834fddc18c29765efc550f6cd80d713d79e..57ef045b98e4f63622eed1cdbf882caf697bd23f 100644 (file)
@@ -3308,7 +3308,7 @@ func doasm(ctxt *obj.Link, p *obj.Prog) {
 
                        case Pf2, /* xmm opcode escape */
                                Pf3:
-                               ctxt.AsmBuf.Put2(byte(o.prefix), Pm)
+                               ctxt.AsmBuf.Put2(o.prefix, Pm)
 
                        case Pef3:
                                ctxt.AsmBuf.Put3(Pe, Pf3, Pm)
@@ -3421,7 +3421,7 @@ func doasm(ctxt *obj.Link, p *obj.Prog) {
                                asmand(ctxt, p, &p.From, &p.To)
 
                        case Zm2_r:
-                               ctxt.AsmBuf.Put2(byte(op), byte(o.op[z+1]))
+                               ctxt.AsmBuf.Put2(byte(op), o.op[z+1])
                                asmand(ctxt, p, &p.From, &p.To)
 
                        case Zm_r_xm:
@@ -3531,7 +3531,7 @@ func doasm(ctxt *obj.Link, p *obj.Prog) {
                                }
                                ctxt.AsmBuf.Put1(byte(op))
                                if p.As == AXABORT {
-                                       ctxt.AsmBuf.Put1(byte(o.op[z+1]))
+                                       ctxt.AsmBuf.Put1(o.op[z+1])
                                }
                                ctxt.AsmBuf.Put1(byte(vaddr(ctxt, p, a, nil)))
 
@@ -3657,7 +3657,7 @@ func doasm(ctxt *obj.Link, p *obj.Prog) {
                                if yt.zcase == Zcallcon {
                                        ctxt.AsmBuf.Put1(byte(op))
                                } else {
-                                       ctxt.AsmBuf.Put1(byte(o.op[z+1]))
+                                       ctxt.AsmBuf.Put1(o.op[z+1])
                                }
                                r = obj.Addrel(ctxt.Cursym)
                                r.Off = int32(p.Pc + int64(ctxt.AsmBuf.Len()))
@@ -3667,7 +3667,7 @@ func doasm(ctxt *obj.Link, p *obj.Prog) {
                                ctxt.AsmBuf.PutInt32(0)
 
                        case Zcallind:
-                               ctxt.AsmBuf.Put2(byte(op), byte(o.op[z+1]))
+                               ctxt.AsmBuf.Put2(byte(op), o.op[z+1])
                                r = obj.Addrel(ctxt.Cursym)
                                r.Off = int32(p.Pc + int64(ctxt.AsmBuf.Len()))
                                r.Type = obj.R_ADDR
@@ -3722,7 +3722,7 @@ func doasm(ctxt *obj.Link, p *obj.Prog) {
                                                log.Fatalf("bad code")
                                        }
 
-                                       ctxt.AsmBuf.Put1(byte(o.op[z+1]))
+                                       ctxt.AsmBuf.Put1(o.op[z+1])
                                        r = obj.Addrel(ctxt.Cursym)
                                        r.Off = int32(p.Pc + int64(ctxt.AsmBuf.Len()))
                                        r.Sym = p.To.Sym
@@ -3762,7 +3762,7 @@ func doasm(ctxt *obj.Link, p *obj.Prog) {
                                                        v--
                                                }
 
-                                               ctxt.AsmBuf.Put1(byte(o.op[z+1]))
+                                               ctxt.AsmBuf.Put1(o.op[z+1])
                                                ctxt.AsmBuf.PutInt32(int32(v))
                                        }
 
@@ -3784,7 +3784,7 @@ func doasm(ctxt *obj.Link, p *obj.Prog) {
                                        if yt.zcase == Zbr {
                                                ctxt.AsmBuf.Put1(0x0f)
                                        }
-                                       ctxt.AsmBuf.Put1(byte(o.op[z+1]))
+                                       ctxt.AsmBuf.Put1(o.op[z+1])
                                        ctxt.AsmBuf.PutInt32(0)
                                }
 
index 1d808f77eb4dc43ca9567432faabe4cde79d1b52..6ee389dc2e2223e2b52816c34e4b4f041fec3808 100644 (file)
@@ -59,7 +59,7 @@ func (f *plan9File) symbols() ([]Sym, error) {
                if !validSymType[s.Type] {
                        continue
                }
-               sym := Sym{Addr: s.Value, Name: s.Name, Code: rune(s.Type)}
+               sym := Sym{Addr: s.Value, Name: s.Name, Code: s.Type}
                i := sort.Search(len(addrs), func(x int) bool { return addrs[x] > s.Value })
                if i < len(addrs) {
                        sym.Size = int64(addrs[i] - s.Value)
index 3d4da6b4d730773fa36bbaa6b966db13e2e3ffcb..8ccfe451768412b9fd90d174f2e6d6b78d77b755 100644 (file)
@@ -74,7 +74,7 @@ func parseGoCount(b []byte) (*Profile, error) {
        if m == nil {
                return nil, errUnrecognized
        }
-       profileType := string(m[1])
+       profileType := m[1]
        p := &Profile{
                PeriodType: &ValueType{Type: profileType, Unit: "count"},
                Period:     1,
@@ -99,11 +99,11 @@ func parseGoCount(b []byte) (*Profile, error) {
                if m == nil {
                        return nil, errMalformed
                }
-               n, err := strconv.ParseInt(string(m[1]), 0, 64)
+               n, err := strconv.ParseInt(m[1], 0, 64)
                if err != nil {
                        return nil, errMalformed
                }
-               fields := strings.Fields(string(m[2]))
+               fields := strings.Fields(m[2])
                locs := make([]*Location, 0, len(fields))
                for _, stk := range fields {
                        addr, err := strconv.ParseUint(stk, 0, 64)
@@ -458,7 +458,7 @@ func parseCPUSamples(b []byte, parse func(b []byte) (uint64, []byte), adjust boo
                }
                p.Sample = append(p.Sample,
                        &Sample{
-                               Value:    []int64{int64(count), int64(count) * int64(p.Period)},
+                               Value:    []int64{int64(count), int64(count) * p.Period},
                                Location: sloc,
                        })
        }
@@ -488,7 +488,7 @@ func parseHeap(b []byte) (p *Profile, err error) {
 
                var period int64
                if len(header[6]) > 0 {
-                       if period, err = strconv.ParseInt(string(header[6]), 10, 64); err != nil {
+                       if period, err = strconv.ParseInt(header[6], 10, 64); err != nil {
                                return nil, errUnrecognized
                        }
                }
index 6b4d73841be7357be6730ecfe9c05fae4b4d18a8..cc81dc3f50b04902ba378f078051e0d446eb96eb 100644 (file)
@@ -233,9 +233,9 @@ func decodeArg(aop instArg, x uint32) Arg {
                typ, count := decodeShift(x)
                // ROR #0 here means ROR #0, but decodeShift rewrites to RRX #1.
                if typ == RotateRightExt {
-                       return Reg(Rm)
+                       return Rm
                }
-               return RegShift{Rm, typ, uint8(count)}
+               return RegShift{Rm, typ, count}
 
        case arg_R_shift_R:
                Rm := Reg(x & (1<<4 - 1))
@@ -247,9 +247,9 @@ func decodeArg(aop instArg, x uint32) Arg {
                Rm := Reg(x & (1<<4 - 1))
                typ, count := decodeShift(x)
                if typ == ShiftLeft && count == 0 {
-                       return Reg(Rm)
+                       return Rm
                }
-               return RegShift{Rm, typ, uint8(count)}
+               return RegShift{Rm, typ, count}
 
        case arg_R1_0:
                return Reg((x & (1<<4 - 1)))
index e4122c1e6de811dfbf57c2e701cf49c931226b61..9b3597300ebaef0b7e963819c2f50b8a6f4f5a38 100644 (file)
@@ -1041,7 +1041,7 @@ Decode:
 
                case xArgMoffs8, xArgMoffs16, xArgMoffs32, xArgMoffs64:
                        // TODO(rsc): Can address be 64 bits?
-                       mem = Mem{Disp: int64(immc)}
+                       mem = Mem{Disp: immc}
                        if segIndex >= 0 {
                                mem.Segment = prefixToSegment(inst.Prefix[segIndex])
                                inst.Prefix[segIndex] |= PrefixImplicit
index a6dce6c2c99d0774cfc604b4c76a9bde2b2ba25e..ab96a59151475f8977e06303aa5cf32c8799f76d 100644 (file)
@@ -735,7 +735,7 @@ func asmb() {
                        if sym != nil {
                                ld.Lcsize = int32(len(sym.P))
                                for i := 0; int32(i) < ld.Lcsize; i++ {
-                                       ld.Cput(uint8(sym.P[i]))
+                                       ld.Cput(sym.P[i])
                                }
 
                                ld.Cflush()
index 11886157168ddb4a8cfee4edb98fb610a09b56ee..69e1d8f3173faa7f8887bb89f83e8d6a35bae768 100644 (file)
@@ -649,7 +649,7 @@ func asmb() {
                        if sym != nil {
                                ld.Lcsize = int32(len(sym.P))
                                for i := 0; int32(i) < ld.Lcsize; i++ {
-                                       ld.Cput(uint8(sym.P[i]))
+                                       ld.Cput(sym.P[i])
                                }
 
                                ld.Cflush()
index d3ba5ff3f30368f0a3405108e94a615422183520..d8ffffa15785b5cd784c9ce74d7310e3cf2c0f11 100644 (file)
@@ -488,7 +488,7 @@ func asmb() {
                        if sym != nil {
                                ld.Lcsize = int32(len(sym.P))
                                for i := 0; int32(i) < ld.Lcsize; i++ {
-                                       ld.Cput(uint8(sym.P[i]))
+                                       ld.Cput(sym.P[i])
                                }
 
                                ld.Cflush()
index cf51b0a908876391b996fa03478930348d8fbd35..105503f6ef34f5009e40af855028a1ab25eeeb18 100644 (file)
@@ -80,7 +80,7 @@ func setuintxx(ctxt *Link, s *LSym, off int64, v uint64, wid int64) int64 {
        case 4:
                ctxt.Arch.ByteOrder.PutUint32(s.P[off:], uint32(v))
        case 8:
-               ctxt.Arch.ByteOrder.PutUint64(s.P[off:], uint64(v))
+               ctxt.Arch.ByteOrder.PutUint64(s.P[off:], v)
        }
 
        return off + wid
@@ -757,7 +757,7 @@ func blk(start *LSym, addr int64, size int64) {
                }
                Ctxt.Cursym = sym
                if sym.Value < addr {
-                       Diag("phase error: addr=%#x but sym=%#x type=%d", int64(addr), int64(sym.Value), sym.Type)
+                       Diag("phase error: addr=%#x but sym=%#x type=%d", addr, sym.Value, sym.Type)
                        errorexit()
                }
 
@@ -773,7 +773,7 @@ func blk(start *LSym, addr int64, size int64) {
                        addr = sym.Value + sym.Size
                }
                if addr != sym.Value+sym.Size {
-                       Diag("phase error: addr=%#x value+size=%#x", int64(addr), int64(sym.Value)+sym.Size)
+                       Diag("phase error: addr=%#x value+size=%#x", addr, sym.Value+sym.Size)
                        errorexit()
                }
 
@@ -821,14 +821,14 @@ func Codeblk(addr int64, size int64) {
                }
 
                if addr < sym.Value {
-                       fmt.Fprintf(Bso, "%-20s %.8x|", "_", uint64(int64(addr)))
+                       fmt.Fprintf(Bso, "%-20s %.8x|", "_", uint64(addr))
                        for ; addr < sym.Value; addr++ {
                                fmt.Fprintf(Bso, " %.2x", 0)
                        }
                        fmt.Fprintf(Bso, "\n")
                }
 
-               fmt.Fprintf(Bso, "%.6x\t%-20s\n", uint64(int64(addr)), sym.Name)
+               fmt.Fprintf(Bso, "%.6x\t%-20s\n", uint64(addr), sym.Name)
                q = sym.P
 
                for len(q) >= 16 {
@@ -844,7 +844,7 @@ func Codeblk(addr int64, size int64) {
        }
 
        if addr < eaddr {
-               fmt.Fprintf(Bso, "%-20s %.8x|", "_", uint64(int64(addr)))
+               fmt.Fprintf(Bso, "%-20s %.8x|", "_", uint64(addr))
                for ; addr < eaddr; addr++ {
                        fmt.Fprintf(Bso, " %.2x", 0)
                }
@@ -892,7 +892,7 @@ func Datblk(addr int64, size int64) {
                p = sym.P
                ep = p[len(sym.P):]
                for -cap(p) < -cap(ep) {
-                       if -cap(p) > -cap(sym.P) && int(-cap(p)+cap(sym.P))%16 == 0 {
+                       if -cap(p) > -cap(sym.P) && (-cap(p)+cap(sym.P))%16 == 0 {
                                fmt.Fprintf(Bso, "\n\t%.8x|", uint(addr+int64(-cap(p)+cap(sym.P))))
                        }
                        fmt.Fprintf(Bso, " %.2x", p[0])
@@ -924,7 +924,7 @@ func Datblk(addr int64, size int64) {
                                        typ = "call"
                                }
 
-                               fmt.Fprintf(Bso, "\treloc %.8x/%d %s %s+%#x [%#x]\n", uint(sym.Value+int64(r.Off)), r.Siz, typ, rsname, int64(r.Add), int64(r.Sym.Value+r.Add))
+                               fmt.Fprintf(Bso, "\treloc %.8x/%d %s %s+%#x [%#x]\n", uint(sym.Value+int64(r.Off)), r.Siz, typ, rsname, r.Add, r.Sym.Value+r.Add)
                        }
                }
        }
@@ -1279,7 +1279,7 @@ func dodata() {
 
        for s := datap; s != nil; s = s.Next {
                if int64(len(s.P)) > s.Size {
-                       Diag("%s: initialize bounds (%d < %d)", s.Name, int64(s.Size), len(s.P))
+                       Diag("%s: initialize bounds (%d < %d)", s.Name, s.Size, len(s.P))
                }
        }
 
index 5fa8b4c81f3d9ce98805c2ed02d93e51a97c93ad..4725b91d01bf2503c6448a8b284543c29cc797ea 100644 (file)
@@ -53,12 +53,12 @@ func uncommonSize() int    { return 2 * SysArch.PtrSize }   // runtime.uncommont
 
 // Type.commonType.kind
 func decodetype_kind(s *LSym) uint8 {
-       return uint8(s.P[2*SysArch.PtrSize+7] & obj.KindMask) //  0x13 / 0x1f
+       return s.P[2*SysArch.PtrSize+7] & obj.KindMask //  0x13 / 0x1f
 }
 
 // Type.commonType.kind
 func decodetype_usegcprog(s *LSym) uint8 {
-       return uint8(s.P[2*SysArch.PtrSize+7] & obj.KindGCProg) //  0x13 / 0x1f
+       return s.P[2*SysArch.PtrSize+7] & obj.KindGCProg //  0x13 / 0x1f
 }
 
 // Type.commonType.size
index b1208b63a8f35c06c05b48101806b8b2d7e1e1c6..bec9946ec5ffab316fcb8272ee63dbc6a9f2766a 100644 (file)
@@ -615,7 +615,7 @@ func putattr(s *LSym, abbrev int, form int, cls int, value int64, data interface
                Adduint8(Ctxt, s, uint8(value))
                p := data.([]byte)
                for i := 0; int64(i) < value; i++ {
-                       Adduint8(Ctxt, s, uint8(p[i]))
+                       Adduint8(Ctxt, s, p[i])
                }
 
        case DW_FORM_block2: // block
@@ -624,7 +624,7 @@ func putattr(s *LSym, abbrev int, form int, cls int, value int64, data interface
                Adduint16(Ctxt, s, uint16(value))
                p := data.([]byte)
                for i := 0; int64(i) < value; i++ {
-                       Adduint8(Ctxt, s, uint8(p[i]))
+                       Adduint8(Ctxt, s, p[i])
                }
 
        case DW_FORM_block4: // block
@@ -633,7 +633,7 @@ func putattr(s *LSym, abbrev int, form int, cls int, value int64, data interface
                Adduint32(Ctxt, s, uint32(value))
                p := data.([]byte)
                for i := 0; int64(i) < value; i++ {
-                       Adduint8(Ctxt, s, uint8(p[i]))
+                       Adduint8(Ctxt, s, p[i])
                }
 
        case DW_FORM_block: // block
@@ -641,7 +641,7 @@ func putattr(s *LSym, abbrev int, form int, cls int, value int64, data interface
 
                p := data.([]byte)
                for i := 0; int64(i) < value; i++ {
-                       Adduint8(Ctxt, s, uint8(p[i]))
+                       Adduint8(Ctxt, s, p[i])
                }
 
        case DW_FORM_data1: // constant
@@ -1179,7 +1179,7 @@ func synthesizemaptypes(die *DWDie) {
                // Construct type to represent an array of BucketSize keys
                keyname := nameFromDIESym(keytype)
                dwhks := mkinternaltype(DW_ABRV_ARRAYTYPE, "[]key", keyname, "", func(dwhk *DWDie) {
-                       newattr(dwhk, DW_AT_byte_size, DW_CLS_CONSTANT, BucketSize*int64(keysize), 0)
+                       newattr(dwhk, DW_AT_byte_size, DW_CLS_CONSTANT, BucketSize*keysize, 0)
                        t := keytype
                        if indirect_key {
                                t = defptrto(keytype)
@@ -1193,7 +1193,7 @@ func synthesizemaptypes(die *DWDie) {
                // Construct type to represent an array of BucketSize values
                valname := nameFromDIESym(valtype)
                dwhvs := mkinternaltype(DW_ABRV_ARRAYTYPE, "[]val", valname, "", func(dwhv *DWDie) {
-                       newattr(dwhv, DW_AT_byte_size, DW_CLS_CONSTANT, BucketSize*int64(valsize), 0)
+                       newattr(dwhv, DW_AT_byte_size, DW_CLS_CONSTANT, BucketSize*valsize, 0)
                        t := valtype
                        if indirect_val {
                                t = defptrto(valtype)
@@ -1225,7 +1225,7 @@ func synthesizemaptypes(die *DWDie) {
                                newmemberoffsetattr(fld, BucketSize+BucketSize*(int32(keysize)+int32(valsize))+int32(SysArch.PtrSize))
                        }
 
-                       newattr(dwhb, DW_AT_byte_size, DW_CLS_CONSTANT, BucketSize+BucketSize*int64(keysize)+BucketSize*int64(valsize)+int64(SysArch.RegSize), 0)
+                       newattr(dwhb, DW_AT_byte_size, DW_CLS_CONSTANT, BucketSize+BucketSize*keysize+BucketSize*valsize+int64(SysArch.RegSize), 0)
                })
 
                // Construct hash<K,V>
@@ -1269,7 +1269,7 @@ func synthesizechantypes(die *DWDie) {
                        } else {
                                elemsize = 0
                        }
-                       newattr(dws, DW_AT_byte_size, DW_CLS_CONSTANT, int64(sudogsize)+int64(elemsize), nil)
+                       newattr(dws, DW_AT_byte_size, DW_CLS_CONSTANT, int64(sudogsize)+elemsize, nil)
                })
 
                // waitq<T>
@@ -1787,7 +1787,7 @@ func writeinfo(prev *LSym) *LSym {
                }
 
                setuint32(Ctxt, s, 0, uint32(cusize))
-               newattr(compunit, DW_AT_byte_size, DW_CLS_CONSTANT, int64(cusize), 0)
+               newattr(compunit, DW_AT_byte_size, DW_CLS_CONSTANT, cusize, 0)
        }
        return prev
 }
index 7c760775b5e8626b37e93d1f150fd9b4edd99510..02f7897db93a6f6725d64c3a7c8aa1e566ebc9cf 100644 (file)
@@ -2026,7 +2026,7 @@ func doelf() {
                        h.Write(l.hash)
                }
                addgonote(".note.go.abihash", ELF_NOTE_GOABIHASH_TAG, h.Sum([]byte{}))
-               addgonote(".note.go.pkg-list", ELF_NOTE_GOPKGLIST_TAG, []byte(pkglistfornote))
+               addgonote(".note.go.pkg-list", ELF_NOTE_GOPKGLIST_TAG, pkglistfornote)
                var deplist []string
                for _, shlib := range Ctxt.Shlibs {
                        deplist = append(deplist, filepath.Base(shlib.Path))
index d07a2a2c34e45c72e7e33796c30f01861792089a..59e71f4dd499a7073976d3ca060f043094655a76 100644 (file)
@@ -500,7 +500,7 @@ func ldelf(f *bio.Reader, pkg string, length int64, pn string) {
 
        elfobj.e = e
        elfobj.f = f
-       elfobj.base = int64(base)
+       elfobj.base = base
        elfobj.length = length
        elfobj.name = pn
 
@@ -612,7 +612,7 @@ func ldelf(f *bio.Reader, pkg string, length int64, pn string) {
                                goto bad
                        }
 
-                       sect.nameoff = uint32(e.Uint32(b.Name[:]))
+                       sect.nameoff = e.Uint32(b.Name[:])
                        sect.type_ = e.Uint32(b.Type[:])
                        sect.flags = e.Uint64(b.Flags[:])
                        sect.addr = e.Uint64(b.Addr[:])
@@ -629,7 +629,7 @@ func ldelf(f *bio.Reader, pkg string, length int64, pn string) {
                                goto bad
                        }
 
-                       sect.nameoff = uint32(e.Uint32(b.Name[:]))
+                       sect.nameoff = e.Uint32(b.Name[:])
                        sect.type_ = e.Uint32(b.Type[:])
                        sect.flags = uint64(e.Uint32(b.Flags[:]))
                        sect.addr = uint64(e.Uint32(b.Addr[:]))
index 8dc4033bbcd7e28defdbba7f2c419e0693552239..105fc137f90650cc8b597280106bed26747fa950 100644 (file)
@@ -399,8 +399,8 @@ func macholoadsym(m *LdMachoObj, symtab *LdMachoSymtab) int {
                        return -1
                }
                s.name = cstring(strbuf[v:])
-               s.type_ = uint8(p[4])
-               s.sectnum = uint8(p[5])
+               s.type_ = p[4]
+               s.sectnum = p[5]
                s.desc = m.e.Uint16(p[6:])
                if m.is64 {
                        s.value = m.e.Uint64(p[8:])
@@ -460,8 +460,8 @@ func ldmacho(f *bio.Reader, pkg string, length int64, pn string) {
        }
 
        is64 = e.Uint32(hdr[:]) == 0xFEEDFACF
-       ncmd = e.Uint32([]byte(hdr[4*4:]))
-       cmdsz = e.Uint32([]byte(hdr[5*4:]))
+       ncmd = e.Uint32(hdr[4*4:])
+       cmdsz = e.Uint32(hdr[5*4:])
        if ncmd > 0x10000 || cmdsz >= 0x01000000 {
                err = fmt.Errorf("implausible mach-o header ncmd=%d cmdsz=%d", ncmd, cmdsz)
                goto bad
@@ -475,11 +475,11 @@ func ldmacho(f *bio.Reader, pkg string, length int64, pn string) {
 
        m.f = f
        m.e = e
-       m.cputype = uint(e.Uint32([]byte(hdr[1*4:])))
-       m.subcputype = uint(e.Uint32([]byte(hdr[2*4:])))
-       m.filetype = e.Uint32([]byte(hdr[3*4:]))
+       m.cputype = uint(e.Uint32(hdr[1*4:]))
+       m.subcputype = uint(e.Uint32(hdr[2*4:]))
+       m.filetype = e.Uint32(hdr[3*4:])
        m.ncmd = uint(ncmd)
-       m.flags = e.Uint32([]byte(hdr[6*4:]))
+       m.flags = e.Uint32(hdr[6*4:])
        m.is64 = is64
        m.base = base
        m.length = length
index 7f7121ff9427c54d50d0f38ffbb8904f0e3d6623..c51479fb4e01329ca239303f89591acfb277e907 100644 (file)
@@ -175,14 +175,14 @@ func ldpe(f *bio.Reader, pkg string, length int64, pn string) {
        // TODO return error if found .cormeta
 
        // load string table
-       f.Seek(int64(base)+int64(peobj.fh.PointerToSymbolTable)+int64(len(symbuf))*int64(peobj.fh.NumberOfSymbols), 0)
+       f.Seek(base+int64(peobj.fh.PointerToSymbolTable)+int64(len(symbuf))*int64(peobj.fh.NumberOfSymbols), 0)
 
        if _, err := io.ReadFull(f, symbuf[:4]); err != nil {
                goto bad
        }
        l = Le32(symbuf[:])
        peobj.snames = make([]byte, l)
-       f.Seek(int64(base)+int64(peobj.fh.PointerToSymbolTable)+int64(len(symbuf))*int64(peobj.fh.NumberOfSymbols), 0)
+       f.Seek(base+int64(peobj.fh.PointerToSymbolTable)+int64(len(symbuf))*int64(peobj.fh.NumberOfSymbols), 0)
        if _, err := io.ReadFull(f, peobj.snames); err != nil {
                goto bad
        }
@@ -203,9 +203,9 @@ func ldpe(f *bio.Reader, pkg string, length int64, pn string) {
        peobj.pesym = make([]PeSym, peobj.fh.NumberOfSymbols)
 
        peobj.npesym = uint(peobj.fh.NumberOfSymbols)
-       f.Seek(int64(base)+int64(peobj.fh.PointerToSymbolTable), 0)
+       f.Seek(base+int64(peobj.fh.PointerToSymbolTable), 0)
        for i := 0; uint32(i) < peobj.fh.NumberOfSymbols; i += numaux + 1 {
-               f.Seek(int64(base)+int64(peobj.fh.PointerToSymbolTable)+int64(len(symbuf))*int64(i), 0)
+               f.Seek(base+int64(peobj.fh.PointerToSymbolTable)+int64(len(symbuf))*int64(i), 0)
                if _, err := io.ReadFull(f, symbuf[:]); err != nil {
                        goto bad
                }
index bdcc84a129e6d7413c0327a49792c9693a5b909a..a18098e7e734b518f816030bd6ca25a8774718d0 100644 (file)
@@ -765,7 +765,7 @@ func nextar(bp *bio.Reader, off int64, a *ArHdr) int64 {
        if arsize&1 != 0 {
                arsize++
        }
-       return int64(arsize) + SAR_HDR
+       return arsize + SAR_HDR
 }
 
 func objfile(lib *Library) {
@@ -1953,7 +1953,7 @@ func genasmsym(put func(*LSym, string, int, int64, int64, int, *LSym)) {
                                continue
                        }
                        if len(s.P) > 0 {
-                               Diag("%s should not be bss (size=%d type=%d special=%v)", s.Name, int(len(s.P)), s.Type, s.Attr.Special())
+                               Diag("%s should not be bss (size=%d type=%d special=%v)", s.Name, len(s.P), s.Type, s.Attr.Special())
                        }
                        put(s, s.Name, 'B', Symaddr(s), s.Size, int(s.Version), s.Gotype)
 
index 1d9a1a932443b2d0e030fa6a4a3bf302c1ffb862..46cce4c331285c8ca6ce40208c097383e068ef68 100644 (file)
@@ -703,11 +703,11 @@ func machosymtab() {
                        Addstring(symstr, s.Extname)
                } else {
                        for p = s.Extname; p != ""; p = p[1:] {
-                               if uint8(p[0]) == 0xc2 && uint8((p[1:])[0]) == 0xb7 {
+                               if p[0] == 0xc2 && (p[1:])[0] == 0xb7 {
                                        Adduint8(Ctxt, symstr, '.')
                                        p = p[1:]
                                } else {
-                                       Adduint8(Ctxt, symstr, uint8(p[0]))
+                                       Adduint8(Ctxt, symstr, p[0])
                                }
                        }
 
index b4d2a2184f5602ea4b73fb76565185cfca746c85..dffb7a3d9beafe1f0a8b8626c12da7b9f7ac73f5 100644 (file)
@@ -472,7 +472,7 @@ func (r *objReader) readInt64() int64 {
                }
        }
 
-       return int64(uv>>1) ^ (int64(uint64(uv)<<63) >> 63)
+       return int64(uv>>1) ^ (int64(uv<<63) >> 63)
 }
 
 func (r *objReader) readInt() int {
index 74ef8c292924008d660990347279f9cca5f22c04..345eaa1ac2d581ecfd6a530bb27f96464e9aa104 100644 (file)
@@ -179,7 +179,7 @@ func renumberfiles(ctxt *Link, files []*LSym, d *Pcdata) {
 
                dv = val - newval
                newval = val
-               v = (uint32(dv) << 1) ^ uint32(int32(dv>>31))
+               v = (uint32(dv) << 1) ^ uint32(dv>>31)
                addvarint(&out, v)
 
                // pc delta
@@ -378,7 +378,7 @@ func pclntab() {
        ftab.Size = int64(len(ftab.P))
 
        if Debug['v'] != 0 {
-               fmt.Fprintf(Bso, "%5.2f pclntab=%d bytes, funcdata total %d bytes\n", obj.Cputime(), int64(ftab.Size), int64(funcdata_bytes))
+               fmt.Fprintf(Bso, "%5.2f pclntab=%d bytes, funcdata total %d bytes\n", obj.Cputime(), ftab.Size, funcdata_bytes)
        }
 }
 
index 0204b8c8c290d814e5bdb8aa21c8d9c1971b1b1a..8985c4058858462d4ec43349deb821fa7ca51865 100644 (file)
@@ -877,7 +877,7 @@ func peemitreloc(text, data, ctors *IMAGE_SECTION_HEADER) {
        ctors.NumberOfRelocations = 1
        ctors.PointerToRelocations = uint32(Cpos())
        sectoff := ctors.VirtualAddress
-       Lputl(uint32(sectoff))
+       Lputl(sectoff)
        Lputl(uint32(dottext.Dynid))
        switch obj.Getgoarch() {
        default:
@@ -1043,7 +1043,7 @@ func addpesymtable() {
        // write COFF string table
        Lputl(uint32(len(strtbl)) + 4)
        for i := 0; i < len(strtbl); i++ {
-               Cput(uint8(strtbl[i]))
+               Cput(strtbl[i])
        }
        if Linkmode != LinkExternal {
                strnput("", int(h.SizeOfRawData-uint32(size)))
index 60bec0d6c9ec926ce086438bb9c2395fba9e7442..96e8de5030640ec21a2674cdd358d2a5a373e798 100644 (file)
@@ -236,10 +236,10 @@ func putplan9sym(x *LSym, s string, t int, addr int64, size int64, ver int, go_
 
                var i int
                if t == 'z' || t == 'Z' {
-                       Cput(uint8(s[0]))
+                       Cput(s[0])
                        for i = 1; s[i] != 0 || s[i+1] != 0; i += 2 {
-                               Cput(uint8(s[i]))
-                               Cput(uint8(s[i+1]))
+                               Cput(s[i])
+                               Cput(s[i+1])
                        }
 
                        Cput(0)
@@ -251,7 +251,7 @@ func putplan9sym(x *LSym, s string, t int, addr int64, size int64, ver int, go_
                                s = s[1:]
                        }
                        for i = 0; i < len(s); i++ {
-                               Cput(uint8(s[i]))
+                               Cput(s[i])
                        }
                        Cput(0)
                }
index ad6a1f75246e59886bf146359ca9d4b6ddbd6bfa..785002b02c382f67098076dc9bd0eee2b1e7114a 100644 (file)
@@ -193,7 +193,7 @@ func asmb() {
                        if sym != nil {
                                ld.Lcsize = int32(len(sym.P))
                                for i := 0; int32(i) < ld.Lcsize; i++ {
-                                       ld.Cput(uint8(sym.P[i]))
+                                       ld.Cput(sym.P[i])
                                }
 
                                ld.Cflush()
@@ -214,7 +214,7 @@ func asmb() {
                if ld.SysArch == sys.ArchMIPS64LE {
                        magic = uint32(4*26*26 + 7)
                }
-               ld.Thearch.Lput(uint32(magic))              /* magic */
+               ld.Thearch.Lput(magic)                      /* magic */
                ld.Thearch.Lput(uint32(ld.Segtext.Filelen)) /* sizes */
                ld.Thearch.Lput(uint32(ld.Segdata.Filelen))
                ld.Thearch.Lput(uint32(ld.Segdata.Length - ld.Segdata.Filelen))
index 3970f3c5f9a44705d8920da8289fb2019cae1855..562e0810e07fa1960d75c2c04f2cf9a3cf892e59 100644 (file)
@@ -913,7 +913,7 @@ func asmb() {
                        if sym != nil {
                                ld.Lcsize = int32(len(sym.P))
                                for i := 0; int32(i) < ld.Lcsize; i++ {
-                                       ld.Cput(uint8(sym.P[i]))
+                                       ld.Cput(sym.P[i])
                                }
 
                                ld.Cflush()
index 19a8917ec836913d249459e127eb1f30328bb6fb..5231ad1f6c9acf80def4181cf472cf07eed4079e 100644 (file)
@@ -699,7 +699,7 @@ func asmb() {
                        if sym != nil {
                                ld.Lcsize = int32(len(sym.P))
                                for i := 0; int32(i) < ld.Lcsize; i++ {
-                                       ld.Cput(uint8(sym.P[i]))
+                                       ld.Cput(sym.P[i])
                                }
 
                                ld.Cflush()
index e8164a46f93d4fd55c152327fcef4d16fd7a6b7c..abff14fb1d855e06348e1d8f54e66688171f68df 100644 (file)
@@ -111,7 +111,7 @@ func validateStructTag(tag string) error {
                if i >= len(tag) {
                        return errTagValueSyntax
                }
-               qvalue := string(tag[:i+1])
+               qvalue := tag[:i+1]
                tag = tag[i+1:]
 
                if _, err := strconv.Unquote(qvalue); err != nil {