From 62dc5fc5aaa670d765184bd15af97a3006745fcb Mon Sep 17 00:00:00 2001 From: Oleg Baranov Date: Sun, 14 Jan 2024 11:03:17 +0300 Subject: [PATCH] Fixed compilation for x86 (int size in dump) --- tvm/cell/cell.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tvm/cell/cell.go b/tvm/cell/cell.go index c9e788c7..abfb8cf1 100644 --- a/tvm/cell/cell.go +++ b/tvm/cell/cell.go @@ -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 @@ -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] }