mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
Enum definitions are generated without a trailing comma (-pedantic).
Change-Id: I07cd28e5915a0526614db85f894f27a5bd27f3bb Tested: on Windows.
This commit is contained in:
@@ -105,7 +105,8 @@ static void GenComment(const std::string &dc,
|
||||
auto &ev = **it;
|
||||
GenComment(ev.doc_comment, code_ptr, " ");
|
||||
code += " " + enum_def.name + "_" + ev.name + " = ";
|
||||
code += NumToString(ev.value) + ",\n";
|
||||
code += NumToString(ev.value);
|
||||
code += (it + 1) != enum_def.vals.vec.end() ? ",\n" : "\n";
|
||||
}
|
||||
code += "};\n\n";
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Example {
|
||||
enum {
|
||||
Color_Red = 1,
|
||||
Color_Green = 2,
|
||||
Color_Blue = 8,
|
||||
Color_Blue = 8
|
||||
};
|
||||
|
||||
inline const char **EnumNamesColor() {
|
||||
@@ -23,7 +23,7 @@ inline const char *EnumNameColor(int e) { return EnumNamesColor()[e - Color_Red]
|
||||
|
||||
enum {
|
||||
Any_NONE = 0,
|
||||
Any_Monster = 1,
|
||||
Any_Monster = 1
|
||||
};
|
||||
|
||||
inline const char **EnumNamesAny() {
|
||||
|
||||
Reference in New Issue
Block a user