diff options
author | Andrew Gallant <jamslam@gmail.com> | 2013-12-28 10:02:18 -0500 |
---|---|---|
committer | Přemysl Janouch <p@janouch.name> | 2018-09-08 16:49:21 +0200 |
commit | 33509dbeb0acd7abbbb9e8c434d0c3f0ce8a3230 (patch) | |
tree | ce7d66adcb2e7fd3802a884b0fae618dfa1533a6 /nexgb/xgbgen | |
parent | ad9c35a02f190ea5da59c9c4a3aeddcf7e8a5c1f (diff) | |
download | haven-33509dbeb0acd7abbbb9e8c434d0c3f0ce8a3230.tar.gz haven-33509dbeb0acd7abbbb9e8c434d0c3f0ce8a3230.tar.xz haven-33509dbeb0acd7abbbb9e8c434d0c3f0ce8a3230.zip |
It appears that the "Str" type (which is built into the core X protocol)
doesn't specify any padding. So it has to be treated as a special case.
Close #12.
Diffstat (limited to 'nexgb/xgbgen')
-rw-r--r-- | nexgb/xgbgen/go_list.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/nexgb/xgbgen/go_list.go b/nexgb/xgbgen/go_list.go index 4cf962a..fa8df69 100644 --- a/nexgb/xgbgen/go_list.go +++ b/nexgb/xgbgen/go_list.go @@ -29,7 +29,10 @@ func (f *ListField) Read(c *Context, prefix string) { c.Putln("byteString := make([]%s, %s)", t.SrcName(), length) c.Putln("copy(byteString[:%s], buf[b:])", length) c.Putln("%s%s = string(byteString)", prefix, f.SrcName()) - c.Putln("b += xgb.Pad(int(%s))", length) + // This is apparently a special case. The "Str" type itself + // doesn't specify any padding. I suppose it's up to the + // request/reply spec that uses it to get the padding right? + c.Putln("b += int(%s)", length) c.Putln("}") } else if t.SrcName() == "byte" { c.Putln("%s%s = make([]%s, %s)", |