summaryrefslogtreecommitdiff
path: root/src/upb_textprinter.c
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2011-05-19 10:56:34 -0700
committerJoshua Haberman <joshua@reverberate.org>2011-05-19 10:56:34 -0700
commitd619852e06983dc30d2070f6c4af32d563b101f2 (patch)
treeaad6f6c1e2221ec2f0703fab2a842022156fa520 /src/upb_textprinter.c
parenta5506318aa6f815f8c9439de99247463ad8883e0 (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_textprinter.c')
-rw-r--r--src/upb_textprinter.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/upb_textprinter.c b/src/upb_textprinter.c
index 7d0a9dd..bbf7919 100644
--- a/src/upb_textprinter.c
+++ b/src/upb_textprinter.c
@@ -151,12 +151,13 @@ static upb_sflow_t upb_textprinter_startsubmsg(void *_p, upb_value fval) {
upb_textprinter *p = _p;
upb_fielddef *f = upb_value_getfielddef(fval);
upb_textprinter_indent(p);
- CHECK(upb_bytesink_printf(p->bytesink, &p->status, UPB_STRFMT " {", UPB_STRARG(f->name)));
- if(!p->single_line) upb_bytesink_putstr(p->bytesink, UPB_STRLIT("\n"), &p->status);
+ bool ret = upb_bytesink_printf(p->bytesink, &p->status,
+ UPB_STRFMT " {", UPB_STRARG(f->name));
+ if (!ret) return UPB_SBREAK;
+ if (!p->single_line)
+ upb_bytesink_putstr(p->bytesink, UPB_STRLIT("\n"), &p->status);
p->indent_depth++;
return UPB_CONTINUE_WITH(_p);
-err:
- return UPB_S_BREAK;
}
static upb_flow_t upb_textprinter_endsubmsg(void *_p, upb_value fval) {
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback