From 868f118797969cd0178d38207330e410267e6c46 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sat, 14 Nov 2009 21:59:31 -0800 Subject: Changed parse API to know about msgdefs. This should make it both easier to use and easier to optimize, in exchange for a small amount of generality. In practice, any remotely normal case is still very natural. --- tools/upbc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'tools/upbc.c') diff --git a/tools/upbc.c b/tools/upbc.c index 263f4e3..5401d69 100644 --- a/tools/upbc.c +++ b/tools/upbc.c @@ -79,7 +79,7 @@ static void write_const_h(struct upb_symtab_entry *entries[], int num_entries, for(int i = 0; i < num_entries; i++) { /* Foreach enum */ if(entries[i]->type != UPB_SYM_ENUM) continue; struct upb_symtab_entry *entry = entries[i]; - struct upb_enum *e = entry->ref._enum; + struct upb_enumdef *e = entry->ref._enum; google_protobuf_EnumDescriptorProto *ed = e->descriptor; /* We use entry->e.key (the fully qualified name) instead of ed->name. */ struct upb_string *enum_name = upb_strdup(&entry->e.key); @@ -476,8 +476,7 @@ static void write_message_c(void *data, struct upb_msgdef *m, .type = GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_TYPE_MESSAGE, .ref = {.msg = m} }; - union upb_value_ptr p = UPB_VALUE_ADDROF(val); - add_value(p, &fake_field, &types); + add_value(upb_value_addrof(&val), &fake_field, &types); add_submsgs(data, m, &types); /* Emit foward declarations for all msgs of all types, and define arrays. */ -- cgit v1.2.3