Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
lmbsog0 committed Jun 13, 2023
1 parent f01040a commit 6250c3a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions pkg/a2l/a2lhelpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
}
Expand Down Expand Up @@ -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)),
}
Expand Down Expand Up @@ -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)),
}
Expand Down Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/a2l/a2mlhelpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
}
Expand Down
6 changes: 3 additions & 3 deletions protobuf/shared.proto
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 6250c3a

Please sign in to comment.