From d29f80d6f320143363fb101a9e94f89c17788468 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Thu, 3 Jun 2010 19:55:39 -0700 Subject: More incremental work. --- src/upb.c | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) (limited to 'src/upb.c') diff --git a/src/upb.c b/src/upb.c index 146a9a5..5d145e5 100644 --- a/src/upb.c +++ b/src/upb.c @@ -15,25 +15,27 @@ [GOOGLE_PROTOBUF_FIELDDESCRIPTORPROTO_TYPE_ ## proto_type] = \ {alignof(ctype), sizeof(ctype), wire_type, #ctype}, +// With packed fields, any type expecting 32-bit, 64-bit or varint can instead +// receive delimited. upb_type_info upb_types[] = { - TYPE_INFO(DOUBLE, UPB_WIRE_TYPE_64BIT, double) - TYPE_INFO(FLOAT, UPB_WIRE_TYPE_32BIT, float) - TYPE_INFO(INT64, UPB_WIRE_TYPE_VARINT, int64_t) - TYPE_INFO(UINT64, UPB_WIRE_TYPE_VARINT, uint64_t) - TYPE_INFO(INT32, UPB_WIRE_TYPE_VARINT, int32_t) - TYPE_INFO(FIXED64, UPB_WIRE_TYPE_64BIT, uint64_t) - TYPE_INFO(FIXED32, UPB_WIRE_TYPE_32BIT, uint32_t) - TYPE_INFO(BOOL, UPB_WIRE_TYPE_VARINT, bool) - TYPE_INFO(MESSAGE, UPB_WIRE_TYPE_DELIMITED, void*) - TYPE_INFO(GROUP, UPB_WIRE_TYPE_START_GROUP, void*) - TYPE_INFO(UINT32, UPB_WIRE_TYPE_VARINT, uint32_t) - TYPE_INFO(ENUM, UPB_WIRE_TYPE_VARINT, uint32_t) - TYPE_INFO(SFIXED32, UPB_WIRE_TYPE_32BIT, int32_t) - TYPE_INFO(SFIXED64, UPB_WIRE_TYPE_64BIT, int64_t) - TYPE_INFO(SINT32, UPB_WIRE_TYPE_VARINT, int32_t) - TYPE_INFO(SINT64, UPB_WIRE_TYPE_VARINT, int64_t) - TYPE_INFO(STRING, UPB_WIRE_TYPE_DELIMITED, upb_strptr) - TYPE_INFO(BYTES, UPB_WIRE_TYPE_DELIMITED, upb_strptr) + TYPE_INFO(DOUBLE, (1<