diff --git a/pkg/a2l/a2lhelpers.go b/pkg/a2l/a2lhelpers.go index 3d7d2e1..3ffcfa6 100644 --- a/pkg/a2l/a2lhelpers.go +++ b/pkg/a2l/a2lhelpers.go @@ -26,7 +26,7 @@ func a2lIntToIntType(integerValue parser.IIntegerValueContext) (result *IntType) if tmpResult, err = strconv.ParseInt(rawString, int(base), 64); err == nil { result = &IntType{ - Value: tmpResult, + Value: int32(tmpResult), Base: base, Size: uint32(len(rawString)), } @@ -56,7 +56,7 @@ func a2lLongToLongType(integerValue parser.IIntegerValueContext) (result *LongTy if tmpResult, err = strconv.ParseInt(rawString, int(base), 64); err == nil { result = &LongType{ - Value: tmpResult, + Value: int32(tmpResult), Base: base, Size: uint32(len(rawString)), } @@ -86,7 +86,7 @@ func numericToLongType(integerValue parser.INumericValueContext) (result *LongTy if tmpResult, err = strconv.ParseInt(rawString, int(base), 64); err == nil { result = &LongType{ - Value: tmpResult, + Value: int32(tmpResult), Base: base, Size: uint32(len(rawString)), } @@ -148,7 +148,7 @@ func floatToFloatType(integerValue parser.INumericValueContext) (result *FloatTy } if tmpResult, err = strconv.ParseFloat(originalString, 64); err == nil { - result.Value = tmpResult + result.Value = float32(tmpResult) } else { panic(err) } diff --git a/pkg/a2l/a2mlhelpers.go b/pkg/a2l/a2mlhelpers.go index 8db7381..9c86705 100644 --- a/pkg/a2l/a2mlhelpers.go +++ b/pkg/a2l/a2mlhelpers.go @@ -35,7 +35,7 @@ func arraySpecifierToLongType(integerValue parser.IArraySpecifierContext) (resul if tmpResult, err = strconv.ParseInt(rawString, int(base), 64); err == nil { result = &LongType{ - Value: tmpResult, + Value: int32(tmpResult), Base: base, Size: uint32(len(rawString)), } diff --git a/protobuf/shared.proto b/protobuf/shared.proto index f4e8bb1..1c55dc8 100644 --- a/protobuf/shared.proto +++ b/protobuf/shared.proto @@ -3,19 +3,19 @@ syntax = "proto3"; option go_package = "./../pkg/a2l"; message IntType { - int64 Value = 1; + int32 Value = 1; uint32 Base = 2; uint32 Size = 3; } message LongType { - int64 Value = 1; + int32 Value = 1; uint32 Base = 2; uint32 Size = 3; } message FloatType { - double Value = 1; + float Value = 1; optional string IntegralSign = 2; uint32 IntegralSize = 3; uint32 DecimalSize = 4;