summaryrefslogtreecommitdiff
path: root/upb/encode.c
diff options
context:
space:
mode:
authorBo Yang <teboring@google.com>2018-03-06 23:59:58 +0000
committerBo Yang <teboring@google.com>2018-03-07 00:12:28 +0000
commitcafebf6beede670a10535809667ac9b9f3033091 (patch)
treebe9f5460fa96e5e8690f5230a779d64c74e6abd8 /upb/encode.c
parentbcb62b7fbfb0c959f7d3671b40c1b7efbb3a4156 (diff)
For encoding upb needs descriptor type instead of type.
Diffstat (limited to 'upb/encode.c')
-rw-r--r--upb/encode.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/upb/encode.c b/upb/encode.c
index 5acb492..a582a2f 100644
--- a/upb/encode.c
+++ b/upb/encode.c
@@ -162,7 +162,7 @@ static bool upb_encode_array(upb_encstate *e, const char *field_mem,
return true;
}
- UPB_ASSERT(arr->type == upb_desctype_to_fieldtype2[f->type]);
+ UPB_ASSERT(arr->type == upb_desctype_to_fieldtype2[f->descriptortype]);
#define VARINT_CASE(ctype, encode) { \
ctype *start = arr->data; \
@@ -177,7 +177,7 @@ static bool upb_encode_array(upb_encstate *e, const char *field_mem,
break; \
do { ; } while(0)
- switch (f->type) {
+ switch (f->descriptortype) {
case UPB_DESCRIPTOR_TYPE_DOUBLE:
CHK(upb_put_fixedarray(e, arr, sizeof(double)));
break;
@@ -267,7 +267,7 @@ static bool upb_encode_scalarfield(upb_encstate *e, const char *field_mem,
upb_put_tag(e, f->number, wire_type); \
} while(0)
- switch (f->type) {
+ switch (f->descriptortype) {
case UPB_DESCRIPTOR_TYPE_DOUBLE:
CASE(double, double, UPB_WIRE_TYPE_64BIT, val);
case UPB_DESCRIPTOR_TYPE_FLOAT:
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback