Skip to content

Commit

Permalink
Fixed compilation for x86 (int size in dump)
Browse files Browse the repository at this point in the history
  • Loading branch information
xssnick committed Jan 14, 2024
1 parent 0b49db0 commit 62dc5fc
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions tvm/cell/cell.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,24 +103,24 @@ func (c *Cell) PeekRef(i int) (*Cell, error) {
}

func (c *Cell) Dump(limitLength ...int) string {
var lim = (1024 << 20) * 16
var lim = uint64(1024<<20) * 16
if len(limitLength) > 0 {
// 16 MB default lim
lim = limitLength[0]
lim = uint64(limitLength[0])
}
return c.dump(0, false, lim)
}

func (c *Cell) DumpBits(limitLength ...int) string {
var lim = (1024 << 20) * 16
var lim uint64 = (1024 << 20) * 16
if len(limitLength) > 0 {
// 16 MB default lim
lim = limitLength[0]
lim = uint64(limitLength[0])
}
return c.dump(0, true, lim)
}

func (c *Cell) dump(deep int, bin bool, limitLength int) string {
func (c *Cell) dump(deep int, bin bool, limitLength uint64) string {
sz, data, _ := c.BeginParse().RestBits()

var val string
Expand Down Expand Up @@ -156,14 +156,14 @@ func (c *Cell) dump(deep int, bin bool, limitLength int) string {
str += ","
}

if len(str) > limitLength {
if uint64(len(str)) > limitLength {
break
}
}
str += strings.Repeat(" ", deep) + "}"
}

if len(str) > limitLength {
if uint64(len(str)) > limitLength {
str = str[:limitLength]
}

Expand Down

0 comments on commit 62dc5fc

Please sign in to comment.