mirror of
https://github.com/vee1e/flatbuffers.git
synced 2026-09-04 19:27:41 +00:00
Removed truncating of enum vals to int in ReverseLookup.
Some implementations (e.g. C++98) won't support 64-bit enum values, but there is no reason to silently truncate them. Change-Id: I8629563523a96e887068f9c0efcd53741f60e0d6 Tested: on Linux.
This commit is contained in:
parent
462ce03ebe
commit
8df2d9a3ef
6 changed files with 9 additions and 9 deletions
|
|
@ -876,7 +876,7 @@ class PhpGenerator : public BaseGenerator {
|
|||
std::string GenDefaultValue(const Value &value) {
|
||||
if (value.type.enum_def) {
|
||||
if (auto val = value.type.enum_def->ReverseLookup(
|
||||
atoi(value.constant.c_str()), false)) {
|
||||
StringToInt(value.constant.c_str()), false)) {
|
||||
return WrapInNameSpace(*value.type.enum_def) + "::" + val->name;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue