diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2011-09-12 18:33:06 -0700 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2011-09-12 18:33:06 -0700 |
commit | 887abe669f9a71c5fb530f0315e350ba22a150a7 (patch) | |
tree | 0122e0acc30624102e0a82362f50f0e5dcc970ac /upb/def.h | |
parent | bda3269a42877ae0a0b2b44b579cba5b13d5b1de (diff) |
Added an example, constified some more methods.
Diffstat (limited to 'upb/def.h')
-rw-r--r-- | upb/def.h | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -294,13 +294,13 @@ void upb_msgdef_layout(upb_msgdef *m); // Looks up a field by name or number. While these are written to be as fast // as possible, it will still be faster to cache the results of this lookup if // possible. These return NULL if no such field is found. -INLINE upb_fielddef *upb_msgdef_itof(upb_msgdef *m, uint32_t i) { +INLINE upb_fielddef *upb_msgdef_itof(const upb_msgdef *m, uint32_t i) { upb_itof_ent *e = (upb_itof_ent*) upb_inttable_fastlookup(&m->itof, i, sizeof(upb_itof_ent)); return e ? e->f : NULL; } -INLINE upb_fielddef *upb_msgdef_ntof(upb_msgdef *m, const char *name) { +INLINE upb_fielddef *upb_msgdef_ntof(const upb_msgdef *m, const char *name) { upb_ntof_ent *e = (upb_ntof_ent*)upb_strtable_lookup(&m->ntof, name); return e ? e->f : NULL; } |