summaryrefslogtreecommitdiff
path: root/xgbgen/go_request_reply.go
diff options
context:
space:
mode:
authorAndrew Gallant (Ocelot) <[email protected]>2012-05-06 17:48:40 -0400
committerAndrew Gallant (Ocelot) <[email protected]>2012-05-06 17:48:40 -0400
commit26191c0f45bd6a112085c44c271a135d65c80f18 (patch)
tree1ab3980e5daef82c6da6832dfb9c89543612d1f0 /xgbgen/go_request_reply.go
parent57ae07f66541348497db9a5bb84c99770e7b14c1 (diff)
add more extension cruft. make extension checking more uniform.
Diffstat (limited to 'xgbgen/go_request_reply.go')
-rw-r--r--xgbgen/go_request_reply.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/xgbgen/go_request_reply.go b/xgbgen/go_request_reply.go
index e64e2a2..451667f 100644
--- a/xgbgen/go_request_reply.go
+++ b/xgbgen/go_request_reply.go
@@ -118,7 +118,7 @@ func (r *Request) WriteRequest(c *Context) {
c.Putln("b := 0")
c.Putln("buf := make([]byte, size)")
c.Putln("")
- if strings.ToLower(c.protocol.Name) != "xproto" {
+ if c.protocol.isExt() {
c.Putln("buf[b] = c.extensions[\"%s\"]",
strings.ToUpper(c.protocol.ExtXName))
c.Putln("b += 1")
@@ -128,17 +128,17 @@ func (r *Request) WriteRequest(c *Context) {
c.Putln("b += 1")
c.Putln("")
if len(r.Fields) == 0 {
- if strings.ToLower(c.protocol.Name) == "xproto" {
+ if !c.protocol.isExt() {
c.Putln("b += 1 // padding")
}
writeSize()
- } else if strings.ToLower(c.protocol.Name) != "xproto" {
+ } else if c.protocol.isExt() {
writeSize()
}
for i, field := range r.Fields {
field.Write(c, "")
c.Putln("")
- if i == 0 && strings.ToLower(c.protocol.Name) == "xproto" {
+ if i == 0 && !c.protocol.isExt() {
writeSize()
}
}