diff options
author | Joshua Haberman <joshua@reverberate.org> | 2011-05-19 10:56:34 -0700 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2011-05-19 10:56:34 -0700 |
commit | d619852e06983dc30d2070f6c4af32d563b101f2 (patch) | |
tree | aad6f6c1e2221ec2f0703fab2a842022156fa520 /src/upb_def.c | |
parent | a5506318aa6f815f8c9439de99247463ad8883e0 (diff) |
Change dispatcher error handling model.
Now the dispatcher will call error handlers
instaed of returning statuses that the caller
has to constantly check.
Diffstat (limited to 'src/upb_def.c')
-rw-r--r-- | src/upb_def.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/upb_def.c b/src/upb_def.c index d87c7e9..413621a 100644 --- a/src/upb_def.c +++ b/src/upb_def.c @@ -886,9 +886,9 @@ static void upb_msgdef_endmsg(void *_b, upb_status *status) { upb_inttable_compact(&m->itof); // Create an ordering over the fields. - upb_field_count_t n = upb_msgdef_numfields(m); + int n = upb_msgdef_numfields(m); upb_fielddef **sorted_fields = malloc(sizeof(upb_fielddef*) * n); - upb_field_count_t field = 0; + int field = 0; upb_msg_iter i; for (i = upb_msg_begin(m); !upb_msg_done(i); i = upb_msg_next(m, i)) { sorted_fields[field++] = upb_msg_iter_field(i); @@ -1020,9 +1020,7 @@ typedef struct { static upb_symtab_ent *upb_resolve(upb_strtable *t, upb_string *base, upb_string *sym) { - if(upb_string_len(base) + upb_string_len(sym) + 1 >= UPB_SYMBOL_MAXLEN || - upb_string_len(sym) == 0) return NULL; - + if(upb_string_len(sym) == 0) return NULL; if(upb_string_getrobuf(sym)[0] == UPB_SYMBOL_SEPARATOR) { // Symbols starting with '.' are absolute, so we do a single lookup. // Slice to omit the leading '.' |