bitvec: Fix -Wsign-compare warnings

Change-Id: I34f65cda83bcd7050bd0cc0fb9e5cb5d33a09086
diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h
index 6a37861..70b0e27 100644
--- a/include/osmocom/core/bitvec.h
+++ b/include/osmocom/core/bitvec.h
@@ -73,7 +73,7 @@
 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 6a54344..350f738 100644
--- a/src/bitvec.c
+++ b/src/bitvec.c
@@ -197,7 +197,8 @@
  *  \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 @@
  *  \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 @@
  *  \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;