aboutsummaryrefslogtreecommitdiff
path: root/nexgb/xgbgen/go.go
diff options
context:
space:
mode:
authorAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-05-10 17:01:42 -0400
committerAndrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu>2012-05-10 17:01:42 -0400
commit0c50dc6241fa21712e041cfa2bfb9db4ccaef10a (patch)
tree90a3200414c8ad6df8e7983a8e73fedfbe2b324e /nexgb/xgbgen/go.go
parente239bb3c68a4981a3916534203c2fbd6b96f593c (diff)
downloadhaven-0c50dc6241fa21712e041cfa2bfb9db4ccaef10a.tar.gz
haven-0c50dc6241fa21712e041cfa2bfb9db4ccaef10a.tar.xz
haven-0c50dc6241fa21712e041cfa2bfb9db4ccaef10a.zip
a huge commit. splitting extensions into their own sub-packages.
Diffstat (limited to 'nexgb/xgbgen/go.go')
-rw-r--r--nexgb/xgbgen/go.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/nexgb/xgbgen/go.go b/nexgb/xgbgen/go.go
index 2b2c191..6c680e8 100644
--- a/nexgb/xgbgen/go.go
+++ b/nexgb/xgbgen/go.go
@@ -82,7 +82,7 @@ func (enum *Enum) Define(c *Context) {
func (res *Resource) Define(c *Context) {
c.Putln("type %s uint32", res.SrcName())
c.Putln("")
- c.Putln("func (c *Conn) New%sId() (%s, error) {",
+ c.Putln("func New%sId(c *xgb.Conn) (%s, error) {",
res.SrcName(), res.SrcName())
c.Putln("id, err := c.NewId()")
c.Putln("if err != nil {")
@@ -167,10 +167,10 @@ func (f *ValueField) Read(c *Context, prefix string) {
c.Putln("%s%s = make([]uint32, %s)",
prefix, f.ListName, f.ListLength().Reduce(prefix))
c.Putln("for i := 0; i < %s; i++ {", f.ListLength().Reduce(prefix))
- c.Putln("%s%s[i] = Get32(buf[b:])", prefix, f.ListName)
+ c.Putln("%s%s[i] = xgb.Get32(buf[b:])", prefix, f.ListName)
c.Putln("b += 4")
c.Putln("}")
- c.Putln("b = pad(b)")
+ c.Putln("b = xgb.Pad(b)")
}
func (f *ValueField) Write(c *Context, prefix string) {
@@ -180,10 +180,10 @@ func (f *ValueField) Write(c *Context, prefix string) {
fmt.Sprintf("%s%s", prefix, f.MaskName), f.MaskType)
}
c.Putln("for i := 0; i < %s; i++ {", f.ListLength().Reduce(prefix))
- c.Putln("Put32(buf[b:], %s%s[i])", prefix, f.ListName)
+ c.Putln("xgb.Put32(buf[b:], %s%s[i])", prefix, f.ListName)
c.Putln("b += 4")
c.Putln("}")
- c.Putln("b = pad(b)")
+ c.Putln("b = xgb.Pad(b)")
}
// Switch field