Skip to content

Commit 8797e89

Browse files
committed
Update flatbuffers to v25.9.23
1 parent 63ab1f1 commit 8797e89

24 files changed

+1059
-830
lines changed

3rdparty/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262

6363
## flatbuffers
6464
- [![Upstream](https://img.shields.io/github/v/release/google/flatbuffers?label=Upstream)](https://github.com/google/flatbuffers)
65-
- Version: 25.2.10
65+
- Version: 25.9.23
6666
- License: Apache-2.0
6767

6868
## {fmt}

3rdparty/flatbuffers/allocator.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,21 @@ class Allocator {
2828
virtual ~Allocator() {}
2929

3030
// Allocate `size` bytes of memory.
31-
virtual uint8_t *allocate(size_t size) = 0;
31+
virtual uint8_t* allocate(size_t size) = 0;
3232

3333
// Deallocate `size` bytes of memory at `p` allocated by this allocator.
34-
virtual void deallocate(uint8_t *p, size_t size) = 0;
34+
virtual void deallocate(uint8_t* p, size_t size) = 0;
3535

3636
// Reallocate `new_size` bytes of memory, replacing the old region of size
3737
// `old_size` at `p`. In contrast to a normal realloc, this grows downwards,
3838
// and is intended specifcally for `vector_downward` use.
3939
// `in_use_back` and `in_use_front` indicate how much of `old_size` is
4040
// actually in use at each end, and needs to be copied.
41-
virtual uint8_t *reallocate_downward(uint8_t *old_p, size_t old_size,
41+
virtual uint8_t* reallocate_downward(uint8_t* old_p, size_t old_size,
4242
size_t new_size, size_t in_use_back,
4343
size_t in_use_front) {
4444
FLATBUFFERS_ASSERT(new_size > old_size); // vector_downward only grows
45-
uint8_t *new_p = allocate(new_size);
45+
uint8_t* new_p = allocate(new_size);
4646
memcpy_downward(old_p, old_size, new_p, new_size, in_use_back,
4747
in_use_front);
4848
deallocate(old_p, old_size);
@@ -54,7 +54,7 @@ class Allocator {
5454
// to `new_p` of `new_size`. Only memory of size `in_use_front` and
5555
// `in_use_back` will be copied from the front and back of the old memory
5656
// allocation.
57-
void memcpy_downward(uint8_t *old_p, size_t old_size, uint8_t *new_p,
57+
void memcpy_downward(uint8_t* old_p, size_t old_size, uint8_t* new_p,
5858
size_t new_size, size_t in_use_back,
5959
size_t in_use_front) {
6060
memcpy(new_p + new_size - in_use_back, old_p + old_size - in_use_back,
@@ -65,4 +65,4 @@ class Allocator {
6565

6666
} // namespace flatbuffers
6767

68-
#endif // FLATBUFFERS_ALLOCATOR_H_
68+
#endif // FLATBUFFERS_ALLOCATOR_H_

3rdparty/flatbuffers/array.h

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,15 @@
2727
namespace flatbuffers {
2828

2929
// This is used as a helper type for accessing arrays.
30-
template<typename T, uint16_t length> class Array {
30+
template <typename T, uint16_t length>
31+
class Array {
3132
// Array<T> can carry only POD data types (scalars or structs).
3233
typedef typename flatbuffers::bool_constant<flatbuffers::is_scalar<T>::value>
3334
scalar_tag;
34-
typedef
35-
typename flatbuffers::conditional<scalar_tag::value, T, const T *>::type
36-
IndirectHelperType;
3735

3836
public:
3937
typedef uint16_t size_type;
40-
typedef typename IndirectHelper<IndirectHelperType>::return_type return_type;
38+
typedef typename IndirectHelper<T>::return_type return_type;
4139
typedef VectorConstIterator<T, return_type, uoffset_t> const_iterator;
4240
typedef VectorReverseIterator<const_iterator> const_reverse_iterator;
4341

@@ -50,15 +48,16 @@ template<typename T, uint16_t length> class Array {
5048

5149
return_type Get(uoffset_t i) const {
5250
FLATBUFFERS_ASSERT(i < size());
53-
return IndirectHelper<IndirectHelperType>::Read(Data(), i);
51+
return IndirectHelper<T>::Read(Data(), i);
5452
}
5553

5654
return_type operator[](uoffset_t i) const { return Get(i); }
5755

5856
// If this is a Vector of enums, T will be its storage type, not the enum
5957
// type. This function makes it convenient to retrieve value with enum
6058
// type E.
61-
template<typename E> E GetEnum(uoffset_t i) const {
59+
template <typename E>
60+
E GetEnum(uoffset_t i) const {
6261
return static_cast<E>(Get(i));
6362
}
6463

@@ -83,28 +82,28 @@ template<typename T, uint16_t length> class Array {
8382
// operation. For primitive types use @p Mutate directly.
8483
// @warning Assignments and reads to/from the dereferenced pointer are not
8584
// automatically converted to the correct endianness.
86-
typename flatbuffers::conditional<scalar_tag::value, void, T *>::type
85+
typename flatbuffers::conditional<scalar_tag::value, void, T*>::type
8786
GetMutablePointer(uoffset_t i) const {
8887
FLATBUFFERS_ASSERT(i < size());
89-
return const_cast<T *>(&data()[i]);
88+
return const_cast<T*>(&data()[i]);
9089
}
9190

9291
// Change elements if you have a non-const pointer to this object.
93-
void Mutate(uoffset_t i, const T &val) { MutateImpl(scalar_tag(), i, val); }
92+
void Mutate(uoffset_t i, const T& val) { MutateImpl(scalar_tag(), i, val); }
9493

9594
// The raw data in little endian format. Use with care.
96-
const uint8_t *Data() const { return data_; }
95+
const uint8_t* Data() const { return data_; }
9796

98-
uint8_t *Data() { return data_; }
97+
uint8_t* Data() { return data_; }
9998

10099
// Similarly, but typed, much like std::vector::data
101-
const T *data() const { return reinterpret_cast<const T *>(Data()); }
102-
T *data() { return reinterpret_cast<T *>(Data()); }
100+
const T* data() const { return reinterpret_cast<const T*>(Data()); }
101+
T* data() { return reinterpret_cast<T*>(Data()); }
103102

104103
// Copy data from a span with endian conversion.
105104
// If this Array and the span overlap, the behavior is undefined.
106105
void CopyFromSpan(flatbuffers::span<const T, length> src) {
107-
const auto p1 = reinterpret_cast<const uint8_t *>(src.data());
106+
const auto p1 = reinterpret_cast<const uint8_t*>(src.data());
108107
const auto p2 = Data();
109108
FLATBUFFERS_ASSERT(!(p1 >= p2 && p1 < (p2 + length)) &&
110109
!(p2 >= p1 && p2 < (p1 + length)));
@@ -114,12 +113,12 @@ template<typename T, uint16_t length> class Array {
114113
}
115114

116115
protected:
117-
void MutateImpl(flatbuffers::true_type, uoffset_t i, const T &val) {
116+
void MutateImpl(flatbuffers::true_type, uoffset_t i, const T& val) {
118117
FLATBUFFERS_ASSERT(i < size());
119118
WriteScalar(data() + i, val);
120119
}
121120

122-
void MutateImpl(flatbuffers::false_type, uoffset_t i, const T &val) {
121+
void MutateImpl(flatbuffers::false_type, uoffset_t i, const T& val) {
123122
*(GetMutablePointer(i)) = val;
124123
}
125124

@@ -134,7 +133,9 @@ template<typename T, uint16_t length> class Array {
134133
// Copy data from flatbuffers::span with endian conversion.
135134
void CopyFromSpanImpl(flatbuffers::false_type,
136135
flatbuffers::span<const T, length> src) {
137-
for (size_type k = 0; k < length; k++) { Mutate(k, src[k]); }
136+
for (size_type k = 0; k < length; k++) {
137+
Mutate(k, src[k]);
138+
}
138139
}
139140

140141
// This class is only used to access pre-existing data. Don't ever
@@ -153,21 +154,21 @@ template<typename T, uint16_t length> class Array {
153154
private:
154155
// This class is a pointer. Copying will therefore create an invalid object.
155156
// Private and unimplemented copy constructor.
156-
Array(const Array &);
157-
Array &operator=(const Array &);
157+
Array(const Array&);
158+
Array& operator=(const Array&);
158159
};
159160

160161
// Specialization for Array[struct] with access using Offset<void> pointer.
161162
// This specialization used by idl_gen_text.cpp.
162-
template<typename T, uint16_t length, template<typename> class OffsetT>
163+
template <typename T, uint16_t length, template <typename> class OffsetT>
163164
class Array<OffsetT<T>, length> {
164165
static_assert(flatbuffers::is_same<T, void>::value, "unexpected type T");
165166

166167
public:
167-
typedef const void *return_type;
168+
typedef const void* return_type;
168169
typedef uint16_t size_type;
169170

170-
const uint8_t *Data() const { return data_; }
171+
const uint8_t* Data() const { return data_; }
171172

172173
// Make idl_gen_text.cpp::PrintContainer happy.
173174
return_type operator[](uoffset_t) const {
@@ -178,41 +179,41 @@ class Array<OffsetT<T>, length> {
178179
private:
179180
// This class is only used to access pre-existing data.
180181
Array();
181-
Array(const Array &);
182-
Array &operator=(const Array &);
182+
Array(const Array&);
183+
Array& operator=(const Array&);
183184

184185
uint8_t data_[1];
185186
};
186187

187-
template<class U, uint16_t N>
188-
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<U, N> make_span(Array<U, N> &arr)
188+
template <class U, uint16_t N>
189+
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<U, N> make_span(Array<U, N>& arr)
189190
FLATBUFFERS_NOEXCEPT {
190191
static_assert(
191192
Array<U, N>::is_span_observable,
192193
"wrong type U, only plain struct, LE-scalar, or byte types are allowed");
193194
return span<U, N>(arr.data(), N);
194195
}
195196

196-
template<class U, uint16_t N>
197+
template <class U, uint16_t N>
197198
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<const U, N> make_span(
198-
const Array<U, N> &arr) FLATBUFFERS_NOEXCEPT {
199+
const Array<U, N>& arr) FLATBUFFERS_NOEXCEPT {
199200
static_assert(
200201
Array<U, N>::is_span_observable,
201202
"wrong type U, only plain struct, LE-scalar, or byte types are allowed");
202203
return span<const U, N>(arr.data(), N);
203204
}
204205

205-
template<class U, uint16_t N>
206+
template <class U, uint16_t N>
206207
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<uint8_t, sizeof(U) * N>
207-
make_bytes_span(Array<U, N> &arr) FLATBUFFERS_NOEXCEPT {
208+
make_bytes_span(Array<U, N>& arr) FLATBUFFERS_NOEXCEPT {
208209
static_assert(Array<U, N>::is_span_observable,
209210
"internal error, Array<T> might hold only scalars or structs");
210211
return span<uint8_t, sizeof(U) * N>(arr.Data(), sizeof(U) * N);
211212
}
212213

213-
template<class U, uint16_t N>
214+
template <class U, uint16_t N>
214215
FLATBUFFERS_CONSTEXPR_CPP11 flatbuffers::span<const uint8_t, sizeof(U) * N>
215-
make_bytes_span(const Array<U, N> &arr) FLATBUFFERS_NOEXCEPT {
216+
make_bytes_span(const Array<U, N>& arr) FLATBUFFERS_NOEXCEPT {
216217
static_assert(Array<U, N>::is_span_observable,
217218
"internal error, Array<T> might hold only scalars or structs");
218219
return span<const uint8_t, sizeof(U) * N>(arr.Data(), sizeof(U) * N);
@@ -221,31 +222,31 @@ make_bytes_span(const Array<U, N> &arr) FLATBUFFERS_NOEXCEPT {
221222
// Cast a raw T[length] to a raw flatbuffers::Array<T, length>
222223
// without endian conversion. Use with care.
223224
// TODO: move these Cast-methods to `internal` namespace.
224-
template<typename T, uint16_t length>
225-
Array<T, length> &CastToArray(T (&arr)[length]) {
226-
return *reinterpret_cast<Array<T, length> *>(arr);
225+
template <typename T, uint16_t length>
226+
Array<T, length>& CastToArray(T (&arr)[length]) {
227+
return *reinterpret_cast<Array<T, length>*>(arr);
227228
}
228229

229-
template<typename T, uint16_t length>
230-
const Array<T, length> &CastToArray(const T (&arr)[length]) {
231-
return *reinterpret_cast<const Array<T, length> *>(arr);
230+
template <typename T, uint16_t length>
231+
const Array<T, length>& CastToArray(const T (&arr)[length]) {
232+
return *reinterpret_cast<const Array<T, length>*>(arr);
232233
}
233234

234-
template<typename E, typename T, uint16_t length>
235-
Array<E, length> &CastToArrayOfEnum(T (&arr)[length]) {
235+
template <typename E, typename T, uint16_t length>
236+
Array<E, length>& CastToArrayOfEnum(T (&arr)[length]) {
236237
static_assert(sizeof(E) == sizeof(T), "invalid enum type E");
237-
return *reinterpret_cast<Array<E, length> *>(arr);
238+
return *reinterpret_cast<Array<E, length>*>(arr);
238239
}
239240

240-
template<typename E, typename T, uint16_t length>
241-
const Array<E, length> &CastToArrayOfEnum(const T (&arr)[length]) {
241+
template <typename E, typename T, uint16_t length>
242+
const Array<E, length>& CastToArrayOfEnum(const T (&arr)[length]) {
242243
static_assert(sizeof(E) == sizeof(T), "invalid enum type E");
243-
return *reinterpret_cast<const Array<E, length> *>(arr);
244+
return *reinterpret_cast<const Array<E, length>*>(arr);
244245
}
245246

246-
template<typename T, uint16_t length>
247-
bool operator==(const Array<T, length> &lhs,
248-
const Array<T, length> &rhs) noexcept {
247+
template <typename T, uint16_t length>
248+
bool operator==(const Array<T, length>& lhs,
249+
const Array<T, length>& rhs) noexcept {
249250
return std::addressof(lhs) == std::addressof(rhs) ||
250251
(lhs.size() == rhs.size() &&
251252
std::memcmp(lhs.Data(), rhs.Data(), rhs.size() * sizeof(T)) == 0);

3rdparty/flatbuffers/base.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@
140140
#endif // !defined(FLATBUFFERS_LITTLEENDIAN)
141141

142142
#define FLATBUFFERS_VERSION_MAJOR 25
143-
#define FLATBUFFERS_VERSION_MINOR 2
144-
#define FLATBUFFERS_VERSION_REVISION 10
143+
#define FLATBUFFERS_VERSION_MINOR 9
144+
#define FLATBUFFERS_VERSION_REVISION 23
145145
#define FLATBUFFERS_STRING_EXPAND(X) #X
146146
#define FLATBUFFERS_STRING(X) FLATBUFFERS_STRING_EXPAND(X)
147147
namespace flatbuffers {

0 commit comments

Comments
 (0)