summaryrefslogtreecommitdiffstats
path: root/pb_decode.c
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-09-03 17:35:14 +0300
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-09-03 17:35:14 +0300
commitb214de4e1e53f14354db36b8f199db6177a63744 (patch)
tree5b45b98c14a59d075d3ab939efc13ecb1ab9f8e5 /pb_decode.c
parentbe78e3b4d0ff9839817b0eeef5d3e75056b53af1 (diff)
Enable -Wconversion for core and fix the warnings.
This should help avoid issue 33 in the future.
Diffstat (limited to 'pb_decode.c')
-rw-r--r--pb_decode.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/pb_decode.c b/pb_decode.c
index 65db511..86dec4b 100644
--- a/pb_decode.c
+++ b/pb_decode.c
@@ -83,7 +83,7 @@ static bool checkreturn pb_decode_varint32(pb_istream_t *stream, uint32_t *dest)
bool checkreturn pb_decode_varint(pb_istream_t *stream, uint64_t *dest)
{
uint8_t byte;
- uint8_t bitpos = 0;
+ int bitpos = 0;
*dest = 0;
while (bitpos < 64 && pb_read(stream, &byte, 1))
@@ -447,7 +447,7 @@ bool checkreturn pb_decode_noinit(pb_istream_t *stream, const pb_field_t fields[
if (PB_HTYPE(iter.current->type) == PB_HTYPE_REQUIRED
&& iter.required_field_index < PB_MAX_REQUIRED_FIELDS)
{
- fields_seen[iter.required_field_index >> 3] |= 1 << (iter.required_field_index & 7);
+ fields_seen[iter.required_field_index >> 3] |= (uint8_t)(1 << (iter.required_field_index & 7));
}
if (!decode_field(stream, wire_type, &iter))
@@ -483,9 +483,9 @@ bool pb_decode_svarint(pb_istream_t *stream, int64_t *dest)
return false;
if (value & 1)
- *dest = ~(value >> 1);
+ *dest = (int64_t)(~(value >> 1));
else
- *dest = value >> 1;
+ *dest = (int64_t)(value >> 1);
return true;
}