mark some occasions of bitvec as 'const' as appropriate
This commit is contained in:
parent
4e1287938e
commit
d9abf01436
|
@ -40,10 +40,10 @@ struct bitvec {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* check if the bit is 0 or 1 for a given position inside a 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 */
|
/* 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 */
|
/* Set a bit at given position */
|
||||||
int bitvec_set_bit_pos(struct bitvec *bv, unsigned int bitnum,
|
int bitvec_set_bit_pos(struct bitvec *bv, unsigned int bitnum,
|
||||||
|
|
|
@ -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 */
|
/* 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 bytenum = bytenum_from_bitnum(bitnr);
|
||||||
unsigned int bitnum = 7 - (bitnr % 8);
|
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 */
|
/* 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;
|
unsigned int i, k = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue