mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-26 08:32:40 +00:00
Const correctness in generated code and in code generators. Added missing \reflection\generate_code.bat file. (#4679)
This commit is contained in:
committed by
Wouter van Oortmerssen
parent
c0a6e5120d
commit
79f62ee353
@@ -13,9 +13,9 @@ struct TableInNestedNS;
|
||||
|
||||
struct StructInNestedNS;
|
||||
|
||||
inline flatbuffers::TypeTable *TableInNestedNSTypeTable();
|
||||
inline const flatbuffers::TypeTable *TableInNestedNSTypeTable();
|
||||
|
||||
inline flatbuffers::TypeTable *StructInNestedNSTypeTable();
|
||||
inline const flatbuffers::TypeTable *StructInNestedNSTypeTable();
|
||||
|
||||
enum EnumInNestedNS {
|
||||
EnumInNestedNS_A = 0,
|
||||
@@ -25,8 +25,8 @@ enum EnumInNestedNS {
|
||||
EnumInNestedNS_MAX = EnumInNestedNS_C
|
||||
};
|
||||
|
||||
inline EnumInNestedNS (&EnumValuesEnumInNestedNS())[3] {
|
||||
static EnumInNestedNS values[] = {
|
||||
inline const EnumInNestedNS (&EnumValuesEnumInNestedNS())[3] {
|
||||
static const EnumInNestedNS values[] = {
|
||||
EnumInNestedNS_A,
|
||||
EnumInNestedNS_B,
|
||||
EnumInNestedNS_C
|
||||
@@ -34,8 +34,8 @@ inline EnumInNestedNS (&EnumValuesEnumInNestedNS())[3] {
|
||||
return values;
|
||||
}
|
||||
|
||||
inline const char **EnumNamesEnumInNestedNS() {
|
||||
static const char *names[] = {
|
||||
inline const char * const *EnumNamesEnumInNestedNS() {
|
||||
static const char * const names[] = {
|
||||
"A",
|
||||
"B",
|
||||
"C",
|
||||
@@ -78,7 +78,7 @@ MANUALLY_ALIGNED_STRUCT(4) StructInNestedNS FLATBUFFERS_FINAL_CLASS {
|
||||
STRUCT_END(StructInNestedNS, 8);
|
||||
|
||||
struct TableInNestedNS FLATBUFFERS_FINAL_CLASS : private flatbuffers::Table {
|
||||
static flatbuffers::TypeTable *MiniReflectTypeTable() {
|
||||
static const flatbuffers::TypeTable *MiniReflectTypeTable() {
|
||||
return TableInNestedNSTypeTable();
|
||||
}
|
||||
enum {
|
||||
@@ -123,50 +123,50 @@ inline flatbuffers::Offset<TableInNestedNS> CreateTableInNestedNS(
|
||||
return builder_.Finish();
|
||||
}
|
||||
|
||||
inline flatbuffers::TypeTable *EnumInNestedNSTypeTable() {
|
||||
static flatbuffers::TypeCode type_codes[] = {
|
||||
inline const flatbuffers::TypeTable *EnumInNestedNSTypeTable() {
|
||||
static const flatbuffers::TypeCode type_codes[] = {
|
||||
{ flatbuffers::ET_CHAR, 0, 0 },
|
||||
{ flatbuffers::ET_CHAR, 0, 0 },
|
||||
{ flatbuffers::ET_CHAR, 0, 0 }
|
||||
};
|
||||
static flatbuffers::TypeFunction type_refs[] = {
|
||||
static const flatbuffers::TypeFunction type_refs[] = {
|
||||
EnumInNestedNSTypeTable
|
||||
};
|
||||
static const char *names[] = {
|
||||
static const char * const names[] = {
|
||||
"A",
|
||||
"B",
|
||||
"C"
|
||||
};
|
||||
static flatbuffers::TypeTable tt = {
|
||||
static const flatbuffers::TypeTable tt = {
|
||||
flatbuffers::ST_ENUM, 3, type_codes, type_refs, nullptr, names
|
||||
};
|
||||
return &tt;
|
||||
}
|
||||
|
||||
inline flatbuffers::TypeTable *TableInNestedNSTypeTable() {
|
||||
static flatbuffers::TypeCode type_codes[] = {
|
||||
inline const flatbuffers::TypeTable *TableInNestedNSTypeTable() {
|
||||
static const flatbuffers::TypeCode type_codes[] = {
|
||||
{ flatbuffers::ET_INT, 0, -1 }
|
||||
};
|
||||
static const char *names[] = {
|
||||
static const char * const names[] = {
|
||||
"foo"
|
||||
};
|
||||
static flatbuffers::TypeTable tt = {
|
||||
static const flatbuffers::TypeTable tt = {
|
||||
flatbuffers::ST_TABLE, 1, type_codes, nullptr, nullptr, names
|
||||
};
|
||||
return &tt;
|
||||
}
|
||||
|
||||
inline flatbuffers::TypeTable *StructInNestedNSTypeTable() {
|
||||
static flatbuffers::TypeCode type_codes[] = {
|
||||
inline const flatbuffers::TypeTable *StructInNestedNSTypeTable() {
|
||||
static const flatbuffers::TypeCode type_codes[] = {
|
||||
{ flatbuffers::ET_INT, 0, -1 },
|
||||
{ flatbuffers::ET_INT, 0, -1 }
|
||||
};
|
||||
static const int32_t values[] = { 0, 4, 8 };
|
||||
static const char *names[] = {
|
||||
static const char * const names[] = {
|
||||
"a",
|
||||
"b"
|
||||
};
|
||||
static flatbuffers::TypeTable tt = {
|
||||
static const flatbuffers::TypeTable tt = {
|
||||
flatbuffers::ST_STRUCT, 2, type_codes, nullptr, values, names
|
||||
};
|
||||
return &tt;
|
||||
|
||||
Reference in New Issue
Block a user