diff --git a/0001-Fix-compiler-warning-Wredundant-parens.patch b/0001-Fix-compiler-warning-Wredundant-parens.patch deleted file mode 100644 index a7d31b6e88fd775c33b8be967adac17e88d0353e..0000000000000000000000000000000000000000 --- a/0001-Fix-compiler-warning-Wredundant-parens.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h -index ee34d54..aecf80f 100644 ---- a/include/flatbuffers/flatbuffers.h -+++ b/include/flatbuffers/flatbuffers.h -@@ -1824,7 +1824,7 @@ class FlatBufferBuilder { - /// where the vector is stored. - template - Offset> CreateVectorOfNativeStructs( -- const S *v, size_t len, T((*const pack_func)(const S &))) { -+ const S *v, size_t len, T (*const pack_func)(const S &)) { - FLATBUFFERS_ASSERT(pack_func); - std::vector vv(len); - std::transform(v, v + len, vv.begin(), pack_func); -@@ -1912,7 +1912,7 @@ class FlatBufferBuilder { - /// where the vector is stored. - template - Offset> CreateVectorOfNativeStructs( -- const std::vector &v, T((*const pack_func)(const S &))) { -+ const std::vector &v, T (*const pack_func)(const S &)) { - return CreateVectorOfNativeStructs(data(v), v.size(), pack_func); - } - diff --git a/0002-typo-fixes-in-comments.patch b/0002-typo-fixes-in-comments.patch deleted file mode 100644 index 89701eb39745429dbe5b93adfa630369120253f8..0000000000000000000000000000000000000000 --- a/0002-typo-fixes-in-comments.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 0a50504c58d61a260a36e5bd63e3afe42a7a6a91 Mon Sep 17 00:00:00 2001 -From: yefeng -Date: Mon, 15 Nov 2021 18:55:21 +0800 -Subject: [PATCH 1/3] typo fixes in comments - ---- - include/flatbuffers/flatbuffers.h | 6 +++--- - include/flatbuffers/flexbuffers.h | 2 +- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h -index ee34d54..e652e40 100644 ---- a/include/flatbuffers/flatbuffers.h -+++ b/include/flatbuffers/flatbuffers.h -@@ -536,7 +536,7 @@ template class Array { - - void CopyFromSpanImpl(flatbuffers::integral_constant, - flatbuffers::span src) { -- // Use std::memcpy() instead of std::copy() to avoid preformance degradation -+ // Use std::memcpy() instead of std::copy() to avoid performance degradation - // due to aliasing if T is char or unsigned char. - // The size is known at compile time, so memcpy would be inlined. - std::memcpy(data(), src.data(), length * sizeof(T)); -@@ -2204,7 +2204,7 @@ class FlatBufferBuilder { - return reinterpret_cast(buf_.make_space(vector_size * sizeof(T))); - } - -- // End the vector of structues in the flatbuffers. -+ // End the vector of structures in the flatbuffers. - // Vector should have previously be started with StartVectorOfStructs(). - template - Offset> EndVectorOfStructs(size_t vector_size) { -@@ -2821,7 +2821,7 @@ inline int LookupEnum(const char **names, const char *name) { - - // Minimal reflection via code generation. - // Besides full-fat reflection (see reflection.h) and parsing/printing by --// loading schemas (see idl.h), we can also have code generation for mimimal -+// loading schemas (see idl.h), we can also have code generation for minimal - // reflection data which allows pretty-printing and other uses without needing - // a schema or a parser. - // Generate code with --reflect-types (types only) or --reflect-names (names -diff --git a/include/flatbuffers/flexbuffers.h b/include/flatbuffers/flexbuffers.h -index c71928e..3e7ab3e 100644 ---- a/include/flatbuffers/flexbuffers.h -+++ b/include/flatbuffers/flexbuffers.h -@@ -1086,7 +1086,7 @@ class Builder FLATBUFFERS_FINAL_CLASS { - return stack_.size(); - } - -- // TODO(wvo): allow this to specify an aligment greater than the natural -+ // TODO(wvo): allow this to specify an alignment greater than the natural - // alignment. - size_t EndVector(size_t start, bool typed, bool fixed) { - auto vec = CreateVector(start, stack_.size() - start, 1, typed, fixed); --- -2.17.1 - diff --git a/0003-Changes-to-support-binary-schema-file-loading-and-pa.patch b/0003-Changes-to-support-binary-schema-file-loading-and-pa.patch deleted file mode 100644 index fc3525043e30dacd30d64fea0ad8047ed7f7146d..0000000000000000000000000000000000000000 --- a/0003-Changes-to-support-binary-schema-file-loading-and-pa.patch +++ /dev/null @@ -1,37 +0,0 @@ -From fa1930955cb95a445f0a8547a9ef555e1b090860 Mon Sep 17 00:00:00 2001 -From: yefeng -Date: Mon, 15 Nov 2021 18:58:22 +0800 -Subject: [PATCH 2/3] Changes to support binary schema file loading and parsing - ---- - src/flatc.cpp | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/src/flatc.cpp b/src/flatc.cpp -index 221b886..a3043cc 100644 ---- a/src/flatc.cpp -+++ b/src/flatc.cpp -@@ -453,16 +453,17 @@ int FlatCompiler::Compile(int argc, const char **argv) { - contents.length() != strlen(contents.c_str())) { - Error("input file appears to be binary: " + filename, true); - } -- if (is_schema) { -+ if (is_schema || is_binary_schema) { - // If we're processing multiple schemas, make sure to start each - // one from scratch. If it depends on previous schemas it must do - // so explicitly using an include. - parser.reset(new flatbuffers::Parser(opts)); - } -+ // Try to parse the file contents (binary schema/flexbuffer/textual -+ // schema) - if (is_binary_schema) { - LoadBinarySchema(*parser.get(), filename, contents); -- } -- if (opts.use_flexbuffers) { -+ } else if (opts.use_flexbuffers) { - if (opts.lang_to_generate == IDLOptions::kJson) { - parser->flex_root_ = flexbuffers::GetRoot( - reinterpret_cast(contents.c_str()), --- -2.17.1 - diff --git a/0004-output-errors-instead-of-stdout.patch b/0004-output-errors-instead-of-stdout.patch deleted file mode 100644 index 3f7b60ad26798d8d1145c111764e09a618758e53..0000000000000000000000000000000000000000 --- a/0004-output-errors-instead-of-stdout.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 766c1984b6e5e3e8ac1c153238e05b7f0624f7b5 Mon Sep 17 00:00:00 2001 -From: yefeng -Date: Mon, 15 Nov 2021 18:59:03 +0800 -Subject: [PATCH 3/3] output errors instead of stdout - ---- - src/flatc_main.cpp | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/src/flatc_main.cpp b/src/flatc_main.cpp -index b196666..30d0b47 100644 ---- a/src/flatc_main.cpp -+++ b/src/flatc_main.cpp -@@ -23,15 +23,15 @@ static void Warn(const flatbuffers::FlatCompiler *flatc, - const std::string &warn, bool show_exe_name) { - (void)flatc; - if (show_exe_name) { printf("%s: ", g_program_name); } -- printf("warning: %s\n", warn.c_str()); -+ fprintf(stderr, "warning: %s\n", warn.c_str()); - } - - static void Error(const flatbuffers::FlatCompiler *flatc, - const std::string &err, bool usage, bool show_exe_name) { - if (show_exe_name) { printf("%s: ", g_program_name); } -- printf("error: %s\n", err.c_str()); -+ fprintf(stderr, "error: %s\n", err.c_str()); - if (usage && flatc) { -- printf("%s", flatc->GetUsageString(g_program_name).c_str()); -+ fprintf(stderr, "%s", flatc->GetUsageString(g_program_name).c_str()); - } - exit(1); - } --- -2.17.1 - diff --git a/0005-fix-undefined-behaviour.patch b/0005-fix-undefined-behaviour.patch deleted file mode 100644 index c719d5c61d2a2f5a9f1af40737c185f5f8398e82..0000000000000000000000000000000000000000 --- a/0005-fix-undefined-behaviour.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 57ee742cb1d2a2902dd5e00af5da9293aa11326c Mon Sep 17 00:00:00 2001 -From: yefeng -Date: Wed, 17 Nov 2021 14:49:42 +0800 -Subject: [PATCH 1/2] fix undefined behaviour - ---- - include/flatbuffers/flatbuffers.h | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h -index e652e40..42c4fa8 100644 ---- a/include/flatbuffers/flatbuffers.h -+++ b/include/flatbuffers/flatbuffers.h -@@ -1808,7 +1808,9 @@ class FlatBufferBuilder { - template - Offset> CreateVectorOfStructs(const T *v, size_t len) { - StartVector(len * sizeof(T) / AlignOf(), AlignOf()); -- PushBytes(reinterpret_cast(v), sizeof(T) * len); -+ if (len > 0) { -+ PushBytes(reinterpret_cast(v), sizeof(T) * len); -+ } - return Offset>(EndVector(len)); - } - --- -2.17.1 - diff --git a/README.en.md b/README.en.md index 7c10957cfcce3fa45839db92d97e1a66e66e3364..2eca530541d9f865f2a9fea25d03bb97e60fad7e 100644 --- a/README.en.md +++ b/README.en.md @@ -1,29 +1,22 @@ # flatbuffers -FlatBuffers is a cross platform serialization library architected for maximum memory efficiency. It allows you to directly access serialized data without parsing/unpacking it first, while still having great forwards/backwards compatibility. - -#### -- Supported operating systems -- Windows -- MacOS X -- Linux -- Android -- And any others with a recent C++ compiler. - -#### Supported programming languages -- C++ -- C# -- C -- Dart -- Go -- Java -- JavaScript -- Lobster -- Lua -- PHP -- Python -- Rust -- TypeScript +#### Description +Memory efficient serialization library + +#### Software Architecture +Software architecture description + +#### Installation + +1. xxxx +2. xxxx +3. xxxx + +#### Instructions + +1. xxxx +2. xxxx +3. xxxx #### Contribution @@ -31,3 +24,13 @@ FlatBuffers is a cross platform serialization library architected for maximum me 2. Create Feat_xxx branch 3. Commit your code 4. Create Pull Request + + +#### Gitee Feature + +1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md +2. Gitee blog [blog.gitee.com](https://blog.gitee.com) +3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore) +4. The most valuable open source project [GVP](https://gitee.com/gvp) +5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help) +6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/README.md b/README.md index 8003ab709beb79444f5e8faf4927e8b61887a96e..2fde7471bdece55f43832a6eacfbbf8e1021316b 100644 --- a/README.md +++ b/README.md @@ -1,32 +1,37 @@ # flatbuffers #### 介绍 -FlatBuffers 是一个跨平台的序列化库,旨在实现最大的内存效率。 它允许直接访问序列化数据,而无需先解析,同时仍然具有很好的兼容性。 - -#### 支持的操作系统 -- Windows -- MacOS X -- Linux -- Android -- And any others with a recent C++ compiler. - -#### 支持的编程语言 -- C++ -- C# -- C -- Dart -- Go -- Java -- JavaScript -- Lobster -- Lua -- PHP -- Python -- Rust -- TypeScript +Memory efficient serialization library + +#### 软件架构 +软件架构说明 + + +#### 安装教程 + +1. xxxx +2. xxxx +3. xxxx + +#### 使用说明 + +1. xxxx +2. xxxx +3. xxxx #### 参与贡献 + 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request + + +#### 特技 + +1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md +2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) +3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 +4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 +5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) +6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) diff --git a/flatbuffers-2.0.6.tar.gz b/flatbuffers-2.0.6.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..2aa8f0980f16ba75b6f19cf1d85c49fc679f7f2b Binary files /dev/null and b/flatbuffers-2.0.6.tar.gz differ diff --git a/flatbuffers.spec b/flatbuffers.spec index 97d587f24c62a839f7ef6781e388b8fbdb7429d2..f7b7bf18a348a336b8f7d541bde10ecc659bd847 100644 --- a/flatbuffers.spec +++ b/flatbuffers.spec @@ -4,21 +4,15 @@ %bcond_without tests %endif Name: flatbuffers -Version: 2.0.0 -Release: 5 +Version: 2.0.6 +Release: 1 Summary: Memory efficient serialization library License: Apache-2.0 URL: https://github.com/google/flatbuffers -Source0: https://github.com/google/flatbuffers/archive/refs/tags/v%{version}.tar.gz +Source0: https://github.com/google/flatbuffers/archive/refs/tags/flatbuffers-%{version}.tar.gz Source1: flatc.1 Source2: flatbuffers.7 -Patch0: 0001-Fix-compiler-warning-Wredundant-parens.patch -Patch1: 0002-typo-fixes-in-comments.patch -Patch2: 0003-Changes-to-support-binary-schema-file-loading-and-pa.patch -Patch3: 0004-output-errors-instead-of-stdout.patch -Patch4: 0005-fix-undefined-behaviour.patch - BuildRequires: gcc-c++ cmake >= 2.8.9 Provides: bundled(grpc) %description @@ -94,17 +88,11 @@ make test %{python3_sitelib}/ %changelog -* Tue Nov 22 2022 Bin Hu - 2.0.0-5 -- add python subpackage for tensorflow 2.10 build - -* Wed Nov 17 2021 yefeng - 2.0.0-4 -- fix undefined behaviour +* Thu Apr 20 2023 Zhang Chao - 2.0.6-1 +- Upgrade to 2.0.6 -* Mon Nov 15 2021 yefeng - 2.0.0-3 -- output errors instead of stdout, Typo fixes in comments and Changes to support binary schema file - -* Wed Nov 11 2021 yefeng - 2.0.0-2 -- Fix compiler warning +* Tue Nov 22 2022 Bin Hu - 2.0.0-2 +- add python subpackage for tensorflow 2.10 build * Tue Aug 17 2021 yaoxin - 2.0.0-1 - Upgrade 2.0.0 to fix CVE-2020-35864 diff --git a/v2.0.0.tar.gz b/v2.0.0.tar.gz deleted file mode 100644 index b8dd50bcf7a4b09ae230a1de767e48a0a57197d7..0000000000000000000000000000000000000000 Binary files a/v2.0.0.tar.gz and /dev/null differ