|
|
@ -1548,13 +1548,21 @@ static bool create_fielddef( |
|
|
|
f->oneof = NULL; |
|
|
|
f->oneof = NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (google_protobuf_FieldDescriptorProto_has_options(field_proto)) { |
|
|
|
options = google_protobuf_FieldDescriptorProto_has_options(field_proto) ? |
|
|
|
options = google_protobuf_FieldDescriptorProto_options(field_proto); |
|
|
|
google_protobuf_FieldDescriptorProto_options(field_proto) : NULL; |
|
|
|
f->lazy_ = google_protobuf_FieldOptions_lazy(options); |
|
|
|
|
|
|
|
|
|
|
|
if (options && google_protobuf_FieldOptions_has_packed(options)) { |
|
|
|
f->packed_ = google_protobuf_FieldOptions_packed(options); |
|
|
|
f->packed_ = google_protobuf_FieldOptions_packed(options); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
/* Repeated fields default to packed for proto3 only. */ |
|
|
|
|
|
|
|
f->packed_ = upb_fielddef_isprimitive(f) && |
|
|
|
|
|
|
|
f->label_ == UPB_LABEL_REPEATED && f->file->syntax == UPB_SYNTAX_PROTO3; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (options) { |
|
|
|
|
|
|
|
f->lazy_ = google_protobuf_FieldOptions_lazy(options); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
f->lazy_ = false; |
|
|
|
f->lazy_ = false; |
|
|
|
f->packed_ = false; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|