Compare commits

..

1 Commits

Author SHA1 Message Date
492815c8fc lxdrgen-go: fix compatibility with 32-bit targets
All checks were successful
Alpine 3.20 Success
2024-11-09 17:06:46 +01:00

View File

@@ -145,7 +145,7 @@ function codegen_begin( funcname) {
print "// " funcname " tries to serialize a string value," print "// " funcname " tries to serialize a string value,"
print "// appending it to the end of a byte stream." print "// appending it to the end of a byte stream."
print "func " funcname "(data []byte, s string) ([]byte, bool) {" print "func " funcname "(data []byte, s string) ([]byte, bool) {"
print "\tif len(s) > math.MaxUint32 {" print "\tif int64(len(s)) > math.MaxUint32 {"
print "\t\treturn nil, false" print "\t\treturn nil, false"
print "\t}" print "\t}"
print "\tdata = binary.BigEndian.AppendUint32(data, uint32(len(s)))" print "\tdata = binary.BigEndian.AppendUint32(data, uint32(len(s)))"