aboutsummaryrefslogtreecommitdiffstats
path: root/pb_encode.c
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-04-18 20:15:36 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-04-18 20:15:36 +0300
commitd1ca88d20ec1b205752546a40ef520a392d0002f (patch)
tree8b5452856d910af7eabba780b91e9bbbbd25fd48 /pb_encode.c
parent9fbe9a5de30c3326bd7015e91c5ba634df49ee25 (diff)
Fixing compiler warnings, mostly related to unused parameters.
Thanks to David Hotham for the patch. Fixes issue 8.
Diffstat (limited to 'pb_encode.c')
-rw-r--r--pb_encode.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/pb_encode.c b/pb_encode.c
index 804c1a6a..18173735 100644
--- a/pb_encode.c
+++ b/pb_encode.c
@@ -76,7 +76,7 @@ bool checkreturn pb_write(pb_ostream_t *stream, const uint8_t *buf, size_t count
static bool checkreturn encode_array(pb_ostream_t *stream, const pb_field_t *field,
const void *pData, size_t count, pb_encoder_t func)
{
- int i;
+ size_t i;
const void *p;
size_t size;
@@ -212,7 +212,7 @@ bool checkreturn pb_encode_varint(pb_ostream_t *stream, uint64_t value)
while (value)
{
- buffer[i] = (value & 0x7F) | 0x80;
+ buffer[i] = (uint8_t)((value & 0x7F) | 0x80);
value >>= 7;
i++;
}
@@ -373,22 +373,26 @@ bool checkreturn pb_enc_svarint(pb_ostream_t *stream, const pb_field_t *field, c
bool checkreturn pb_enc_fixed64(pb_ostream_t *stream, const pb_field_t *field, const void *src)
{
+ UNUSED(field);
return pb_encode_fixed64(stream, src);
}
bool checkreturn pb_enc_fixed32(pb_ostream_t *stream, const pb_field_t *field, const void *src)
{
+ UNUSED(field);
return pb_encode_fixed32(stream, src);
}
bool checkreturn pb_enc_bytes(pb_ostream_t *stream, const pb_field_t *field, const void *src)
{
pb_bytes_array_t *bytes = (pb_bytes_array_t*)src;
+ UNUSED(field);
return pb_encode_string(stream, bytes->bytes, bytes->size);
}
bool checkreturn pb_enc_string(pb_ostream_t *stream, const pb_field_t *field, const void *src)
{
+ UNUSED(field);
return pb_encode_string(stream, (uint8_t*)src, strlen((char*)src));
}