summaryrefslogtreecommitdiffstats
path: root/pb_decode.c
diff options
context:
space:
mode:
authordch <david.hotham@metaswitch.com>2012-09-02 21:24:19 +0100
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2012-09-03 17:18:49 +0300
commitbe78e3b4d0ff9839817b0eeef5d3e75056b53af1 (patch)
treeedb3a8d2bda242967728af54ca02a8ce2b8c5ff3 /pb_decode.c
parent11e0918b5e8832fef167a260b4afde2dc972dcf7 (diff)
Fix build warnings on MS compilers
Update issue 33 Status: FixedInGit
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 2235280e..65db511c 100644
--- a/pb_decode.c
+++ b/pb_decode.c
@@ -539,9 +539,9 @@ bool checkreturn pb_dec_varint(pb_istream_t *stream, const pb_field_t *field, vo
switch (field->data_size)
{
- case 1: *(uint8_t*)dest = value; break;
- case 2: *(uint16_t*)dest = value; break;
- case 4: *(uint32_t*)dest = value; break;
+ case 1: *(uint8_t*)dest = (uint8_t)value; break;
+ case 2: *(uint16_t*)dest = (uint16_t)value; break;
+ case 4: *(uint32_t*)dest = (uint32_t)value; break;
case 8: *(uint64_t*)dest = value; break;
default: PB_RETURN_ERROR(stream, "invalid data_size");
}
@@ -556,7 +556,7 @@ bool checkreturn pb_dec_svarint(pb_istream_t *stream, const pb_field_t *field, v
switch (field->data_size)
{
- case 4: *(int32_t*)dest = value; break;
+ case 4: *(int32_t*)dest = (int32_t)value; break;
case 8: *(int64_t*)dest = value; break;
default: PB_RETURN_ERROR(stream, "invalid data_size");
}