Skip to content
Snippets Groups Projects
Commit c996df45 authored by LN Liberda's avatar LN Liberda Committed by Natanael Copa
Browse files

community/flatbuffers: upgrade to 24.3.25

parent 75076674
No related branches found
No related tags found
1 merge request!66095community/flatbuffers: upgrade to 24.3.25
Pipeline #235441 skipped
# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=flatbuffers
pkgver=23.5.26
pkgrel=1
pkgver=24.3.25
pkgrel=0
pkgdesc="Memory Efficient Serialization Library"
url="https://google.github.io/flatbuffers/"
url="https://flatbuffers.dev/"
# armhf: blocked by bus error in tests
# s390x: segfaults in tests
# x86: fails trivial tests
......@@ -21,6 +21,7 @@ makedepends="
subpackages="$pkgname-dev flatc py3-$pkgname-pyc py3-$pkgname:py3"
source="flatbuffers-$pkgver.tar.gz::https://github.com/google/flatbuffers/archive/v$pkgver.tar.gz
locale-headers.patch
gettemporarypointer-constantness.patch
"
# Bus error in armv7 as well but it has downstream users
......@@ -70,6 +71,7 @@ py3() {
}
sha512sums="
cd0a5efad8016e1217d01a181d6b02e546f5693c6412361bfeaee820d5dfe5e2a424cee1963270e851c1a4f936ae8a0032a51c5bb16ee19313e0ecc77dc4ba31 flatbuffers-23.5.26.tar.gz
e2a614f4fc526ce07bfe1e1bc79efd3c87acbdb93aee7b42994d4855abd2593f36b5ca1edb53c7dcd470d5fbe14a3e394bd75dcebb4458cc0aeb33d622a3c662 flatbuffers-24.3.25.tar.gz
a5460ec027f2884f5801e01d3ef7f831be3ecd92fc9586ab33764467e3de79855f87c4b639806ad6884ec8eac41d6d6f6204644c84ddbcea9fba3798943b1e57 locale-headers.patch
6916dd0bd859a8218298d7caeda75e8874f0df9d2160e28451f4e2854d229757f503b6b3e0d541ac3b479a19ecc4af8a4dd6a90af09387d257e066c126a51f24 gettemporarypointer-constantness.patch
"
From e6463926479bd6b330cbcf673f7e917803fd5831 Mon Sep 17 00:00:00 2001
From: Derek Bailey <derekbailey@google.com>
Date: Wed, 17 Apr 2024 16:06:26 +0000
Subject: [PATCH] `flatbuffer_builder`: Fix GetTemporaryPointer constantness
---
include/flatbuffers/flatbuffer_builder.h | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/include/flatbuffers/flatbuffer_builder.h b/include/flatbuffers/flatbuffer_builder.h
index 9a2d62541bd..9ceca8207b6 100644
--- a/include/flatbuffers/flatbuffer_builder.h
+++ b/include/flatbuffers/flatbuffer_builder.h
@@ -47,7 +47,8 @@ inline voffset_t FieldIndexToOffset(voffset_t field_id) {
2 * sizeof(voffset_t); // Vtable size and Object Size.
size_t offset = fixed_fields + field_id * sizeof(voffset_t);
FLATBUFFERS_ASSERT(offset < std::numeric_limits<voffset_t>::max());
- return static_cast<voffset_t>(offset);}
+ return static_cast<voffset_t>(offset);
+}
template<typename T, typename Alloc = std::allocator<T>>
const T *data(const std::vector<T, Alloc> &v) {
@@ -241,7 +242,7 @@ template<bool Is64Aware = false> class FlatBufferBuilderImpl {
/// called.
uint8_t *ReleaseRaw(size_t &size, size_t &offset) {
Finished();
- uint8_t* raw = buf_.release_raw(size, offset);
+ uint8_t *raw = buf_.release_raw(size, offset);
Clear();
return raw;
}
@@ -561,7 +562,7 @@ template<bool Is64Aware = false> class FlatBufferBuilderImpl {
return CreateString<OffsetT>(str.c_str(), str.length());
}
-// clang-format off
+ // clang-format off
#ifdef FLATBUFFERS_HAS_STRING_VIEW
/// @brief Store a string in the buffer, which can contain any binary data.
/// @param[in] str A const string_view to copy in to the buffer.
@@ -743,7 +744,7 @@ template<bool Is64Aware = false> class FlatBufferBuilderImpl {
AssertScalarT<T>();
StartVector<T, OffsetT, LenT>(len);
if (len > 0) {
-// clang-format off
+ // clang-format off
#if FLATBUFFERS_LITTLEENDIAN
PushBytes(reinterpret_cast<const uint8_t *>(v), len * sizeof(T));
#else
@@ -1470,7 +1471,8 @@ T *GetMutableTemporaryPointer(FlatBufferBuilder &fbb, Offset<T> offset) {
template<typename T>
const T *GetTemporaryPointer(const FlatBufferBuilder &fbb, Offset<T> offset) {
- return GetMutableTemporaryPointer<T>(fbb, offset);
+ return reinterpret_cast<const T *>(fbb.GetCurrentBufferPointer() +
+ fbb.GetSize() - offset.o);
}
} // namespace flatbuffers
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment