diff options
| author | Matthew Dempsky <mdempsky@google.com> | 2016-04-14 19:09:36 -0700 |
|---|---|---|
| committer | Matthew Dempsky <mdempsky@google.com> | 2016-04-15 07:31:45 +0000 |
| commit | 0da4dbe2322eb3b6224df35ce3e9fc83f104762b (patch) | |
| tree | 264b8c9e959b16d9b3754996414b948ee6166cd7 /src/debug/elf | |
| parent | 80e7dddffafa6c5eb8e98d642b87546eb8e445ab (diff) | |
| download | go-0da4dbe2322eb3b6224df35ce3e9fc83f104762b.tar.xz | |
all: remove unnecessary type conversions
cmd and runtime were handled separately, and I'm intentionally skipped
syscall. This is the rest of the standard library.
CL generated mechanically with github.com/mdempsky/unconvert.
Change-Id: I9e0eff886974dedc37adb93f602064b83e469122
Reviewed-on: https://go-review.googlesource.com/22104
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/debug/elf')
| -rw-r--r-- | src/debug/elf/elf.go | 4 | ||||
| -rw-r--r-- | src/debug/elf/file.go | 32 |
2 files changed, 18 insertions, 18 deletions
diff --git a/src/debug/elf/elf.go b/src/debug/elf/elf.go index af881c2495..3f43d4d896 100644 --- a/src/debug/elf/elf.go +++ b/src/debug/elf/elf.go @@ -2060,8 +2060,8 @@ type Rela32 struct { Addend int32 /* Addend. */ } -func R_SYM32(info uint32) uint32 { return uint32(info >> 8) } -func R_TYPE32(info uint32) uint32 { return uint32(info & 0xff) } +func R_SYM32(info uint32) uint32 { return info >> 8 } +func R_TYPE32(info uint32) uint32 { return info & 0xff } func R_INFO32(sym, typ uint32) uint32 { return sym<<8 | typ } // ELF32 Symbol. diff --git a/src/debug/elf/file.go b/src/debug/elf/file.go index 8fbf23fe5a..c173ea9331 100644 --- a/src/debug/elf/file.go +++ b/src/debug/elf/file.go @@ -294,7 +294,7 @@ func NewFile(r io.ReaderAt) (*File, error) { } f.Type = Type(hdr.Type) f.Machine = Machine(hdr.Machine) - f.Entry = uint64(hdr.Entry) + f.Entry = hdr.Entry if v := Version(hdr.Version); v != f.Version { return nil, &FormatError{0, "mismatched ELF version", v} } @@ -341,12 +341,12 @@ func NewFile(r io.ReaderAt) (*File, error) { p.ProgHeader = ProgHeader{ Type: ProgType(ph.Type), Flags: ProgFlag(ph.Flags), - Off: uint64(ph.Off), - Vaddr: uint64(ph.Vaddr), - Paddr: uint64(ph.Paddr), - Filesz: uint64(ph.Filesz), - Memsz: uint64(ph.Memsz), - Align: uint64(ph.Align), + Off: ph.Off, + Vaddr: ph.Vaddr, + Paddr: ph.Paddr, + Filesz: ph.Filesz, + Memsz: ph.Memsz, + Align: ph.Align, } } p.sr = io.NewSectionReader(r, int64(p.Off), int64(p.Filesz)) @@ -374,8 +374,8 @@ func NewFile(r io.ReaderAt) (*File, error) { Addr: uint64(sh.Addr), Offset: uint64(sh.Off), FileSize: uint64(sh.Size), - Link: uint32(sh.Link), - Info: uint32(sh.Info), + Link: sh.Link, + Info: sh.Info, Addralign: uint64(sh.Addralign), Entsize: uint64(sh.Entsize), } @@ -388,13 +388,13 @@ func NewFile(r io.ReaderAt) (*File, error) { s.SectionHeader = SectionHeader{ Type: SectionType(sh.Type), Flags: SectionFlag(sh.Flags), - Offset: uint64(sh.Off), - FileSize: uint64(sh.Size), - Addr: uint64(sh.Addr), - Link: uint32(sh.Link), - Info: uint32(sh.Info), - Addralign: uint64(sh.Addralign), - Entsize: uint64(sh.Entsize), + Offset: sh.Off, + FileSize: sh.Size, + Addr: sh.Addr, + Link: sh.Link, + Info: sh.Info, + Addralign: sh.Addralign, + Entsize: sh.Entsize, } } s.sr = io.NewSectionReader(r, int64(s.Offset), int64(s.FileSize)) |
