aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/wire_format.h
diff options
context:
space:
mode:
authorGravatar Bo Yang <teboring@google.com>2016-09-19 13:45:07 -0700
committerGravatar Bo Yang <teboring@google.com>2016-10-10 11:23:36 -0700
commitcc8ca5b6a5478b40546d4206392eb1471454460d (patch)
treec0b45abfa16d7d373a6ea8f7fe50f1de00ab938e /src/google/protobuf/wire_format.h
parent337a028bb65ccca4dda768695950b5aba53ae2c9 (diff)
Integrate internal changes
Diffstat (limited to 'src/google/protobuf/wire_format.h')
-rw-r--r--src/google/protobuf/wire_format.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/google/protobuf/wire_format.h b/src/google/protobuf/wire_format.h
index aaee21f0..de8ea574 100644
--- a/src/google/protobuf/wire_format.h
+++ b/src/google/protobuf/wire_format.h
@@ -85,7 +85,7 @@ class LIBPROTOBUF_EXPORT WireFormat {
// Compute the byte size of a tag. For groups, this includes both the start
// and end tags.
- static inline int TagSize(int field_number, FieldDescriptor::Type type);
+ static inline size_t TagSize(int field_number, FieldDescriptor::Type type);
// These procedures can be used to implement the methods of Message which
// handle parsing and serialization of the protocol buffer wire format
@@ -122,7 +122,7 @@ class LIBPROTOBUF_EXPORT WireFormat {
// will have their ByteSize() methods called, so their sizes will be cached.
// Therefore, calling this method is sufficient to allow you to call
// WireFormat::SerializeWithCachedSizes() on the same object.
- static int ByteSize(const Message& message);
+ static size_t ByteSize(const Message& message);
// -----------------------------------------------------------------
// Helpers for dealing with unknown fields
@@ -173,11 +173,11 @@ class LIBPROTOBUF_EXPORT WireFormat {
uint8* target);
// Compute the size of the UnknownFieldSet on the wire.
- static int ComputeUnknownFieldsSize(const UnknownFieldSet& unknown_fields);
+ static size_t ComputeUnknownFieldsSize(const UnknownFieldSet& unknown_fields);
// Same thing except for messages that have the message_set_wire_format
// option.
- static int ComputeUnknownMessageSetItemsSize(
+ static size_t ComputeUnknownMessageSetItemsSize(
const UnknownFieldSet& unknown_fields);
@@ -205,7 +205,7 @@ class LIBPROTOBUF_EXPORT WireFormat {
// Compute size of a single field. If the field is a message type, this
// will call ByteSize() for the embedded message, insuring that it caches
// its size.
- static int FieldByteSize(
+ static size_t FieldByteSize(
const FieldDescriptor* field, // Cannot be NULL
const Message& message);
@@ -218,7 +218,7 @@ class LIBPROTOBUF_EXPORT WireFormat {
const FieldDescriptor* field,
const Message& message,
io::CodedOutputStream* output);
- static int MessageSetItemByteSize(
+ static size_t MessageSetItemByteSize(
const FieldDescriptor* field,
const Message& message);
@@ -226,7 +226,7 @@ class LIBPROTOBUF_EXPORT WireFormat {
// only includes the size of the raw data, and not the size of the total
// length, but for other length-delimited types, the size of the length is
// included.
- static int FieldDataOnlyByteSize(
+ static size_t FieldDataOnlyByteSize(
const FieldDescriptor* field, // Cannot be NULL
const Message& message);
@@ -301,7 +301,8 @@ inline uint32 WireFormat::MakeTag(const FieldDescriptor* field) {
return WireFormatLite::MakeTag(field->number(), WireTypeForField(field));
}
-inline int WireFormat::TagSize(int field_number, FieldDescriptor::Type type) {
+inline size_t WireFormat::TagSize(int field_number,
+ FieldDescriptor::Type type) {
// Some compilers don't like enum -> enum casts, so we implicit_cast to
// int first.
return WireFormatLite::TagSize(field_number,