cmd/compile: convert data siz to int

Follow-up to CL 20645.

Passes toolstash -cmp.

Change-Id: Idc63c41b2be2d52e3a6ac59b3a12eb41aa2efbed
Reviewed-on: https://go-review.googlesource.com/20670
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2016-03-13 19:28:32 -07:00
parent 57faad6677
commit e59c1729ba
3 changed files with 19 additions and 19 deletions

View file

@ -53,14 +53,14 @@ func Symgrow(ctxt *Link, s *LSym, lsiz int64) {
}
// prepwrite prepares to write data of size siz into s at offset off.
func (s *LSym) prepwrite(ctxt *Link, off, siz int64) {
func (s *LSym) prepwrite(ctxt *Link, off int64, siz int) {
if off < 0 || siz < 0 || off >= 1<<30 {
log.Fatalf("prepwrite: bad off=%d siz=%d", off, siz)
}
if s.Type == SBSS || s.Type == STLSBSS {
ctxt.Diag("cannot supply data for BSS var")
}
Symgrow(ctxt, s, off+siz)
Symgrow(ctxt, s, off+int64(siz))
}
// WriteFloat32 writes f into s at offset off.
@ -76,7 +76,7 @@ func (s *LSym) WriteFloat64(ctxt *Link, off int64, f float64) {
}
// WriteInt writes an integer i of size siz into s at offset off.
func (s *LSym) WriteInt(ctxt *Link, off, siz int64, i int64) {
func (s *LSym) WriteInt(ctxt *Link, off int64, siz int, i int64) {
s.prepwrite(ctxt, off, siz)
switch siz {
default:
@ -94,8 +94,8 @@ func (s *LSym) WriteInt(ctxt *Link, off, siz int64, i int64) {
// WriteAddr writes an address of size siz into s at offset off.
// rsym and roff specify the relocation for the address.
func (s *LSym) WriteAddr(ctxt *Link, off, siz int64, rsym *LSym, roff int64) {
if siz != int64(ctxt.Arch.Ptrsize) {
func (s *LSym) WriteAddr(ctxt *Link, off int64, siz int, rsym *LSym, roff int64) {
if siz != ctxt.Arch.Ptrsize {
ctxt.Diag("WriteAddr: bad address size: %d", siz)
}
s.prepwrite(ctxt, off, siz)
@ -108,12 +108,12 @@ func (s *LSym) WriteAddr(ctxt *Link, off, siz int64, rsym *LSym, roff int64) {
}
// WriteString writes a string of size siz into s at offset off.
func (s *LSym) WriteString(ctxt *Link, off, siz int64, str string) {
if siz < int64(len(str)) {
func (s *LSym) WriteString(ctxt *Link, off int64, siz int, str string) {
if siz < len(str) {
ctxt.Diag("WriteString: bad string size: %d < %d", siz, len(str))
}
s.prepwrite(ctxt, off, siz)
copy(s.P[off:off+siz], str)
copy(s.P[off:off+int64(siz)], str)
}
func Addrel(s *LSym) *Reloc {