summarylogtreecommitdiffstats
path: root/0002-fix-for-flatbuffers-v2.patch
diff options
context:
space:
mode:
Diffstat (limited to '0002-fix-for-flatbuffers-v2.patch')
-rw-r--r--0002-fix-for-flatbuffers-v2.patch56
1 files changed, 0 insertions, 56 deletions
diff --git a/0002-fix-for-flatbuffers-v2.patch b/0002-fix-for-flatbuffers-v2.patch
deleted file mode 100644
index 7b5de9a86b69..000000000000
--- a/0002-fix-for-flatbuffers-v2.patch
+++ /dev/null
@@ -1,56 +0,0 @@
-From 1caa1c81657ac96d73275564e146f8465a5dad18 Mon Sep 17 00:00:00 2001
-From: japm48 <japm48gh@gmail.com>
-Date: Sat, 25 Sep 2021 00:35:56 +0200
-Subject: [PATCH] Fix for flatbuffers v2
-
----
- src/flatbuffers_json_visitor.h | 15 ++++++++++++---
- 1 file changed, 12 insertions(+), 3 deletions(-)
-
-diff --git a/src/flatbuffers_json_visitor.h b/src/flatbuffers_json_visitor.h
-index 1c310ad..f8571d6 100644
---- a/src/flatbuffers_json_visitor.h
-+++ b/src/flatbuffers_json_visitor.h
-@@ -197,6 +197,15 @@ json_vector_to_chararray(flatbuffers::FlatBufferBuilder &fbb, const json &jvec,
- }
-
-
-+inline bool check_type_is_vector(const flatbuffers::TypeCode &tc) {
-+#if FLATBUFFERS_VERSION_MAJOR >= 2
-+ return tc.is_repeating;
-+#else
-+ return tc.is_vector;
-+#endif
-+}
-+
-+
- /**
- * Iterate through a typetable-- I'll be honest here. This is kind of bullshit. We need to create all of
- * the types like Strings, Lists, Vectors, and other flatbuffer types before we create our table. I'm not
-@@ -217,7 +226,7 @@ inline void IterateType(const flatbuffers::TypeTable *type_table, FromSigMFVisit
- for (size_t i = 0; i < type_table->num_elems; i++) {
- auto type_code = type_table->type_codes[i];
- auto type = static_cast<flatbuffers::ElementaryType>(type_code.base_type);
-- auto is_vector = type_code.is_vector != 0;
-+ auto is_vector = check_type_is_vector(type_code);
- auto ref_idx = type_code.sequence_ref;
- const flatbuffers::TypeTable *ref = nullptr;
- if (ref_idx >= 0) { ref = type_table->type_refs[ref_idx](); }
-@@ -277,7 +286,7 @@ inline void IterateType(const flatbuffers::TypeTable *type_table, FromSigMFVisit
- for (size_t i = 0; i < type_table->num_elems; i++) {
- auto type_code = type_table->type_codes[i];
- auto type = static_cast<flatbuffers::ElementaryType>(type_code.base_type);
-- auto is_vector = type_code.is_vector != 0;
-+ auto is_vector = check_type_is_vector(type_code);
- auto ref_idx = type_code.sequence_ref;
- const flatbuffers::TypeTable *ref = nullptr;
- if (ref_idx >= 0) { ref = type_table->type_refs[ref_idx](); }
-@@ -490,7 +499,7 @@ FlatBufferToJson(const uint8_t *buffer_root, const flatbuffers::TypeTable *typet
- // Gather all of the underlying info about this element in table
- auto type_code = typetable->type_codes[i];
- auto type = static_cast<flatbuffers::ElementaryType>(type_code.base_type);
-- auto is_vector = type_code.is_vector != 0;
-+ auto is_vector = check_type_is_vector(type_code);
- auto ref_idx = type_code.sequence_ref;
- const flatbuffers::TypeTable *ref = nullptr;
- if (ref_idx >= 0) { ref = typetable->type_refs[ref_idx](); }