diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 6a378610c..70b0e27d1 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -73,7 +73,7 @@ char bit_value_to_char(enum bit_value v); void bitvec_to_string_r(const struct bitvec *bv, char *str); void bitvec_zero(struct bitvec *bv); unsigned bitvec_rl(const struct bitvec *bv, bool b); -unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits); +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, unsigned int max_bits); void bitvec_shiftl(struct bitvec *bv, unsigned int n); int16_t bitvec_get_int16_msb(const struct bitvec *bv, unsigned int num_bits); unsigned int bitvec_add_array(struct bitvec *bv, const uint32_t *array, diff --git a/src/bitvec.c b/src/bitvec.c index 6a54344c4..350f7383b 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -197,7 +197,8 @@ int bitvec_get_bit_high(struct bitvec *bv) * \return 0 on success; negative in case of error */ int bitvec_set_bits(struct bitvec *bv, const enum bit_value *bits, unsigned int count) { - int i, rc; + unsigned int i; + int rc; for (i = 0; i < count; i++) { rc = bitvec_set_bit(bv, bits[i]); @@ -260,7 +261,7 @@ int16_t bitvec_get_int16_msb(const struct bitvec *bv, unsigned int num_bits) * \return integer value retrieved from bit vector */ int bitvec_get_uint(struct bitvec *bv, unsigned int num_bits) { - int i; + unsigned int i; unsigned int ui = 0; for (i = 0; i < num_bits; i++) { @@ -603,7 +604,7 @@ unsigned bitvec_rl(const struct bitvec *bv, bool b) * \returns Number of consecutive bits of \p b in \p bv and cur_bit will * \go to cur_bit + number of consecutive bit */ -unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits) +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, unsigned int max_bits) { unsigned i = 0; unsigned j = 8;