diff options
author | Andrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu> | 2012-05-06 03:06:02 -0400 |
---|---|---|
committer | Andrew Gallant (Ocelot) <Andrew.Gallant@tufts.edu> | 2012-05-06 03:06:02 -0400 |
commit | ea30f1a0a718e5e86343cceac12104baab1bedca (patch) | |
tree | cb947c3533bf048336ba0e1c16a53a8c7f35e1ca /nexgb/xgbgen/translation.go | |
parent | 014a0598bfe6d997a5dacda9eae4591df0b17826 (diff) | |
download | haven-ea30f1a0a718e5e86343cceac12104baab1bedca.tar.gz haven-ea30f1a0a718e5e86343cceac12104baab1bedca.tar.xz haven-ea30f1a0a718e5e86343cceac12104baab1bedca.zip |
more bug fixes for the rest of the extensions
Diffstat (limited to 'nexgb/xgbgen/translation.go')
-rw-r--r-- | nexgb/xgbgen/translation.go | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/nexgb/xgbgen/translation.go b/nexgb/xgbgen/translation.go index b650bc4..90cd0f3 100644 --- a/nexgb/xgbgen/translation.go +++ b/nexgb/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{ |