diff options
author | Joshua Haberman <joshua@reverberate.org> | 2009-07-21 23:28:11 -0700 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2009-07-21 23:28:11 -0700 |
commit | b2a890263f4284b109b667aaa0fe341d74201aba (patch) | |
tree | 15aee323d4aaf5656c6931e0661639b6217b04dc /src/upb_msg.h | |
parent | c9105bbf58b7c98058ca2d2fe5dd7cd87e1554c7 (diff) |
Properly initialize the fqname member of upb_msg.
Diffstat (limited to 'src/upb_msg.h')
-rw-r--r-- | src/upb_msg.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/upb_msg.h b/src/upb_msg.h index 9eaf6c2..6be9405 100644 --- a/src/upb_msg.h +++ b/src/upb_msg.h @@ -164,11 +164,15 @@ INLINE struct google_protobuf_FieldDescriptorProto *upb_msg_field_descriptor( * the caller should do that post-initialization by calling upb_msg_ref() * below. * + * fqname indicates the fully-qualified name of this message. Ownership of + * fqname passes to the msg, but the msg will contain references to it, so it + * must outlive the msg. + * * sort indicates whether or not it is safe to reorder the fields from the order * they appear in d. This should be false if code has been compiled against a * header for this type that expects the given order. */ bool upb_msg_init(struct upb_msg *m, struct google_protobuf_DescriptorProto *d, - bool sort); + struct upb_string fqname, bool sort); void upb_msg_free(struct upb_msg *m); /* Clients use this function on a previously initialized upb_msg to resolve the @@ -182,7 +186,7 @@ void upb_msg_ref(struct upb_msg *m, struct upb_msg_field *f, union upb_symbol_re INLINE struct upb_msg_field *upb_msg_fieldbynum(struct upb_msg *m, uint32_t number) { struct upb_fieldsbynum_entry *e = - (struct upb_fieldsbynum_entry*)upb_inttable_lookup( + (struct upb_fieldsbynum_entry*)upb_inttable_fast_lookup( &m->fields_by_num, number, sizeof(struct upb_fieldsbynum_entry)); return e ? &e->f : NULL; } |