summaryrefslogtreecommitdiff
path: root/xgbgen/translation.go
diff options
context:
space:
mode:
authorAndrew Gallant (Ocelot) <[email protected]>2012-05-06 03:06:02 -0400
committerAndrew Gallant (Ocelot) <[email protected]>2012-05-06 03:06:02 -0400
commitb081fc803a2b33daa0a9f5281c7a84e70df95068 (patch)
treeae80dd2f6bbd6a57074baa0929334b3b15f0acb4 /xgbgen/translation.go
parent864eb4f165c20b07fd6ef2a2993aaa39a9714a1a (diff)
more bug fixes for the rest of the extensions
Diffstat (limited to 'xgbgen/translation.go')
-rw-r--r--xgbgen/translation.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/xgbgen/translation.go b/xgbgen/translation.go
index b650bc4..90cd0f3 100644
--- a/xgbgen/translation.go
+++ b/xgbgen/translation.go
@@ -89,7 +89,7 @@ func (xml *XML) Translate() *Protocol {
if !ok {
continue
}
- nextValue := uint(0)
+ nextValue := 0
for _, item := range enum.Items {
if item.Expr == nil {
item.Expr = &Value{v: nextValue}
@@ -267,16 +267,16 @@ func (x *XMLExpression) Translate() Expression {
Expr: x.Exprs[0].Translate(),
}
case "value":
- val, err := strconv.Atoi(x.Data)
+ val, err := strconv.Atoi(strings.TrimSpace(x.Data))
if err != nil {
log.Panicf("Could not convert '%s' in 'value' expression to int.",
x.Data)
}
return &Value{
- v: uint(val),
+ v: val,
}
case "bit":
- bit, err := strconv.Atoi(x.Data)
+ bit, err := strconv.Atoi(strings.TrimSpace(x.Data))
if err != nil {
log.Panicf("Could not convert '%s' in 'bit' expression to int.",
x.Data)
@@ -286,7 +286,7 @@ func (x *XMLExpression) Translate() Expression {
" is %d", bit)
}
return &Bit{
- b: uint(bit),
+ b: bit,
}
case "fieldref":
return &FieldRef{