From 6d545e723a7e972998a0e77adcf2219a31a9b800 Mon Sep 17 00:00:00 2001 From: "Andrew Gallant (Ocelot)" Date: Sun, 6 May 2012 17:48:40 -0400 Subject: add more extension cruft. make extension checking more uniform. --- nexgb/xgbgen/request_reply.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nexgb/xgbgen/request_reply.go') diff --git a/nexgb/xgbgen/request_reply.go b/nexgb/xgbgen/request_reply.go index 7cd2859..c7a4cf8 100644 --- a/nexgb/xgbgen/request_reply.go +++ b/nexgb/xgbgen/request_reply.go @@ -22,7 +22,7 @@ type Request struct { // It also initializes the reply if one exists, and all fields in this request. func (r *Request) Initialize(p *Protocol) { r.srcName = SrcName(p, r.xmlName) - if p.Name != "xproto" { + if p.isExt() { r.srcName = strings.Title(strings.ToLower(p.Name)) + r.srcName } @@ -93,7 +93,7 @@ func (r *Request) Size(c *Context) Size { // request. In an extension request, this byte is always occupied // by the opcode of the request (while the first byte is always occupied // by the opcode of the extension). - if c.protocol.Name == "xproto" { + if !c.protocol.isExt() { size = size.Add(newFixedSize(3)) } else { size = size.Add(newFixedSize(4)) -- cgit v1.2.3