mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-05 13:08:58 +00:00
more window fixes
This commit is contained in:
@@ -26,7 +26,7 @@ static BinaryRegion MakeBinaryRegion(
|
||||
const uint64_t offset = 0, const uint64_t length = 0,
|
||||
const BinaryRegionType type = BinaryRegionType::Unknown,
|
||||
const uint64_t array_length = 0, const uint64_t points_to_offset = 0,
|
||||
const BinaryRegionComment comment = {}) {
|
||||
BinaryRegionComment comment = {}) {
|
||||
BinaryRegion region;
|
||||
region.offset = offset;
|
||||
region.length = length;
|
||||
@@ -39,7 +39,7 @@ static BinaryRegion MakeBinaryRegion(
|
||||
|
||||
static BinarySection MakeBinarySection(
|
||||
const std::string &name, const BinarySectionType type,
|
||||
const std::vector<BinaryRegion> regions) {
|
||||
std::vector<BinaryRegion> regions) {
|
||||
BinarySection section;
|
||||
section.name = name;
|
||||
section.type = type;
|
||||
|
||||
@@ -258,7 +258,7 @@ class BinaryAnnotator {
|
||||
uint16_t offset_from_table = 0;
|
||||
};
|
||||
|
||||
const reflection::Object *referring_table;
|
||||
const reflection::Object *referring_table = nullptr;
|
||||
|
||||
// Field ID -> {field def, offset from table}
|
||||
std::map<uint16_t, Entry> fields;
|
||||
|
||||
@@ -506,7 +506,9 @@ class ResizeContext {
|
||||
// Recurse.
|
||||
switch (base_type) {
|
||||
case reflection::Obj: {
|
||||
ResizeTable(*subobjectdef, reinterpret_cast<Table *>(ref));
|
||||
if (subobjectdef) {
|
||||
ResizeTable(*subobjectdef, reinterpret_cast<Table *>(ref));
|
||||
}
|
||||
break;
|
||||
}
|
||||
case reflection::Vector: {
|
||||
@@ -564,7 +566,7 @@ void SetString(const reflection::Schema &schema, const std::string &val,
|
||||
// Clear the old string, since we don't want parts of it remaining.
|
||||
memset(flatbuf->data() + start, 0, str->size());
|
||||
// Different size, we must expand (or contract).
|
||||
ResizeContext(schema, start, delta, flatbuf, root_table);
|
||||
ResizeContext ctx(schema, start, delta, flatbuf, root_table);
|
||||
// Set the new length.
|
||||
WriteScalar(flatbuf->data() + str_start,
|
||||
static_cast<uoffset_t>(val.size()));
|
||||
@@ -590,7 +592,7 @@ uint8_t *ResizeAnyVector(const reflection::Schema &schema, uoffset_t newsize,
|
||||
auto size_clear = -delta_elem * elem_size;
|
||||
memset(flatbuf->data() + start - size_clear, 0, size_clear);
|
||||
}
|
||||
ResizeContext(schema, start, delta_bytes, flatbuf, root_table);
|
||||
ResizeContext ctx(schema, start, delta_bytes, flatbuf, root_table);
|
||||
WriteScalar(flatbuf->data() + vec_start, newsize); // Length field.
|
||||
// Set new elements to 0.. this can be overwritten by the caller.
|
||||
if (delta_elem > 0) {
|
||||
|
||||
Reference in New Issue
Block a user