Fixed float suffix not being added on implicit float defaults.

Change-Id: I8dcbb5e93836356511d411ef86452babd3dd3c0b
Tested: on Linux.
This commit is contained in:
Wouter van Oortmerssen
2016-04-20 12:05:21 -07:00
parent 4d7890c2c9
commit fd542c71e3
11 changed files with 82 additions and 15 deletions

View File

@@ -543,10 +543,10 @@ CheckedError Parser::ParseField(StructDef &struct_def) {
if (!IsScalar(type.base_type))
return Error("default values currently only supported for scalars");
ECHECK(ParseSingleValue(field->value));
if (IsFloat(field->value.type.base_type)) {
if (!strpbrk(field->value.constant.c_str(), ".eE"))
field->value.constant += ".0";
}
}
if (IsFloat(field->value.type.base_type)) {
if (!strpbrk(field->value.constant.c_str(), ".eE"))
field->value.constant += ".0";
}
if (type.enum_def &&