summaryrefslogtreecommitdiff
path: root/stream
diff options
context:
space:
mode:
authorJoshua Haberman <joshua@reverberate.org>2011-02-06 12:42:35 -0800
committerJoshua Haberman <joshua@reverberate.org>2011-02-06 12:42:35 -0800
commit0313826cef64ca89058f32e3c8a2868e8f9e98df (patch)
treef83f48aa8fea6b70fb6b5290e5c38786301b660f /stream
parent4667ed4be921b2142321e47c8ccc6a35a9189277 (diff)
Benchmarks compile and run again!
Diffstat (limited to 'stream')
-rw-r--r--stream/upb_decoder.c3
-rw-r--r--stream/upb_strstream.c4
2 files changed, 3 insertions, 4 deletions
diff --git a/stream/upb_decoder.c b/stream/upb_decoder.c
index 588d553..2fadf51 100644
--- a/stream/upb_decoder.c
+++ b/stream/upb_decoder.c
@@ -389,8 +389,7 @@ void upb_decoder_reset(upb_decoder *d, upb_bytesrc *bytesrc) {
d->top->msgdef = d->toplevel_msgdef;
// Never want to end top-level message, so treat it like a group.
d->top->end_offset = UPB_GROUP_END_OFFSET;
- upb_string_unref(d->buf);
- d->buf = NULL;
+ upb_string_recycle(&d->buf);
}
void upb_decoder_uninit(upb_decoder *d) {
diff --git a/stream/upb_strstream.c b/stream/upb_strstream.c
index 8a230ae..a7967d4 100644
--- a/stream/upb_strstream.c
+++ b/stream/upb_strstream.c
@@ -13,7 +13,7 @@ static upb_strlen_t upb_stringsrc_read(upb_bytesrc *_src, void *buf,
upb_strlen_t count, upb_status *status) {
upb_stringsrc *src = (upb_stringsrc*)_src;
if (src->offset == upb_string_len(src->str)) {
- upb_seterr(status, UPB_EOF, "");
+ status->code = UPB_EOF;
return -1;
} else {
upb_strlen_t to_read = UPB_MIN(count, upb_string_len(src->str) - src->offset);
@@ -27,7 +27,7 @@ static bool upb_stringsrc_getstr(upb_bytesrc *_src, upb_string *str,
upb_status *status) {
upb_stringsrc *src = (upb_stringsrc*)_src;
if (src->offset == upb_string_len(src->str)) {
- upb_seterr(status, UPB_EOF, "");
+ status->code = UPB_EOF;
return false;
} else {
upb_strlen_t len = upb_string_len(src->str) - src->offset;
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback