diff options
author | Joshua Haberman <joshua@reverberate.org> | 2009-11-14 21:59:31 -0800 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2009-11-14 21:59:31 -0800 |
commit | 868f118797969cd0178d38207330e410267e6c46 (patch) | |
tree | 650c891eae81fc946e24e3a1cf0e9ee3e3c09c55 /tools/upbc.c | |
parent | 7cde43ea0abf2022a0c800c7af1d5f1ec2033bea (diff) |
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.
Diffstat (limited to 'tools/upbc.c')
-rw-r--r-- | tools/upbc.c | 5 |
1 files changed, 2 insertions, 3 deletions
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. */ |