diff options
author | astange <stange@google.com> | 2020-10-12 12:14:45 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-12 09:14:45 -0700 |
commit | 77d57fd07560e1bfeccd34d1e4088cd36d3bf4be (patch) | |
tree | f4da181418cabbca70370969f31bd7482ce5fa06 /include | |
parent | 543c1bbeba18fc4e29c7b6163f0d56ea1c209926 (diff) | |
download | flatbuffers-77d57fd07560e1bfeccd34d1e4088cd36d3bf4be.tar.gz flatbuffers-77d57fd07560e1bfeccd34d1e4088cd36d3bf4be.tar.bz2 flatbuffers-77d57fd07560e1bfeccd34d1e4088cd36d3bf4be.zip |
Cast to right type for reserved_ subtraction (#6167)
reserved_ is a size_t so ensure that the output of cur_ - buf_ is cast to that to avoid compiler warnings.
Diffstat (limited to 'include')
-rw-r--r-- | include/flatbuffers/flatbuffers.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index 69c8d71b..b31191c2 100644 --- a/include/flatbuffers/flatbuffers.h +++ b/include/flatbuffers/flatbuffers.h @@ -933,7 +933,7 @@ class vector_downward { Allocator *get_custom_allocator() { return allocator_; } uoffset_t size() const { - return static_cast<uoffset_t>(reserved_ - (cur_ - buf_)); + return static_cast<uoffset_t>(reserved_ - static_cast<size_t>(cur_ - buf_)); } uoffset_t scratch_size() const { |