summaryrefslogtreecommitdiff
path: root/upb/def.h
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2011-09-12 18:33:06 -0700
committerJoshua Haberman <jhaberman@gmail.com>2011-09-12 18:33:06 -0700
commit887abe669f9a71c5fb530f0315e350ba22a150a7 (patch)
tree0122e0acc30624102e0a82362f50f0e5dcc970ac /upb/def.h
parentbda3269a42877ae0a0b2b44b579cba5b13d5b1de (diff)
Added an example, constified some more methods.
Diffstat (limited to 'upb/def.h')
-rw-r--r--upb/def.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/upb/def.h b/upb/def.h
index d3c7c07..ab84376 100644
--- a/upb/def.h
+++ b/upb/def.h
@@ -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;
}
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback