diff options
author | Joshua Haberman <joshua@reverberate.org> | 2010-01-15 19:11:54 -0800 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2010-01-15 19:11:54 -0800 |
commit | d5566c6038845e505f7c16130b2368ef9bb3a373 (patch) | |
tree | bf808b4ef5d0391a9d6ed3be9247d3e0f7ce5cef /src/upb_encoder.c | |
parent | 9116c697f845e7ca215628029800c36f7dfbfaee (diff) |
Remove struct keyword from all types, use typedef instead.
Diffstat (limited to 'src/upb_encoder.c')
-rw-r--r-- | src/upb_encoder.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/upb_encoder.c b/src/upb_encoder.c index f67d39d..3e60a02 100644 --- a/src/upb_encoder.c +++ b/src/upb_encoder.c @@ -227,21 +227,19 @@ static upb_sink_status _upb_encoder_push_buf(upb_encoder *s, const uint8_t *buf, } } -static upb_sink_status _upb_encoder_valuecb(upb_sink *sink, - struct upb_fielddef *f, +static upb_sink_status _upb_encoder_valuecb(upb_sink *sink, upb_fielddef *f, union upb_value val) { upb_encoder *s = (upb_encoder*)sink; uint8_t buf[UPB_ENCODER_BUFSIZE], *ptr = buf; - upb_wire_type_t wt = upb_type_info[f->type].expected_wire_type; + upb_wire_type_t wt = upb_types[f->type].expected_wire_type; // TODO: handle packed encoding. ptr = _upb_put_tag(ptr, f->number, wt); ptr = upb_encode_value(ptr, f->type, val); return _upb_encoder_push_buf(s, buf, ptr - buf); } -static upb_sink_status _upb_encoder_strcb(upb_sink *sink, - struct upb_fielddef *f, +static upb_sink_status _upb_encoder_strcb(upb_sink *sink, upb_fielddef *f, upb_strptr str, int32_t start, uint32_t end) { @@ -257,8 +255,7 @@ static upb_sink_status _upb_encoder_strcb(upb_sink *sink, return _upb_encoder_push_buf(s, (uint8_t*)upb_string_getrobuf(str), end - start); } -static upb_sink_status _upb_encoder_startcb(upb_sink *sink, - struct upb_fielddef *f) +static upb_sink_status _upb_encoder_startcb(upb_sink *sink, upb_fielddef *f) { upb_encoder *s = (upb_encoder*)sink; uint8_t buf[UPB_ENCODER_BUFSIZE], *ptr = buf; @@ -271,8 +268,7 @@ static upb_sink_status _upb_encoder_startcb(upb_sink *sink, return _upb_encoder_push_buf(s, buf, ptr - buf); } -static upb_sink_status _upb_encoder_endcb(upb_sink *sink, - struct upb_fielddef *f) +static upb_sink_status _upb_encoder_endcb(upb_sink *sink, upb_fielddef *f) { upb_encoder *s = (upb_encoder*)sink; uint8_t buf[UPB_ENCODER_BUFSIZE], *ptr = buf; @@ -291,7 +287,7 @@ upb_sink_callbacks _upb_encoder_sink_vtbl = { /* Public Interface ***********************************************************/ -size_t upb_get_encoded_size(union upb_value v, struct upb_fielddef *f) +size_t upb_get_encoded_size(union upb_value v, upb_fielddef *f) { #define CASE(t, member_name) \ case UPB_TYPE(t): return upb_get_ ## t ## _size(v.member_name); |