From fd1ad20a2daf07de8a4c06e862963bfd556dad62 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Wed, 1 Jul 2009 18:48:22 -0700 Subject: Remove public visibility from a few parsing functions. --- upb_parse.c | 8 ++++---- upb_parse.h | 8 -------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/upb_parse.c b/upb_parse.c index 625b2cc..94eb19a 100644 --- a/upb_parse.c +++ b/upb_parse.c @@ -187,7 +187,7 @@ struct upb_type_info upb_type_info[] = { [GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_TYPE_GROUP] = {0,0,0}, }; -upb_status_t upb_parse_tag(void **buf, void *end, struct upb_tag *tag) +static upb_status_t parse_tag(void **buf, void *end, struct upb_tag *tag) { uint32_t tag_int; UPB_CHECK(get_v_uint32_t(buf, end, &tag_int)); @@ -208,7 +208,7 @@ upb_status_t upb_parse_wire_value(void **buf, void *end, upb_wire_type_t wt, return UPB_STATUS_OK; } -upb_status_t upb_skip_wire_value(void **buf, void *end, upb_wire_type_t wt) +static upb_status_t skip_wire_value(void **buf, void *end, upb_wire_type_t wt) { switch(wt) { case UPB_WIRE_TYPE_VARINT: UPB_CHECK(skip_v_uint64_t(buf, end)); break; @@ -327,7 +327,7 @@ static upb_status_t parse_nondelimited(struct upb_parse_state *s, void *user_field_desc; upb_field_type_t ft = s->tag_cb(s, tag, &user_field_desc); if(ft == 0) { - UPB_CHECK(upb_skip_wire_value(buf, end, tag->wire_type)); + UPB_CHECK(skip_wire_value(buf, end, tag->wire_type)); } else if(ft == GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_TYPE_GROUP) { /* No length specified, an "end group" tag will mark the end. */ UPB_CHECK(push_stack_frame(s, 0, user_field_desc)); @@ -350,7 +350,7 @@ upb_status_t upb_parse(struct upb_parse_state *s, void *buf, size_t len, struct upb_tag tag; void *bufstart = buf; - UPB_CHECK(upb_parse_tag(&buf, end, &tag)); + UPB_CHECK(parse_tag(&buf, end, &tag)); if(unlikely(tag.wire_type == UPB_WIRE_TYPE_END_GROUP)) { if(unlikely(s->top->end_offset != 0)) return UPB_ERROR_SPURIOUS_END_GROUP; pop_stack_frame(s); diff --git a/upb_parse.h b/upb_parse.h index 45b5b76..14520f3 100644 --- a/upb_parse.h +++ b/upb_parse.h @@ -96,11 +96,6 @@ INLINE bool upb_check_type(upb_wire_type_t wt, upb_field_type_t ft) { /* Data-consuming functions (to be called from value cb). *********************/ -/* Parses a single tag from the character data starting at buf, and updates - * buf to point one past the bytes that were consumed. buf will be incremented - * by at most ten bytes. */ -upb_status_t upb_parse_tag(void **buf, void *end, struct upb_tag *tag); - /* Parses and converts a value from the character data starting at buf. The * caller must have previously checked that the wire type is appropriate for * this field type. For delimited data, buf is advanced to the beginning of @@ -115,9 +110,6 @@ upb_status_t upb_parse_value(void **buf, void *end, upb_field_type_t ft, upb_status_t upb_parse_wire_value(void **buf, void *end, upb_wire_type_t wt, union upb_wire_value *wv); -/* Like the above, but discards the wire value instead of saving it. */ -upb_status_t upb_skip_wire_value(void **buf, void *end, upb_wire_type_t wt); - #ifdef __cplusplus } /* extern "C" */ #endif -- cgit v1.2.3