From 38b293e74db6631873d5dfd74cf731eb7b76737d Mon Sep 17 00:00:00 2001 From: Andrew Gallant Date: Sun, 11 Aug 2013 20:54:15 -0400 Subject: Padding on a list is on the length of the list. There was a bug where padding was being computed on each element of the list. Close #5. --- nexgb/xgbgen/go_struct.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nexgb/xgbgen/go_struct.go') diff --git a/nexgb/xgbgen/go_struct.go b/nexgb/xgbgen/go_struct.go index 984a336..0f18084 100644 --- a/nexgb/xgbgen/go_struct.go +++ b/nexgb/xgbgen/go_struct.go @@ -93,9 +93,9 @@ func (s *Struct) WriteList(c *Context) { c.Putln("for _, item := range list {") c.Putln("structBytes = item.Bytes()") c.Putln("copy(buf[b:], structBytes)") - c.Putln("b += xgb.Pad(len(structBytes))") + c.Putln("b += len(structBytes)") c.Putln("}") - c.Putln("return b") + c.Putln("return xgb.Pad(b)") c.Putln("}") c.Putln("") } -- cgit v1.2.3