[tarantool-patches] [PATCH v1 1/1] lib/bitset: rename bitset structs

  • From: Kirill Shcherbatov <kshcherbatov@xxxxxxxxxxxxx>
  • To: tarantool-patches@xxxxxxxxxxxxx
  • Date: Tue, 3 Jul 2018 13:29:00 +0300

Fixed FreeBSD build: there were conflicting types bitset
declared in lib/bitset and _cpuset.h that is the part of
pthread_np.h used on FreeBSD.

Resolves #3046.
---
https://github.com/tarantool/tarantool/tree/kshch/gh-3046-freebsd-build
https://github.com/tarantool/tarantool/issues/3046

 src/lib/bitset/bitset.c     | 43 ++++++++++++++++++++++---------------------
 src/lib/bitset/bitset.h     | 27 ++++++++++++++-------------
 src/lib/bitset/index.c      |  4 ++--
 src/lib/bitset/index.h      |  2 +-
 src/lib/bitset/iterator.c   | 14 +++++++-------
 src/lib/bitset/iterator.h   |  6 +++---
 src/lib/bitset/page.c       | 22 +++++++++++-----------
 src/lib/bitset/page.h       | 29 +++++++++++++++--------------
 test/unit/bitset_basic.c    |  4 ++--
 test/unit/bitset_iterator.c | 24 ++++++++++++------------
 10 files changed, 89 insertions(+), 86 deletions(-)

diff --git a/src/lib/bitset/bitset.c b/src/lib/bitset/bitset.c
index ae2a033..953684b 100644
--- a/src/lib/bitset/bitset.c
+++ b/src/lib/bitset/bitset.c
@@ -37,7 +37,7 @@
 #include <assert.h>
 
 void
-bitset_create(struct bitset *bitset, void *(*realloc)(void *ptr, size_t size))
+bitset_create(struct tt_bitset *bitset, void *(*realloc)(void *ptr, size_t 
size))
 {
        memset(bitset, 0, sizeof(*bitset));
        bitset->realloc = realloc;
@@ -46,31 +46,32 @@ bitset_create(struct bitset *bitset, void *(*realloc)(void 
*ptr, size_t size))
        bitset_pages_new(&bitset->pages);
 }
 
-static struct bitset_page *
-bitset_destroy_iter_cb(bitset_pages_t *t, struct bitset_page *page, void *arg)
+static struct tt_bitset_page *
+bitset_destroy_iter_cb(bitset_pages_t *t, struct tt_bitset_page *page,
+                      void *arg)
 {
        (void) t;
-       struct bitset *bitset = (struct bitset *) arg;
+       struct tt_bitset *bitset = (struct tt_bitset *) arg;
        bitset_page_destroy(page);
        bitset->realloc(page, 0);
        return NULL;
 }
 
 void
-bitset_destroy(struct bitset *bitset)
+bitset_destroy(struct tt_bitset *bitset)
 {
        bitset_pages_iter(&bitset->pages, NULL, bitset_destroy_iter_cb, bitset);
        memset(&bitset->pages, 0, sizeof(bitset->pages));
 }
 
 bool
-bitset_test(struct bitset *bitset, size_t pos)
+bitset_test(struct tt_bitset *bitset, size_t pos)
 {
-       struct bitset_page key;
+       struct tt_bitset_page key;
        key.first_pos = bitset_page_first_pos(pos);
 
        /* Find a page in pages tree */
-       struct bitset_page *page = bitset_pages_search(&bitset->pages, &key);
+       struct tt_bitset_page *page = bitset_pages_search(&bitset->pages, &key);
        if (page == NULL)
                return false;
 
@@ -80,13 +81,13 @@ bitset_test(struct bitset *bitset, size_t pos)
 }
 
 int
-bitset_set(struct bitset *bitset, size_t pos)
+bitset_set(struct tt_bitset *bitset, size_t pos)
 {
-       struct bitset_page key;
+       struct tt_bitset_page key;
        key.first_pos = bitset_page_first_pos(pos);
 
        /* Find a page in pages tree */
-       struct bitset_page *page = bitset_pages_search(&bitset->pages, &key);
+       struct tt_bitset_page *page = bitset_pages_search(&bitset->pages, &key);
        if (page == NULL) {
                /* Allocate a new page */
                size_t size = bitset_page_alloc_size(bitset->realloc);
@@ -116,13 +117,13 @@ bitset_set(struct bitset *bitset, size_t pos)
 }
 
 int
-bitset_clear(struct bitset *bitset, size_t pos)
+bitset_clear(struct tt_bitset *bitset, size_t pos)
 {
-       struct bitset_page key;
+       struct tt_bitset_page key;
        key.first_pos = bitset_page_first_pos(pos);
 
        /* Find a page in the pages tree */
-       struct bitset_page *page = bitset_pages_search(&bitset->pages, &key);
+       struct tt_bitset_page *page = bitset_pages_search(&bitset->pages, &key);
        if (page == NULL)
                return 0;
 
@@ -150,10 +151,10 @@ bitset_clear(struct bitset *bitset, size_t pos)
 }
 
 extern inline size_t
-bitset_cardinality(const struct bitset *bitset);
+bitset_cardinality(const struct tt_bitset *bitset);
 
 void
-bitset_info(struct bitset *bitset, struct bitset_info *info)
+bitset_info(struct tt_bitset *bitset, struct tt_bitset_info *info)
 {
        memset(info, 0, sizeof(*info));
        info->page_data_size = BITSET_PAGE_DATA_SIZE;
@@ -161,7 +162,7 @@ bitset_info(struct bitset *bitset, struct bitset_info *info)
        info->page_data_alignment = BITSET_PAGE_DATA_ALIGNMENT;
 
        size_t cardinality_check = 0;
-       struct bitset_page *page = bitset_pages_first(&bitset->pages);
+       struct tt_bitset_page *page = bitset_pages_first(&bitset->pages);
        while (page != NULL) {
                info->pages++;
                cardinality_check += page->cardinality;
@@ -173,10 +174,10 @@ bitset_info(struct bitset *bitset, struct bitset_info 
*info)
 
 #if defined(DEBUG)
 void
-bitset_dump(struct bitset *bitset, int verbose, FILE *stream)
+bitset_dump(struct tt_bitset *bitset, int verbose, FILE *stream)
 {
-       struct bitset_info info;
-       bitset_info(bitset, &info);
+       struct tt_bitset_info info;
+       tt_bitset_info(bitset, &info);
 
        size_t PAGE_BIT = (info.page_data_size * CHAR_BIT);
 
@@ -225,7 +226,7 @@ bitset_dump(struct bitset *bitset, int verbose, FILE 
*stream)
 
        fprintf(stream, "    " "pages = {\n");
 
-       for (struct bitset_page *page = bitset_pages_first(&bitset->pages);
+       for (struct tt_bitset_page *page = bitset_pages_first(&bitset->pages);
             page != NULL; page = bitset_pages_next(&bitset->pages, page)) {
 
                size_t page_last_pos = page->first_pos
diff --git a/src/lib/bitset/bitset.h b/src/lib/bitset/bitset.h
index 87bcd26..d01051e 100644
--- a/src/lib/bitset/bitset.h
+++ b/src/lib/bitset/bitset.h
@@ -66,20 +66,20 @@ extern "C" {
 #endif /* defined(__cplusplus) */
 
 /** @cond false */
-struct bitset_page {
+struct tt_bitset_page {
        size_t first_pos;
-       rb_node(struct bitset_page) node;
+       rb_node(struct tt_bitset_page) node;
        size_t cardinality;
        uint8_t data[0];
 };
 
-typedef rb_tree(struct bitset_page) bitset_pages_t;
+typedef rb_tree(struct tt_bitset_page) bitset_pages_t;
 /** @endcond */
 
 /**
  * Bitset
  */
-struct bitset {
+struct tt_bitset {
        /** @cond false */
        bitset_pages_t pages;
        size_t cardinality;
@@ -93,14 +93,15 @@ struct bitset {
  * @param realloc memory allocator to use
  */
 void
-bitset_create(struct bitset *bitset, void *(*realloc)(void *ptr, size_t size));
+bitset_create(struct tt_bitset *bitset, void *(*realloc)(void *ptr,
+             size_t size));
 
 /**
  * @brief Destruct \a bitset
  * @param bitset bitset
  */
 void
-bitset_destroy(struct bitset *bitset);
+bitset_destroy(struct tt_bitset *bitset);
 
 /**
  * @brief Test bit \a pos in \a bitset
@@ -110,7 +111,7 @@ bitset_destroy(struct bitset *bitset);
  * @retval false if \a pos is not set in \a bitset
  */
 bool
-bitset_test(struct bitset *bitset, size_t pos);
+bitset_test(struct tt_bitset *bitset, size_t pos);
 
 /**
  * @brief Set bit \a pos in \a bitset
@@ -121,7 +122,7 @@ bitset_test(struct bitset *bitset, size_t pos);
  * @retval -1 on memory error
  */
 int
-bitset_set(struct bitset *bitset, size_t pos);
+bitset_set(struct tt_bitset *bitset, size_t pos);
 
 /**
  * @brief Clear bit \a pos in \a bitset
@@ -132,7 +133,7 @@ bitset_set(struct bitset *bitset, size_t pos);
  * @retval -1 on memory error
  */
 int
-bitset_clear(struct bitset *bitset, size_t pos);
+bitset_clear(struct tt_bitset *bitset, size_t pos);
 
 /**
  * @brief Return the number of bits set to \a true in \a bitset.
@@ -140,7 +141,7 @@ bitset_clear(struct bitset *bitset, size_t pos);
  * @return returns the number of bits set to \a true in \a bitset.
  */
 inline size_t
-bitset_cardinality(const struct bitset *bitset) {
+bitset_cardinality(const struct tt_bitset *bitset) {
        return bitset->cardinality;
 }
 
@@ -148,7 +149,7 @@ bitset_cardinality(const struct bitset *bitset) {
  * @brief Bitset Information structure
  * @see bitset_info
  */
-struct bitset_info {
+struct tt_bitset_info {
        /** Number of allocated pages */
        size_t pages;
        /** Data (payload) size of one page (in bytes) */
@@ -165,11 +166,11 @@ struct bitset_info {
  * @param stat structure to fill
  */
 void
-bitset_info(struct bitset *bitset, struct bitset_info *info);
+bitset_info(struct tt_bitset *bitset, struct tt_bitset_info *info);
 
 #if defined(DEBUG)
 void
-bitset_dump(struct bitset *bitset, int verbose, FILE *stream);
+bitset_dump(struct tt_bitset *bitset, int verbose, FILE *stream);
 #endif /* defined(DEBUG) */
 
 #if defined(__cplusplus)
diff --git a/src/lib/bitset/index.c b/src/lib/bitset/index.c
index 4a5bad8..dbfb0f9 100644
--- a/src/lib/bitset/index.c
+++ b/src/lib/bitset/index.c
@@ -82,7 +82,7 @@ bitset_index_reserve(struct bitset_index *index, size_t size)
                capacity *= 2;
        }
 
-       struct bitset **bitsets = index->realloc(index->bitsets,
+       struct tt_bitset **bitsets = index->realloc(index->bitsets,
                                        capacity * sizeof(*index->bitsets));
        if (bitsets == NULL)
                goto error_1;
@@ -382,7 +382,7 @@ bitset_index_bsize(const struct bitset_index *index)
        for (size_t b = 0; b < index->capacity; b++) {
                if (index->bitsets[b] == NULL)
                        continue;
-               struct bitset_info info;
+               struct tt_bitset_info info;
                bitset_info(index->bitsets[b], &info);
                result += info.page_total_size * info.pages;
        }
diff --git a/src/lib/bitset/index.h b/src/lib/bitset/index.h
index 20b3319..79aaa3c 100644
--- a/src/lib/bitset/index.h
+++ b/src/lib/bitset/index.h
@@ -126,7 +126,7 @@ extern "C" {
 struct bitset_index {
        /** @cond false **/
        /* Used bitsets */
-       struct bitset **bitsets;
+       struct tt_bitset **bitsets;
        /* Capacity of bitsets array */
        size_t capacity;
        /* Memory allocator to use */
diff --git a/src/lib/bitset/iterator.c b/src/lib/bitset/iterator.c
index 97f5ab0..6d28374 100644
--- a/src/lib/bitset/iterator.c
+++ b/src/lib/bitset/iterator.c
@@ -42,9 +42,9 @@ struct bitset_iterator_conj {
        size_t page_first_pos;
        size_t size;
        size_t capacity;
-       struct bitset **bitsets;
+       struct tt_bitset **bitsets;
        bool *pre_nots;
-       struct bitset_page **pages;
+       struct tt_bitset_page **pages;
 };
 
 /**
@@ -138,7 +138,7 @@ bitset_iterator_conj_reserve(struct bitset_iterator *it,
                capacity *= 2;
        }
 
-       struct bitset **bitsets = it->realloc(conj->bitsets,
+       struct tt_bitset **bitsets = it->realloc(conj->bitsets,
                                        capacity * sizeof(*conj->bitsets));
        if (bitsets == NULL)
                goto error_1;
@@ -146,7 +146,7 @@ bitset_iterator_conj_reserve(struct bitset_iterator *it,
                                        capacity * sizeof(*conj->pre_nots));
        if (pre_nots == NULL)
                goto error_2;
-       struct bitset_page **pages = it->realloc(conj->pages,
+       struct tt_bitset_page **pages = it->realloc(conj->pages,
                                        capacity * sizeof(*conj->pages));
        if (pages == NULL)
                goto error_3;
@@ -175,7 +175,7 @@ error_1:
 
 int
 bitset_iterator_init(struct bitset_iterator *it, struct bitset_expr *expr,
-                    struct bitset **p_bitsets, size_t bitsets_size)
+                    struct tt_bitset **p_bitsets, size_t bitsets_size)
 {
        assert(it != NULL);
        assert(expr != NULL);
@@ -243,7 +243,7 @@ bitset_iterator_conj_rewind(struct bitset_iterator_conj 
*conj, size_t pos)
                return;
        }
 
-       struct bitset_page key;
+       struct tt_bitset_page key;
        key.first_pos = pos;
 
        restart:
@@ -298,7 +298,7 @@ bitset_iterator_conj_cmp(const void *p1, const void *p2)
 
 static void
 bitset_iterator_conj_prepare_page(struct bitset_iterator_conj *conj,
-                                 struct bitset_page *dst)
+                                 struct tt_bitset_page *dst)
 {
        assert(conj != NULL);
        assert(dst != NULL);
diff --git a/src/lib/bitset/iterator.h b/src/lib/bitset/iterator.h
index 2e4f37b..86833c5 100644
--- a/src/lib/bitset/iterator.h
+++ b/src/lib/bitset/iterator.h
@@ -67,8 +67,8 @@ struct bitset_iterator {
        size_t size;
        size_t capacity;
        struct bitset_iterator_conj *conjs;
-       struct bitset_page *page;
-       struct bitset_page *page_tmp;
+       struct tt_bitset_page *page;
+       struct tt_bitset_page *page_tmp;
        void *(*realloc)(void *ptr, size_t size);
        struct bit_iterator page_it;
        /** @endcond **/
@@ -115,7 +115,7 @@ bitset_iterator_destroy(struct bitset_iterator *it);
  */
 int
 bitset_iterator_init(struct bitset_iterator *it, struct bitset_expr *expr,
-                    struct bitset **bitsets, size_t bitsets_size);
+                    struct tt_bitset **bitsets, size_t bitsets_size);
 
 /**
  * @brief Rewind the \a it to the start position.
diff --git a/src/lib/bitset/page.c b/src/lib/bitset/page.c
index ff42493..32677ab 100644
--- a/src/lib/bitset/page.c
+++ b/src/lib/bitset/page.c
@@ -36,35 +36,35 @@ extern inline size_t
 bitset_page_alloc_size(void *(*realloc_arg)(void *ptr, size_t size));
 
 extern inline void *
-bitset_page_data(struct bitset_page *page);
+bitset_page_data(struct tt_bitset_page *page);
 
 extern inline void
-bitset_page_create(struct bitset_page *page);
+bitset_page_create(struct tt_bitset_page *page);
 
 extern inline void
-bitset_page_destroy(struct bitset_page *page);
+bitset_page_destroy(struct tt_bitset_page *page);
 
 extern inline size_t
 bitset_page_first_pos(size_t pos);
 
 extern inline void
-bitset_page_set_zeros(struct bitset_page *page);
+bitset_page_set_zeros(struct tt_bitset_page *page);
 
 extern inline void
-bitset_page_set_ones(struct bitset_page *page);
+bitset_page_set_ones(struct tt_bitset_page *page);
 
 extern inline void
-bitset_page_and(struct bitset_page *dst, struct bitset_page *src);
+bitset_page_and(struct tt_bitset_page *dst, struct tt_bitset_page *src);
 
 extern inline void
-bitset_page_nand(struct bitset_page *dst, struct bitset_page *src);
+bitset_page_nand(struct tt_bitset_page *dst, struct tt_bitset_page *src);
 
 extern inline void
-bitset_page_or(struct bitset_page *dst, struct bitset_page *src);
+bitset_page_or(struct tt_bitset_page *dst, struct tt_bitset_page *src);
 
 #if defined(DEBUG)
 void
-bitset_page_dump(struct bitset_page *page, FILE *stream)
+bitset_page_dump(struct tt_bitset_page *page, FILE *stream)
 {
        fprintf(stream, "Page %zu:\n", page->first_pos);
        char *d = bitset_page_data(page);
@@ -77,7 +77,7 @@ bitset_page_dump(struct bitset_page *page, FILE *stream)
 #endif /* defined(DEBUG) */
 
 static inline int
-page_cmp(const struct bitset_page *a, const struct bitset_page *b)
+page_cmp(const struct tt_bitset_page *a, const struct tt_bitset_page *b)
 {
        if (a->first_pos < b->first_pos) {
                return -1;
@@ -88,4 +88,4 @@ page_cmp(const struct bitset_page *a, const struct 
bitset_page *b)
        }
 }
 
-rb_gen(, bitset_pages_, bitset_pages_t, struct bitset_page, node, page_cmp)
+rb_gen(, bitset_pages_, bitset_pages_t, struct tt_bitset_page, node, page_cmp)
diff --git a/src/lib/bitset/page.h b/src/lib/bitset/page.h
index b77e37f..9d50a38 100644
--- a/src/lib/bitset/page.h
+++ b/src/lib/bitset/page.h
@@ -43,7 +43,7 @@
 
 #include <stdlib.h>
 #if defined(DEBUG)
-#include <stdio.h> /* for dumping bitset_page to file */
+#include <stdio.h> /* for dumping tt_bitset_page to file */
 #endif /* defined(DEBUG) */
 #include <string.h>
 #include <limits.h>
@@ -93,28 +93,29 @@ bitset_page_alloc_size(void *(*realloc_arg)(void *ptr, 
size_t size))
 {
        if (BITSET_PAGE_DATA_ALIGNMENT <= 1 || (
                (MALLOC_ALIGNMENT % BITSET_PAGE_DATA_ALIGNMENT == 0) &&
-               (sizeof(struct bitset_page) % BITSET_PAGE_DATA_ALIGNMENT == 0) 
&&
+               (sizeof(struct tt_bitset_page) %
+                       BITSET_PAGE_DATA_ALIGNMENT == 0) &&
                (realloc_arg == realloc))) {
 
                /* Alignment is not needed */
-               return sizeof(struct bitset_page) + BITSET_PAGE_DATA_SIZE;
+               return sizeof(struct tt_bitset_page) + BITSET_PAGE_DATA_SIZE;
        }
 
-       return sizeof(struct bitset_page) + BITSET_PAGE_DATA_SIZE +
+       return sizeof(struct tt_bitset_page) + BITSET_PAGE_DATA_SIZE +
                        BITSET_PAGE_DATA_ALIGNMENT;
 }
 
 #undef MALLOC_ALIGNMENT
 
 inline void *
-bitset_page_data(struct bitset_page *page)
+bitset_page_data(struct tt_bitset_page *page)
 {
        uintptr_t r = (uintptr_t) (page->data + BITSET_PAGE_DATA_ALIGNMENT - 1);
        return (void *) (r & ~((uintptr_t) BITSET_PAGE_DATA_ALIGNMENT - 1));
 }
 
 inline void
-bitset_page_create(struct bitset_page *page)
+bitset_page_create(struct tt_bitset_page *page)
 {
        size_t size = ((char *) bitset_page_data(page) - (char *) page)
                        + BITSET_PAGE_DATA_SIZE;
@@ -122,7 +123,7 @@ bitset_page_create(struct bitset_page *page)
 }
 
 inline void
-bitset_page_destroy(struct bitset_page *page)
+bitset_page_destroy(struct tt_bitset_page *page)
 {
        (void) page;
        /* nothing */
@@ -134,21 +135,21 @@ bitset_page_first_pos(size_t pos) {
 }
 
 inline void
-bitset_page_set_zeros(struct bitset_page *page)
+bitset_page_set_zeros(struct tt_bitset_page *page)
 {
        void *data = bitset_page_data(page);
        memset(data, 0, BITSET_PAGE_DATA_SIZE);
 }
 
 inline void
-bitset_page_set_ones(struct bitset_page *page)
+bitset_page_set_ones(struct tt_bitset_page *page)
 {
        void *data = bitset_page_data(page);
        memset(data, -1, BITSET_PAGE_DATA_SIZE);
 }
 
 inline void
-bitset_page_and(struct bitset_page *dst, struct bitset_page *src)
+bitset_page_and(struct tt_bitset_page *dst, struct tt_bitset_page *src)
 {
        bitset_word_t *d = (bitset_word_t *) bitset_page_data(dst);
        bitset_word_t *s = (bitset_word_t *) bitset_page_data(src);
@@ -161,7 +162,7 @@ bitset_page_and(struct bitset_page *dst, struct bitset_page 
*src)
 }
 
 inline void
-bitset_page_nand(struct bitset_page *dst, struct bitset_page *src)
+bitset_page_nand(struct tt_bitset_page *dst, struct tt_bitset_page *src)
 {
        bitset_word_t *d = (bitset_word_t *) bitset_page_data(dst);
        bitset_word_t *s = (bitset_word_t *) bitset_page_data(src);
@@ -174,7 +175,7 @@ bitset_page_nand(struct bitset_page *dst, struct 
bitset_page *src)
 }
 
 inline void
-bitset_page_or(struct bitset_page *dst, struct bitset_page *src)
+bitset_page_or(struct tt_bitset_page *dst, struct tt_bitset_page *src)
 {
        bitset_word_t *d = (bitset_word_t *) bitset_page_data(dst);
        bitset_word_t *s = (bitset_word_t *) bitset_page_data(src);
@@ -188,10 +189,10 @@ bitset_page_or(struct bitset_page *dst, struct 
bitset_page *src)
 
 #if defined(DEBUG)
 void
-bitset_page_dump(struct bitset_page *page, FILE *stream);
+bitset_page_dump(struct tt_bitset_page *page, FILE *stream);
 #endif /* defined(DEBUG) */
 
-rb_proto(, bitset_pages_, bitset_pages_t, struct bitset_page)
+rb_proto(, bitset_pages_, bitset_pages_t, struct tt_bitset_page)
 
 
 #if defined(__cplusplus)
diff --git a/test/unit/bitset_basic.c b/test/unit/bitset_basic.c
index cbbbce4..7659a6f 100644
--- a/test/unit/bitset_basic.c
+++ b/test/unit/bitset_basic.c
@@ -11,7 +11,7 @@ void test_cardinality()
 {
        header();
 
-       struct bitset bm;
+       struct tt_bitset bm;
        bitset_create(&bm, realloc);
 
        fail_unless(bitset_cardinality(&bm) == 0);
@@ -87,7 +87,7 @@ void test_get_set()
 {
        header();
 
-       struct bitset bm;
+       struct tt_bitset bm;
        bitset_create(&bm, realloc);
 
        const size_t NUM_SIZE = (size_t) 1 << 14;
diff --git a/test/unit/bitset_iterator.c b/test/unit/bitset_iterator.c
index 5954570..52c5040 100644
--- a/test/unit/bitset_iterator.c
+++ b/test/unit/bitset_iterator.c
@@ -10,13 +10,13 @@
 enum { NUMS_SIZE = 1 << 16 };
 static size_t NUMS[NUMS_SIZE];
 
-static struct bitset **
+static struct tt_bitset **
 bitsets_create(size_t count)
 {
-       struct bitset **bitsets = malloc(count * sizeof(*bitsets));
+       struct tt_bitset **bitsets = malloc(count * sizeof(*bitsets));
        fail_if(bitsets == NULL);
        for (size_t i = 0; i < count; i++) {
-               bitsets[i] = malloc(sizeof(struct bitset));
+               bitsets[i] = malloc(sizeof(struct tt_bitset));
                fail_if(bitsets[i] == NULL);
                bitset_create(bitsets[i], realloc);
        }
@@ -25,7 +25,7 @@ bitsets_create(size_t count)
 }
 
 static void
-bitsets_destroy(struct bitset **bitsets, size_t count)
+bitsets_destroy(struct tt_bitset **bitsets, size_t count)
 {
        for (size_t i = 0; i < count; i++) {
                bitset_destroy(bitsets[i]);
@@ -127,7 +127,7 @@ void test_empty_expr_conj2(void)
        header();
 
        size_t big_i = (size_t) 1 << 15;
-       struct bitset **bitsets = bitsets_create(2);
+       struct tt_bitset **bitsets = bitsets_create(2);
        bitset_set(bitsets[0], 1);
        bitset_set(bitsets[0], big_i);
 
@@ -163,7 +163,7 @@ void test_empty_result(void)
 {
        header();
 
-       struct bitset **bitsets = bitsets_create(2);
+       struct tt_bitset **bitsets = bitsets_create(2);
 
        bitset_set(bitsets[0], 1);
        bitset_set(bitsets[0], 2);
@@ -208,7 +208,7 @@ void test_first_result(void)
 {
        header();
 
-       struct bitset **bitsets = bitsets_create(2);
+       struct tt_bitset **bitsets = bitsets_create(2);
 
        bitset_set(bitsets[0], 0);
        bitset_set(bitsets[0], 1023);
@@ -248,7 +248,7 @@ void test_simple()
 
        enum { BITSETS_SIZE = 32 };
 
-       struct bitset **bitsets = bitsets_create(BITSETS_SIZE);
+       struct tt_bitset **bitsets = bitsets_create(BITSETS_SIZE);
 
        nums_shuffle(NUMS, NUMS_SIZE);
 
@@ -294,7 +294,7 @@ void test_big() {
        header();
 
        const size_t BITSETS_SIZE = 32;
-       struct bitset **bitsets = bitsets_create(BITSETS_SIZE);
+       struct tt_bitset **bitsets = bitsets_create(BITSETS_SIZE);
 
        nums_shuffle(NUMS, NUMS_SIZE);
 
@@ -344,7 +344,7 @@ static
 void test_not_last() {
        header();
 
-       struct bitset **bitsets = bitsets_create(2);
+       struct tt_bitset **bitsets = bitsets_create(2);
 
        size_t big_i = (size_t) 1 << 15;
 
@@ -396,7 +396,7 @@ void test_not_empty() {
                CHECK_COUNT = (size_t) 1 << 14
        };
 
-       struct bitset **bitsets = bitsets_create(BITSETS_SIZE);
+       struct tt_bitset **bitsets = bitsets_create(BITSETS_SIZE);
 
        nums_shuffle(NUMS, NUMS_SIZE);
        for (size_t i = 0; i < NUMS_SIZE; i++) {
@@ -436,7 +436,7 @@ void test_disjunction()
 
        enum { BITSETS_SIZE = 32 };
 
-       struct bitset **bitsets = bitsets_create(BITSETS_SIZE);
+       struct tt_bitset **bitsets = bitsets_create(BITSETS_SIZE);
 
        nums_shuffle(NUMS, NUMS_SIZE);
 
-- 
2.7.4


Other related posts: