diff options
author | Harald Welte <laforge@gnumonks.org> | 2010-03-06 11:28:49 +0100 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2010-03-06 11:28:49 +0100 |
commit | d9abf01436ff081a08885f1e9f8b271fc708cb72 (patch) | |
tree | c7535e6f83365f05f7ede974387051aa32e2e9d3 | |
parent | 4e1287938eba4d77d6464261aa20d185d2765f22 (diff) |
mark some occasions of bitvec as 'const' as appropriate
-rw-r--r-- | include/osmocore/bitvec.h | 4 | ||||
-rw-r--r-- | src/bitvec.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/include/osmocore/bitvec.h b/include/osmocore/bitvec.h index 11cb01ea5..7a26bce45 100644 --- a/include/osmocore/bitvec.h +++ b/include/osmocore/bitvec.h @@ -40,10 +40,10 @@ struct bitvec { }; /* check if the bit is 0 or 1 for a given position inside a bitvec */ -enum bit_value bitvec_get_bit_pos(struct bitvec *bv, unsigned int bitnr); +enum bit_value bitvec_get_bit_pos(const struct bitvec *bv, unsigned int bitnr); /* get the Nth set bit inside the bit vector */ -unsigned int bitvec_get_nth_set_bit(struct bitvec *bv, unsigned int n); +unsigned int bitvec_get_nth_set_bit(const struct bitvec *bv, unsigned int n); /* Set a bit at given position */ int bitvec_set_bit_pos(struct bitvec *bv, unsigned int bitnum, diff --git a/src/bitvec.c b/src/bitvec.c index 235c3ce15..eb83ac667 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -60,7 +60,7 @@ static uint8_t bitval2mask(enum bit_value bit, uint8_t bitnum) } /* check if the bit is 0 or 1 for a given position inside a bitvec */ -enum bit_value bitvec_get_bit_pos(struct bitvec *bv, unsigned int bitnr) +enum bit_value bitvec_get_bit_pos(const struct bitvec *bv, unsigned int bitnr) { unsigned int bytenum = bytenum_from_bitnum(bitnr); unsigned int bitnum = 7 - (bitnr % 8); @@ -78,7 +78,7 @@ enum bit_value bitvec_get_bit_pos(struct bitvec *bv, unsigned int bitnr) } /* get the Nth set bit inside the bit vector */ -unsigned int bitvec_get_nth_set_bit(struct bitvec *bv, unsigned int n) +unsigned int bitvec_get_nth_set_bit(const struct bitvec *bv, unsigned int n) { unsigned int i, k = 0; |