From bf2c598f63b56c634b20df3ccb278f8439d75664 Mon Sep 17 00:00:00 2001 From: Michael Gartsbein Date: Tue, 29 Mar 2016 10:26:01 +0300 Subject: [PATCH] uint8_t cast --- lib/capnp_c.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/capnp_c.h b/lib/capnp_c.h index 40d88f0..900bfc3 100644 --- a/lib/capnp_c.h +++ b/lib/capnp_c.h @@ -329,10 +329,10 @@ CAPN_INLINE int capn_write1(capn_ptr p, int off, int val) { if (off >= p.datasz*8) { return -1; } else if (val) { - ((uint8_t*)p.data)[off/8] |= 1 << (off%8); + ((uint8_t*)p.data)[off/8] |= (uint8_t)(1 << (off%8)); return 0; } else { - ((uint8_t*)p.data)[off/8] &= ~(1 << (off%8)); + ((uint8_t*)p.data)[off/8] &= (uint8_t)~(1 << (off%8)); return 0; } }