aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/io/coded_stream.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/io/coded_stream.h
parent337a028bb65ccca4dda768695950b5aba53ae2c9 (diff)
Integrate internal changes
Diffstat (limited to 'src/google/protobuf/io/coded_stream.h')
-rw-r--r--src/google/protobuf/io/coded_stream.h14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/google/protobuf/io/coded_stream.h b/src/google/protobuf/io/coded_stream.h
index 316da765..1402cc17 100644
--- a/src/google/protobuf/io/coded_stream.h
+++ b/src/google/protobuf/io/coded_stream.h
@@ -784,17 +784,17 @@ class LIBPROTOBUF_EXPORT CodedOutputStream {
uint8* target);
// Returns the number of bytes needed to encode the given value as a varint.
- static int VarintSize32(uint32 value);
+ static size_t VarintSize32(uint32 value);
// Returns the number of bytes needed to encode the given value as a varint.
- static int VarintSize64(uint64 value);
+ static size_t VarintSize64(uint64 value);
// If negative, 10 bytes. Otheriwse, same as VarintSize32().
- static int VarintSize32SignExtended(int32 value);
+ static size_t VarintSize32SignExtended(int32 value);
// Compile-time equivalent of VarintSize32().
template <uint32 Value>
struct StaticVarintSize32 {
- static const int value =
+ static const size_t value =
(Value < (1 << 7))
? 1
: (Value < (1 << 14))
@@ -890,7 +890,7 @@ class LIBPROTOBUF_EXPORT CodedOutputStream {
GOOGLE_ATTRIBUTE_ALWAYS_INLINE static uint8* WriteVarint64ToArrayInline(
uint64 value, uint8* target);
- static int VarintSize32Fallback(uint32 value);
+ static size_t VarintSize32Fallback(uint32 value);
// See above. Other projects may use "friend" to allow them to call this.
static void SetDefaultSerializationDeterministic() {
@@ -1225,7 +1225,7 @@ inline uint8* CodedOutputStream::WriteTagToArray(
return WriteVarint32ToArray(value, target);
}
-inline int CodedOutputStream::VarintSize32(uint32 value) {
+inline size_t CodedOutputStream::VarintSize32(uint32 value) {
if (value < (1 << 7)) {
return 1;
} else {
@@ -1233,7 +1233,7 @@ inline int CodedOutputStream::VarintSize32(uint32 value) {
}
}
-inline int CodedOutputStream::VarintSize32SignExtended(int32 value) {
+inline size_t CodedOutputStream::VarintSize32SignExtended(int32 value) {
if (value < 0) {
return 10; // TODO(kenton): Make this a symbolic constant.
} else {