From a95ab58e79c50b0927eae2b834d3de20a8effc36 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sat, 28 Nov 2009 15:38:29 -0800 Subject: Overhaul defs to derive from a common base. --- benchmarks/parsetostruct.upb_table.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'benchmarks/parsetostruct.upb_table.c') diff --git a/benchmarks/parsetostruct.upb_table.c b/benchmarks/parsetostruct.upb_table.c index 4cf2b71..0a170de 100644 --- a/benchmarks/parsetostruct.upb_table.c +++ b/benchmarks/parsetostruct.upb_table.c @@ -31,15 +31,14 @@ static bool initialize() upb_string_unref(fds); struct upb_string *proto_name = upb_strdupc(MESSAGE_NAME); - struct upb_symtab_entry e; - if(!upb_context_lookup(c, proto_name, &e) || e.type != UPB_SYM_MESSAGE) { + def = upb_downcast_msgdef(upb_context_lookup(c, proto_name)); + if(!def) { fprintf(stderr, "Error finding symbol '" UPB_STRFMT "'.\n", UPB_STRARG(proto_name)); return false; } upb_string_unref(proto_name); - def = e.ref.msg; for(int i = 0; i < NUM_MESSAGES; i++) msgs[i] = upb_msg_new(def); -- cgit v1.2.3