Skip to content

Commit

Permalink
Merge pull request #167 from xssnick/dev-v189
Browse files Browse the repository at this point in the history
Fixed compilation for x86 (int size in dump)
  • Loading branch information
xssnick authored Jan 14, 2024
2 parents 8ce75d2 + 62dc5fc commit 9893120
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 9893120

Please sign in to comment.