From 887abe669f9a71c5fb530f0315e350ba22a150a7 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Mon, 12 Sep 2011 18:33:06 -0700 Subject: Added an example, constified some more methods. --- upb/def.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'upb/def.h') 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; } -- cgit v1.2.3