mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 20:15:34 +00:00
Make Monster's Color unsigned (#5318)
- update C++ monster_test::Color to unsigned type - update Go Color:ubyte in the go_test.go - add workaround for unsigned enum in java test - sync generate.bat and generate.sh
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
b701c7d56e
commit
f9ebfcb9c4
@@ -1019,7 +1019,8 @@ class CppGenerator : public BaseGenerator {
|
||||
static const uint64_t kMaxSparseness = 5;
|
||||
if (range / static_cast<uint64_t>(enum_def.size()) < kMaxSparseness) {
|
||||
code_ += "inline const char * const *EnumNames{{ENUM_NAME}}() {";
|
||||
code_ += " static const char * const names[] = {";
|
||||
code_ += " static const char * const names[" +
|
||||
NumToString(range + 1 + 1) + "] = {";
|
||||
|
||||
auto val = enum_def.Vals().front();
|
||||
for (auto it = enum_def.Vals().begin(); it != enum_def.Vals().end();
|
||||
|
||||
Reference in New Issue
Block a user