Fix flatbuffers conversion warnings.

(from CL 116785833)

Change-Id: I0fb0e1318fd70cba51e229a93f535c6639bbb331
parent 1c1d0791
...@@ -534,7 +534,7 @@ class vector_downward { ...@@ -534,7 +534,7 @@ class vector_downward {
inline voffset_t FieldIndexToOffset(voffset_t field_id) { inline voffset_t FieldIndexToOffset(voffset_t field_id) {
// Should correspond to what EndTable() below builds up. // Should correspond to what EndTable() below builds up.
const int fixed_fields = 2; // Vtable size and Object Size. const int fixed_fields = 2; // Vtable size and Object Size.
return (field_id + fixed_fields) * sizeof(voffset_t); return static_cast<voffset_t>((field_id + fixed_fields) * sizeof(voffset_t));
} }
// Computes how many bytes you'd have to pad to be able to write an // Computes how many bytes you'd have to pad to be able to write an
...@@ -715,7 +715,7 @@ FLATBUFFERS_FINAL_CLASS ...@@ -715,7 +715,7 @@ FLATBUFFERS_FINAL_CLASS
Align(sizeof(uoffset_t)); Align(sizeof(uoffset_t));
// Offset must refer to something already in buffer. // Offset must refer to something already in buffer.
assert(off && off <= GetSize()); assert(off && off <= GetSize());
return GetSize() - off + sizeof(uoffset_t); return GetSize() - off + static_cast<uoffset_t>(sizeof(uoffset_t));
} }
void NotNested() { void NotNested() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment