From e203882d54d08827f6c8126d4f252d6d11a4a59d Mon Sep 17 00:00:00 2001 From: Andrew Selle Date: Fri, 10 Aug 2018 10:55:54 -0700 Subject: [PATCH] Clarify flatbuffer reflection struct sizes to be less error-prone. (#4870) --- include/flatbuffers/flatbuffers.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index 7eb3c5791..b4d4d1d91 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -2298,9 +2298,9 @@ typedef const TypeTable *(*TypeFunction)(); struct TypeTable { SequenceType st; - size_t num_elems; // of each of the arrays below. - const TypeCode *type_codes; - const TypeFunction *type_refs; + size_t num_elems; // of type_codes, values, names (but not type_refs). + const TypeCode *type_codes; // num_elems count + const TypeFunction *type_refs; // less than num_elems entries (see TypeCode). const int32_t *values; // Only set for non-consecutive enum/union or structs. const char * const *names; // Only set if compiled with --reflect-names. };