From e1e7dfa6259b9e50a5ce2597fc1bedd575b58663 Mon Sep 17 00:00:00 2001 From: Chris Pickett Date: Wed, 6 Jan 2016 12:33:19 -0600 Subject: [PATCH] Fixed warning building in VS2012 src\reflection.cpp(297): warning C4267: 'argument' : conversion from 'size_t' to 'flatbuffers::uoffset_t', possible loss of data sizeof() was promoting the type from uoffset_t to size_t. --- src/reflection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/reflection.cpp b/src/reflection.cpp index ab39e1e20..d82c046cc 100644 --- a/src/reflection.cpp +++ b/src/reflection.cpp @@ -289,7 +289,7 @@ void SetString(const reflection::Schema &schema, const std::string &val, auto delta = static_cast(val.size()) - static_cast(str->Length()); auto str_start = static_cast( reinterpret_cast(str) - flatbuf->data()); - auto start = str_start + sizeof(uoffset_t); + auto start = str_start + static_cast(sizeof(uoffset_t)); if (delta) { // Clear the old string, since we don't want parts of it remaining. memset(flatbuf->data() + start, 0, str->Length());