Delete the silly bitvec _s functions
This commit is contained in:
@@ -65,14 +65,6 @@ void uc_bv_set_all(struct UCBitVec *v);
|
|||||||
* */
|
* */
|
||||||
void uc_bv_set_bits_from_array(struct UCBitVec *v,char *array,size_t array_len);
|
void uc_bv_set_bits_from_array(struct UCBitVec *v,char *array,size_t array_len);
|
||||||
|
|
||||||
// The _s ("secure") versions does boundary checking and assert() if they
|
|
||||||
// try to access a bit out of bounds.
|
|
||||||
|
|
||||||
void uc_bv_set_bit_s(struct UCBitVec *v,int b);
|
|
||||||
|
|
||||||
void uc_bv_clear_bit_s(struct UCBitVec *v,int b);
|
|
||||||
|
|
||||||
int uc_bv_get_bit_s(const struct UCBitVec *v,int b);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ void uc_bv_free(struct UCBitVec *v)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void uc_bv_clr_bit(struct UCBitVec *v,int b)
|
void uc_bv_clr_bit(struct UCBitVec *v,int b)
|
||||||
{
|
{
|
||||||
v->vec[bit_index(b)] &= ~(1UL << (bit_offset(b)));
|
v->vec[bit_index(b)] &= ~(1UL << (bit_offset(b)));
|
||||||
@@ -64,40 +63,6 @@ void uc_bv_set_bit(struct UCBitVec *v,int b)
|
|||||||
v->vec[bit_index(b)] |= 1UL << (bit_offset(b));
|
v->vec[bit_index(b)] |= 1UL << (bit_offset(b));
|
||||||
}
|
}
|
||||||
|
|
||||||
void uc_bv_set_bit_s(struct UCBitVec *v,int b)
|
|
||||||
{
|
|
||||||
size_t idx = (size_t)bit_index(b);
|
|
||||||
assert(b >= 0);
|
|
||||||
assert(v->vec_len > (size_t)idx);
|
|
||||||
|
|
||||||
if (likely(idx < v->vec_len))
|
|
||||||
v->vec[idx] |= 1UL << (bit_offset(b));
|
|
||||||
}
|
|
||||||
|
|
||||||
void uc_bv_clear_bit_s(struct UCBitVec *v,int b)
|
|
||||||
{
|
|
||||||
size_t idx = (size_t)bit_index(b);
|
|
||||||
|
|
||||||
assert(b >= 0);
|
|
||||||
assert(v->vec_len > (size_t)idx);
|
|
||||||
|
|
||||||
if (likely(idx < v->vec_len))
|
|
||||||
v->vec[idx] &= ~(1UL << (bit_offset(b)));
|
|
||||||
}
|
|
||||||
|
|
||||||
int uc_bv_get_bit_s(const struct UCBitVec *v,int b)
|
|
||||||
{
|
|
||||||
size_t idx = (size_t)bit_index(b);
|
|
||||||
|
|
||||||
assert(b >= 0);
|
|
||||||
assert(v->vec_len > (size_t)idx);
|
|
||||||
|
|
||||||
if (likely(idx < v->vec_len))
|
|
||||||
return !!(v->vec[idx] & (1UL << bit_offset(b)));
|
|
||||||
else
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void uc_bv_set_bits_from_array(struct UCBitVec *v,char *array,size_t array_len)
|
void uc_bv_set_bits_from_array(struct UCBitVec *v,char *array,size_t array_len)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
|||||||
Reference in New Issue
Block a user