From: astange Date: Mon, 12 Oct 2020 16:14:45 +0000 (-0400) Subject: Cast to right type for reserved_ subtraction (#6167) X-Git-Tag: v2.0.0~209 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=77d57fd07560e1bfeccd34d1e4088cd36d3bf4be;p=platform%2Fupstream%2Fflatbuffers.git 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. --- diff --git a/include/flatbuffers/flatbuffers.h b/include/flatbuffers/flatbuffers.h index 69c8d71..b31191c 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(reserved_ - (cur_ - buf_)); + return static_cast(reserved_ - static_cast(cur_ - buf_)); } uoffset_t scratch_size() const {