aboutsummaryrefslogtreecommitdiff
path: root/nexgb/xgbgen
diff options
context:
space:
mode:
Diffstat (limited to 'nexgb/xgbgen')
-rw-r--r--nexgb/xgbgen/context.go2
-rw-r--r--nexgb/xgbgen/field.go4
-rw-r--r--nexgb/xgbgen/go_error.go2
-rw-r--r--nexgb/xgbgen/go_event.go5
-rw-r--r--nexgb/xgbgen/go_list.go1
-rw-r--r--nexgb/xgbgen/go_request_reply.go18
-rw-r--r--nexgb/xgbgen/go_union.go1
-rw-r--r--nexgb/xgbgen/protocol.go1
-rw-r--r--nexgb/xgbgen/request_reply.go4
-rw-r--r--nexgb/xgbgen/translation.go2
-rw-r--r--nexgb/xgbgen/xml.go32
11 files changed, 35 insertions, 37 deletions
diff --git a/nexgb/xgbgen/context.go b/nexgb/xgbgen/context.go
index 35dd37e..f1762d3 100644
--- a/nexgb/xgbgen/context.go
+++ b/nexgb/xgbgen/context.go
@@ -86,7 +86,7 @@ func (c *Context) Morph(xmlBytes []byte) {
c.Putln("case err != nil:")
c.Putln("return err")
c.Putln("case !reply.Present:")
- c.Putln("return newError(\"No extension named %s could be found on " +
+ c.Putln("return newError(\"No extension named %s could be found on "+
"on the server.\")", xname)
c.Putln("}")
c.Putln("")
diff --git a/nexgb/xgbgen/field.go b/nexgb/xgbgen/field.go
index 4452408..7c83f1a 100644
--- a/nexgb/xgbgen/field.go
+++ b/nexgb/xgbgen/field.go
@@ -220,7 +220,7 @@ func (f *ExprField) Initialize(p *Protocol) {
// integers. The mask specifies which kinds of values are in the list.
// (i.e., See ConfigureWindow, CreateWindow, ChangeWindowAttributes, etc.)
type ValueField struct {
- Parent interface{}
+ Parent interface{}
MaskType Type
MaskName string
ListName string
@@ -247,7 +247,7 @@ func (f *ValueField) Size() Size {
listSize := newExpressionSize(&Function{
Name: "pad",
Expr: &BinaryOp{
- Op: "*",
+ Op: "*",
Expr1: &Value{v: 4},
Expr2: &PopCount{
Expr: &Function{
diff --git a/nexgb/xgbgen/go_error.go b/nexgb/xgbgen/go_error.go
index 0222289..9e01042 100644
--- a/nexgb/xgbgen/go_error.go
+++ b/nexgb/xgbgen/go_error.go
@@ -133,7 +133,7 @@ func (e *ErrorCopy) ImplementsError(c *Context) {
func ErrorFieldString(c *Context, fields []Field, errName string) {
c.Putln("fieldVals := make([]string, 0, %d)", len(fields))
c.Putln("fieldVals = append(fieldVals, \"NiceName: \" + err.NiceName)")
- c.Putln("fieldVals = append(fieldVals, " +
+ c.Putln("fieldVals = append(fieldVals, "+
"sprintf(\"Sequence: %s\", err.Sequence))", "%d")
for _, field := range fields {
switch field.(type) {
diff --git a/nexgb/xgbgen/go_event.go b/nexgb/xgbgen/go_event.go
index ce54e19..f55e26f 100644
--- a/nexgb/xgbgen/go_event.go
+++ b/nexgb/xgbgen/go_event.go
@@ -165,7 +165,7 @@ func (e *EventCopy) Write(c *Context) {
func EventFieldString(c *Context, fields []Field, evName string) {
c.Putln("fieldVals := make([]string, 0, %d)", len(fields))
if evName != "KeymapNotify" {
- c.Putln("fieldVals = append(fieldVals, " +
+ c.Putln("fieldVals = append(fieldVals, "+
"sprintf(\"Sequence: %s\", v.Sequence))", "%d")
}
for _, field := range fields {
@@ -177,7 +177,8 @@ func EventFieldString(c *Context, fields []Field, evName string) {
case *Base:
case *Resource:
case *TypeDef:
- default: continue
+ default:
+ continue
}
switch field.SrcType() {
diff --git a/nexgb/xgbgen/go_list.go b/nexgb/xgbgen/go_list.go
index 41cfb76..ad859bb 100644
--- a/nexgb/xgbgen/go_list.go
+++ b/nexgb/xgbgen/go_list.go
@@ -107,4 +107,3 @@ func (f *ListField) Write(c *Context, prefix string) {
f.XmlName(), f.Type)
}
}
-
diff --git a/nexgb/xgbgen/go_request_reply.go b/nexgb/xgbgen/go_request_reply.go
index 451667f..a9e624d 100644
--- a/nexgb/xgbgen/go_request_reply.go
+++ b/nexgb/xgbgen/go_request_reply.go
@@ -71,14 +71,14 @@ func (r *Request) ReadReply(c *Context) {
c.Putln("// Waits and reads reply data from request %s", r.SrcName())
c.Putln("func (cook %s) Reply() (*%s, error) {",
r.CookieName(), r.ReplyTypeName())
- c.Putln("buf, err := cook.reply()")
- c.Putln("if err != nil {")
- c.Putln("return nil, err")
- c.Putln("}")
- c.Putln("if buf == nil {")
- c.Putln("return nil, nil")
- c.Putln("}")
- c.Putln("return %s(buf), nil", r.ReplyName())
+ c.Putln("buf, err := cook.reply()")
+ c.Putln("if err != nil {")
+ c.Putln("return nil, err")
+ c.Putln("}")
+ c.Putln("if buf == nil {")
+ c.Putln("return nil, nil")
+ c.Putln("}")
+ c.Putln("return %s(buf), nil", r.ReplyName())
c.Putln("}")
c.Putln("")
@@ -107,7 +107,7 @@ func (r *Request) ReadReply(c *Context) {
func (r *Request) WriteRequest(c *Context) {
writeSize := func() {
- c.Putln("Put16(buf[b:], uint16(size / 4)) "+
+ c.Putln("Put16(buf[b:], uint16(size / 4)) " +
"// write request size in 4-byte units")
c.Putln("b += 2")
c.Putln("")
diff --git a/nexgb/xgbgen/go_union.go b/nexgb/xgbgen/go_union.go
index 9f339af..73e85f7 100644
--- a/nexgb/xgbgen/go_union.go
+++ b/nexgb/xgbgen/go_union.go
@@ -139,4 +139,3 @@ func (u *Union) WriteListSize(c *Context) {
c.Putln("}")
c.Putln("")
}
-
diff --git a/nexgb/xgbgen/protocol.go b/nexgb/xgbgen/protocol.go
index e01bc17..83dde14 100644
--- a/nexgb/xgbgen/protocol.go
+++ b/nexgb/xgbgen/protocol.go
@@ -38,4 +38,3 @@ func (p *Protocol) Initialize() {
func (p *Protocol) isExt() bool {
return strings.ToLower(p.Name) != "xproto"
}
-
diff --git a/nexgb/xgbgen/request_reply.go b/nexgb/xgbgen/request_reply.go
index c7a4cf8..4daa4ac 100644
--- a/nexgb/xgbgen/request_reply.go
+++ b/nexgb/xgbgen/request_reply.go
@@ -13,9 +13,9 @@ type Request struct {
srcName string // The Go name of this request.
xmlName string // The XML name of this request.
Opcode int
- Combine bool // Not currently used.
+ Combine bool // Not currently used.
Fields []Field // All fields in the request.
- Reply *Reply // A reply, if one exists for this request.
+ Reply *Reply // A reply, if one exists for this request.
}
// Initialize creates the proper Go source name for this request.
diff --git a/nexgb/xgbgen/translation.go b/nexgb/xgbgen/translation.go
index 592c152..e4d81bc 100644
--- a/nexgb/xgbgen/translation.go
+++ b/nexgb/xgbgen/translation.go
@@ -339,7 +339,7 @@ func (x *XMLField) Translate(parent interface{}) Field {
}
case "valueparam":
return &ValueField{
- Parent: parent,
+ Parent: parent,
MaskType: newTranslation(x.ValueMaskType),
MaskName: x.ValueMaskName,
ListName: x.ValueListName,
diff --git a/nexgb/xgbgen/xml.go b/nexgb/xgbgen/xml.go
index df21433..440d0a8 100644
--- a/nexgb/xgbgen/xml.go
+++ b/nexgb/xgbgen/xml.go
@@ -17,11 +17,11 @@ type XML struct {
// Types for all top-level elements.
// First are the simple ones.
- Imports XMLImports `xml:"import"`
- Enums []*XMLEnum `xml:"enum"`
- Xids []*XMLXid `xml:"xidtype"`
- XidUnions []*XMLXid `xml:"xidunion"`
- TypeDefs []*XMLTypeDef `xml:"typedef"`
+ Imports XMLImports `xml:"import"`
+ Enums []*XMLEnum `xml:"enum"`
+ Xids []*XMLXid `xml:"xidtype"`
+ XidUnions []*XMLXid `xml:"xidunion"`
+ TypeDefs []*XMLTypeDef `xml:"typedef"`
EventCopies []*XMLEventCopy `xml:"eventcopy"`
ErrorCopies []*XMLErrorCopy `xml:"errorcopy"`
@@ -93,21 +93,21 @@ type XMLErrorCopy struct {
}
type XMLStruct struct {
- Name string `xml:"name,attr"`
+ Name string `xml:"name,attr"`
Fields []*XMLField `xml:",any"`
}
type XMLUnion struct {
- Name string `xml:"name,attr"`
+ Name string `xml:"name,attr"`
Fields []*XMLField `xml:",any"`
}
type XMLRequest struct {
- Name string `xml:"name,attr"`
- Opcode int `xml:"opcode,attr"`
- Combine bool `xml:"combine-adjacent,attr"`
+ Name string `xml:"name,attr"`
+ Opcode int `xml:"opcode,attr"`
+ Combine bool `xml:"combine-adjacent,attr"`
Fields []*XMLField `xml:",any"`
- Reply *XMLReply `xml:"reply"`
+ Reply *XMLReply `xml:"reply"`
}
type XMLReply struct {
@@ -115,15 +115,15 @@ type XMLReply struct {
}
type XMLEvent struct {
- Name string `xml:"name,attr"`
- Number int `xml:"number,attr"`
- NoSequence bool `xml:"no-sequence-number,attr"`
+ Name string `xml:"name,attr"`
+ Number int `xml:"number,attr"`
+ NoSequence bool `xml:"no-sequence-number,attr"`
Fields []*XMLField `xml:",any"`
}
type XMLError struct {
- Name string `xml:"name,attr"`
- Number int `xml:"number,attr"`
+ Name string `xml:"name,attr"`
+ Number int `xml:"number,attr"`
Fields []*XMLField `xml:",any"`
}