| 66 | |
| 67 | |
| 68 | static int hb_bitvec_add_bits(hb_bitvec_t *bv, int bits) |
| 69 | { |
| 70 | int ii; |
| 71 | int words_cur = (bv->size + 31) >> 5; |
| 72 | int words = (bv->size + bits + 31) >> 5; |
| 73 | if (words > words_cur) |
| 74 | { |
| 75 | uint32_t *tmp = realloc(bv->vec, words * sizeof(uint32_t)); |
| 76 | if (tmp == NULL) |
| 77 | { |
| 78 | return -1; |
| 79 | } |
| 80 | for (ii = words_cur; ii < words; ii++) |
| 81 | tmp[ii] = 0; |
| 82 | bv->vec = tmp; |
| 83 | } |
| 84 | bv->size += bits; |
| 85 | return 0; |
| 86 | } |
| 87 | |
| 88 | static hb_bitvec_t* hb_bitvec_new(int size) |
| 89 | { |
no outgoing calls
no test coverage detected