aboutsummaryrefslogtreecommitdiffstats
path: root/executor/_include/flatbuffers/flexbuffers.h
diff options
context:
space:
mode:
authorPimyn Girgis <pimyn@google.com>2025-12-02 12:28:10 +0000
committerTahuti <pimyn@google.com>2025-12-03 09:02:54 +0000
commit1cfbf16e320ca9bdadd9c24eb1d2d68b25369ba6 (patch)
treebe0ce827f327c8a76125307e64047e01fa449d4c /executor/_include/flatbuffers/flexbuffers.h
parent42a04216dd856c12e723e48930e85d63998e4eda (diff)
executor: update flatbuffers
Update flatbuffers to v23.5.26, which matches the compiler version in the new env container.
Diffstat (limited to 'executor/_include/flatbuffers/flexbuffers.h')
-rw-r--r--executor/_include/flatbuffers/flexbuffers.h21
1 files changed, 10 insertions, 11 deletions
diff --git a/executor/_include/flatbuffers/flexbuffers.h b/executor/_include/flatbuffers/flexbuffers.h
index 7bf84302e..8e8cac144 100644
--- a/executor/_include/flatbuffers/flexbuffers.h
+++ b/executor/_include/flatbuffers/flexbuffers.h
@@ -17,6 +17,7 @@
#ifndef FLATBUFFERS_FLEXBUFFERS_H_
#define FLATBUFFERS_FLEXBUFFERS_H_
+#include <algorithm>
#include <map>
// Used to select STL variant.
#include "flatbuffers/base.h"
@@ -382,10 +383,10 @@ class Reference {
type_(type) {}
Reference(const uint8_t *data, uint8_t parent_width, uint8_t packed_type)
- : data_(data), parent_width_(parent_width) {
- byte_width_ = 1U << static_cast<BitWidth>(packed_type & 3);
- type_ = static_cast<Type>(packed_type >> 2);
- }
+ : data_(data),
+ parent_width_(parent_width),
+ byte_width_(static_cast<uint8_t>(1 << (packed_type & 3))),
+ type_(static_cast<Type>(packed_type >> 2)) {}
Type GetType() const { return type_; }
@@ -1423,12 +1424,10 @@ class Builder FLATBUFFERS_FINAL_CLASS {
template<typename T> static Type GetScalarType() {
static_assert(flatbuffers::is_scalar<T>::value, "Unrelated types");
- return flatbuffers::is_floating_point<T>::value
- ? FBT_FLOAT
- : flatbuffers::is_same<T, bool>::value
- ? FBT_BOOL
- : (flatbuffers::is_unsigned<T>::value ? FBT_UINT
- : FBT_INT);
+ return flatbuffers::is_floating_point<T>::value ? FBT_FLOAT
+ : flatbuffers::is_same<T, bool>::value
+ ? FBT_BOOL
+ : (flatbuffers::is_unsigned<T>::value ? FBT_UINT : FBT_INT);
}
public:
@@ -1844,7 +1843,7 @@ class Verifier FLATBUFFERS_FINAL_CLASS {
uint8_t len = 0;
auto vtype = ToFixedTypedVectorElementType(r.type_, &len);
if (!VerifyType(vtype)) return false;
- return VerifyFromPointer(p, r.byte_width_ * len);
+ return VerifyFromPointer(p, static_cast<size_t>(r.byte_width_) * len);
}
default: return false;
}