signedness: Fix less obvious issues

* My compilers mark these as errors
* Attempt to be more correct
* Tested on gcc-5.2.0 and clang-3.6.2
This commit is contained in:
Kyle Manna 2015-08-17 18:52:36 -07:00
parent e933510236
commit 376b63fb81
6 changed files with 15 additions and 15 deletions

View file

@ -79,7 +79,7 @@ int capn_deflate(struct capn_stream* s) {
continue;
default:
if (s->avail_out < 1 + sz)
if (s->avail_out < 1U + sz)
return CAPN_NEED_MORE;
*(s->next_out++) = hdr;
@ -166,7 +166,7 @@ int capn_inflate(struct capn_stream* s) {
if (hdr & (1 << i))
sz++;
}
if (s->avail_in < 2 + sz)
if (s->avail_in < 2U + sz)
return CAPN_NEED_MORE;
s->next_in += 2;