From 41bb24bb617937027b81385e39866975844e6422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Mon, 14 Oct 2013 19:01:56 +0200 Subject: [PATCH] Delete the silly bitvec _s functions --- include/ucore/bitvec.h | 8 -------- src/bitvec.c | 35 ----------------------------------- 2 files changed, 43 deletions(-) diff --git a/include/ucore/bitvec.h b/include/ucore/bitvec.h index be06f4f..5eec670 100644 --- a/include/ucore/bitvec.h +++ b/include/ucore/bitvec.h @@ -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); -// 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 } diff --git a/src/bitvec.c b/src/bitvec.c index fff5d31..abab68b 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -48,7 +48,6 @@ void uc_bv_free(struct UCBitVec *v) } } - void uc_bv_clr_bit(struct UCBitVec *v,int 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)); } -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) { size_t i;