Fixed warnings on Windows

This commit is contained in:
Wouter van Oortmerssen
2015-06-15 15:57:48 -07:00
committed by Wouter van Oortmerssen
parent 5faa0ab1be
commit 622b8d05cf
4 changed files with 30 additions and 14 deletions

View File

@@ -40,7 +40,7 @@ const char kTypeSizes[] = {
// The enums in the reflection schema should match the ones we use internally.
// Compare the last element to check if these go out of sync.
static_assert(BASE_TYPE_UNION ==
static_cast<BaseType>(reflection::BaseType::Union),
static_cast<BaseType>(reflection::Union),
"enums don't match");
static void Error(const std::string &msg) {
@@ -1346,7 +1346,9 @@ Offset<reflection::Object> StructDef::Serialize(FlatBufferBuilder *builder)
const {
std::vector<Offset<reflection::Field>> field_offsets;
for (auto it = fields.vec.begin(); it != fields.vec.end(); ++it) {
field_offsets.push_back((*it)->Serialize(builder, it - fields.vec.begin()));
field_offsets.push_back(
(*it)->Serialize(builder,
static_cast<uint16_t>(it - fields.vec.begin())));
}
return reflection::CreateObject(*builder,
builder->CreateString(name),