diff options
author | Andrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu> | 2012-05-06 17:48:40 -0400 |
---|---|---|
committer | Andrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu> | 2012-05-06 17:48:40 -0400 |
commit | 6d545e723a7e972998a0e77adcf2219a31a9b800 (patch) | |
tree | 1aa0e2cb470b178669d1abab52c7b8ebac406964 /nexgb/xgbgen/go_request_reply.go | |
parent | 135cee57610cccd10009b264cce7fbcd5af367cb (diff) | |
download | haven-6d545e723a7e972998a0e77adcf2219a31a9b800.tar.gz haven-6d545e723a7e972998a0e77adcf2219a31a9b800.tar.xz haven-6d545e723a7e972998a0e77adcf2219a31a9b800.zip |
add more extension cruft. make extension checking more uniform.
Diffstat (limited to 'nexgb/xgbgen/go_request_reply.go')
-rw-r--r-- | nexgb/xgbgen/go_request_reply.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/nexgb/xgbgen/go_request_reply.go b/nexgb/xgbgen/go_request_reply.go index e64e2a2..451667f 100644 --- a/nexgb/xgbgen/go_request_reply.go +++ b/nexgb/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() } } |