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:
Wouter van Oortmerssen
2018-01-22 09:49:06 -08:00
parent 462ce03ebe
commit 8df2d9a3ef
6 changed files with 9 additions and 9 deletions

View File

@@ -51,7 +51,7 @@ bool Print(T val, Type type, int /*indent*/, Type * /*union_type*/,
const IDLOptions &opts, std::string *_text) {
std::string &text = *_text;
if (type.enum_def && opts.output_enum_identifiers) {
auto enum_val = type.enum_def->ReverseLookup(static_cast<int>(val));
auto enum_val = type.enum_def->ReverseLookup(static_cast<int64_t>(val));
if (enum_val) {
text += "\"";
text += enum_val->name;