mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 12:05:50 +00:00
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.
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user