diff options
author | Wouter van Oortmerssen <aardappel@gmail.com> | 2018-01-22 09:49:06 -0800 |
---|---|---|
committer | Wouter van Oortmerssen <aardappel@gmail.com> | 2018-01-22 09:51:17 -0800 |
commit | 8df2d9a3ef6d57e4afd048ef7a00a52bee0bcb65 (patch) | |
tree | bec11559f6b783ce1883fb66b30585326faa003c /src/idl_gen_php.cpp | |
parent | 462ce03ebe1b7133d65ed68920fe784c61731d98 (diff) | |
download | flatbuffers-8df2d9a3ef6d57e4afd048ef7a00a52bee0bcb65.tar.gz flatbuffers-8df2d9a3ef6d57e4afd048ef7a00a52bee0bcb65.tar.bz2 flatbuffers-8df2d9a3ef6d57e4afd048ef7a00a52bee0bcb65.zip |
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.
Diffstat (limited to 'src/idl_gen_php.cpp')
-rw-r--r-- | src/idl_gen_php.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/idl_gen_php.cpp b/src/idl_gen_php.cpp index 101f3c28..08250e98 100644 --- a/src/idl_gen_php.cpp +++ b/src/idl_gen_php.cpp @@ -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; } } |