Merge pull request #3495 from parnic/fix-reflection-vs2012-warnings

Fixed warning building in VS2012
This commit is contained in:
Wouter van Oortmerssen
2016-01-06 12:03:40 -08:00

View File

@@ -289,7 +289,7 @@ void SetString(const reflection::Schema &schema, const std::string &val,
auto delta = static_cast<int>(val.size()) - static_cast<int>(str->Length());
auto str_start = static_cast<uoffset_t>(
reinterpret_cast<const uint8_t *>(str) - flatbuf->data());
auto start = str_start + sizeof(uoffset_t);
auto start = str_start + static_cast<uoffset_t>(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());