summaryrefslogtreecommitdiff
path: root/xgbgen/go_single_field.go
diff options
context:
space:
mode:
authorAndrew Gallant <[email protected]>2013-12-28 09:33:09 -0500
committerAndrew Gallant <[email protected]>2013-12-28 09:33:09 -0500
commit34dd98df049a0a6ecf661ff9fdfe31292688040a (patch)
treeb2cbe9e643ec6271bbcbdf8c1030a56575d57109 /xgbgen/go_single_field.go
parent9071499d31a04ae4e2e545e2f2227545d32187a4 (diff)
When writing, don't pad the length of bytes produced from inner
structs/unions. Each type should take care of its own padding. Close #14.
Diffstat (limited to 'xgbgen/go_single_field.go')
-rw-r--r--xgbgen/go_single_field.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/xgbgen/go_single_field.go b/xgbgen/go_single_field.go
index 3e3fa53..6c7218e 100644
--- a/xgbgen/go_single_field.go
+++ b/xgbgen/go_single_field.go
@@ -152,13 +152,13 @@ func (f *SingleField) Write(c *Context, prefix string) {
c.Putln("{")
c.Putln("unionBytes := %s%s.Bytes()", prefix, f.SrcName())
c.Putln("copy(buf[b:], unionBytes)")
- c.Putln("b += xgb.Pad(len(unionBytes))")
+ c.Putln("b += len(unionBytes)")
c.Putln("}")
case *Struct:
c.Putln("{")
c.Putln("structBytes := %s%s.Bytes()", prefix, f.SrcName())
c.Putln("copy(buf[b:], structBytes)")
- c.Putln("b += xgb.Pad(len(structBytes))")
+ c.Putln("b += len(structBytes)")
c.Putln("}")
default:
log.Fatalf("Cannot read field '%s' with %T type.", f.XmlName(), f.Type)