Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed compilation for x86 (int size in dump) #167

Merged
merged 1 commit into from
Jan 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading