summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-07-05 18:27:07 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-07-05 18:27:07 +0300
commit01a155689828574047a8377d595a0ad038c48917 (patch)
tree1e372909a007aecf44709b39efb3bac190cc90f5
parentefef38cf7869f11750fba1dfb965e93b42d5d49e (diff)
Apparently some compilers don't want to automatically cast size_t to uint64_t.
-rw-r--r--pb_encode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pb_encode.c b/pb_encode.c
index faaeac9d..be909ec2 100644
--- a/pb_encode.c
+++ b/pb_encode.c
@@ -110,7 +110,7 @@ static bool checkreturn encode_array(pb_ostream_t *stream, const pb_field_t *fie
size = sizestream.bytes_written;
}
- if (!pb_encode_varint(stream, size))
+ if (!pb_encode_varint(stream, (uint64_t)size))
return false;
if (stream->callback == NULL)
@@ -269,7 +269,7 @@ bool checkreturn pb_encode_fixed64(pb_ostream_t *stream, const void *value)
bool checkreturn pb_encode_tag(pb_ostream_t *stream, pb_wire_type_t wiretype, int field_number)
{
int tag = wiretype | (field_number << 3);
- return pb_encode_varint(stream, tag);
+ return pb_encode_varint(stream, (uint64_t)tag);
}
bool checkreturn pb_encode_tag_for_field(pb_ostream_t *stream, const pb_field_t *field)
@@ -305,7 +305,7 @@ bool checkreturn pb_encode_tag_for_field(pb_ostream_t *stream, const pb_field_t
bool checkreturn pb_encode_string(pb_ostream_t *stream, const uint8_t *buffer, size_t size)
{
- if (!pb_encode_varint(stream, size))
+ if (!pb_encode_varint(stream, (uint64_t)size))
return false;
return pb_write(stream, buffer, size);
@@ -323,7 +323,7 @@ bool checkreturn pb_encode_submessage(pb_ostream_t *stream, const pb_field_t fie
size = substream.bytes_written;
- if (!pb_encode_varint(stream, size))
+ if (!pb_encode_varint(stream, (uint64_t)size))
return false;
if (stream->callback == NULL)