diff --git a/src/box/sophia_engine.cc b/src/box/sophia_engine.cc index 4731f67573eaa4099ac299b8b64b2224360f4d78..ceccefb981264ef1aab7ac566317ab633d86e664 100644 --- a/src/box/sophia_engine.cc +++ b/src/box/sophia_engine.cc @@ -486,7 +486,7 @@ SophiaEngine::keydefCheck(struct space *space, struct key_def *key_def) space_name(space), "Sophia TREE secondary indexes are not supported"); } - const int keypart_limit = 8; + const uint32_t keypart_limit = 8; if (key_def->part_count > keypart_limit) { tnt_raise(ClientError, ER_MODIFY_INDEX, key_def->name, diff --git a/src/lib/salad/bps_tree.h b/src/lib/salad/bps_tree.h index 648907e6e0f48e2db87c551dedd1d855978e8ddc..e9d3d1fb7fea7fa1d701cc92a1953a74dd74d744 100644 --- a/src/lib/salad/bps_tree.h +++ b/src/lib/salad/bps_tree.h @@ -4412,7 +4412,7 @@ bps_tree_debug_check_insert_into_leaf(struct bps_tree *tree, bool assertme) { (void) assertme; int result = 0; - const int szlim = BPS_TREE_MAX_COUNT_IN_LEAF; + const unsigned int szlim = BPS_TREE_MAX_COUNT_IN_LEAF; for (unsigned int i = 0; i < szlim; i++) { for (unsigned int j = 0; j <= i; j++) { tree->size = 0; @@ -4473,7 +4473,7 @@ bps_tree_debug_check_delete_from_leaf(struct bps_tree *tree, bool assertme) { (void) assertme; int result = 0; - const int szlim = BPS_TREE_MAX_COUNT_IN_LEAF; + const unsigned int szlim = BPS_TREE_MAX_COUNT_IN_LEAF; for (unsigned int i = 1; i <= szlim; i++) { for (unsigned int j = 0; j < i; j++) { tree->size = 1; @@ -4530,7 +4530,7 @@ bps_tree_debug_check_move_to_right_leaf(struct bps_tree *tree, bool assertme) { (void) assertme; int result = 0; - const int szlim = BPS_TREE_MAX_COUNT_IN_LEAF; + const unsigned int szlim = BPS_TREE_MAX_COUNT_IN_LEAF; for (unsigned int i = 0; i <= szlim; i++) { for (unsigned int j = 0; j <= szlim; j++) { unsigned int max_move = i < szlim - j ? i : szlim - j; @@ -4626,7 +4626,7 @@ bps_tree_debug_check_move_to_left_leaf(struct bps_tree *tree, bool assertme) { (void) assertme; int result = 0; - const int szlim = BPS_TREE_MAX_COUNT_IN_LEAF; + const unsigned int szlim = BPS_TREE_MAX_COUNT_IN_LEAF; for (unsigned int i = 0; i <= szlim; i++) { for (unsigned int j = 0; j <= szlim; j++) { unsigned int max_move = j < szlim - i ? j : szlim - i; @@ -4724,7 +4724,7 @@ bps_tree_debug_check_insert_and_move_to_right_leaf(struct bps_tree *tree, { (void) assertme; int result = 0; - const int szlim = BPS_TREE_MAX_COUNT_IN_LEAF; + const unsigned int szlim = BPS_TREE_MAX_COUNT_IN_LEAF; for (unsigned int i = 0; i <= szlim; i++) { for (unsigned int j = 0; j <= szlim; j++) { unsigned int max_move = @@ -4842,7 +4842,7 @@ bps_tree_debug_check_insert_and_move_to_left_leaf(struct bps_tree *tree, { (void) assertme; int result = 0; - const int szlim = BPS_TREE_MAX_COUNT_IN_LEAF; + const unsigned int szlim = BPS_TREE_MAX_COUNT_IN_LEAF; for (unsigned int i = 0; i <= szlim; i++) { for (unsigned int j = 0; j <= szlim; j++) { unsigned int max_move = @@ -4957,7 +4957,7 @@ bps_tree_debug_check_insert_into_inner(struct bps_tree *tree, bool assertme) { (void) assertme; int result = 0; - const int szlim = BPS_TREE_MAX_COUNT_IN_INNER; + const unsigned int szlim = BPS_TREE_MAX_COUNT_IN_INNER; for (unsigned int i = 0; i < szlim; i++) { for (unsigned int j = 0; j <= i; j++) { tree->size = 0; @@ -5027,7 +5027,7 @@ bps_tree_debug_check_delete_from_inner(struct bps_tree *tree, bool assertme) { (void) assertme; int result = 0; - const int szlim = BPS_TREE_MAX_COUNT_IN_INNER; + const unsigned int szlim = BPS_TREE_MAX_COUNT_IN_INNER; for (unsigned int i = 1; i <= szlim; i++) { for (unsigned int j = 0; j < i; j++) { struct bps_inner block; @@ -5081,7 +5081,7 @@ bps_tree_debug_check_move_to_right_inner(struct bps_tree *tree, bool assertme) { (void) assertme; int result = 0; - const int szlim = BPS_TREE_MAX_COUNT_IN_INNER; + const unsigned int szlim = BPS_TREE_MAX_COUNT_IN_INNER; for (unsigned int i = 0; i <= szlim; i++) { for (unsigned int j = 0; j <= szlim; j++) { unsigned int max_move = i < szlim - j ? i : szlim - j; @@ -5181,7 +5181,7 @@ bps_tree_debug_check_move_to_left_inner(struct bps_tree *tree, bool assertme) { (void) assertme; int result = 0; - const int szlim = BPS_TREE_MAX_COUNT_IN_INNER; + const unsigned int szlim = BPS_TREE_MAX_COUNT_IN_INNER; for (unsigned int i = 0; i <= szlim; i++) { for (unsigned int j = 0; j <= szlim; j++) { unsigned int max_move = j < szlim - i ? j : szlim - i; @@ -5282,7 +5282,7 @@ bps_tree_debug_check_insert_and_move_to_right_inner(struct bps_tree *tree, { (void) assertme; int result = 0; - const int szlim = BPS_TREE_MAX_COUNT_IN_INNER; + const unsigned int szlim = BPS_TREE_MAX_COUNT_IN_INNER; for (unsigned int i = 0; i <= szlim; i++) { for (unsigned int j = 0; j <= szlim; j++) { unsigned int max_move = @@ -5414,7 +5414,7 @@ bps_tree_debug_check_insert_and_move_to_left_inner(struct bps_tree *tree, { (void) assertme; int result = 0; - const int szlim = BPS_TREE_MAX_COUNT_IN_INNER; + const unsigned int szlim = BPS_TREE_MAX_COUNT_IN_INNER; for (unsigned int i = 0; i <= szlim; i++) { for (unsigned int j = 0; j <= szlim; j++) { unsigned int max_move = diff --git a/src/lib/salad/rtree.c b/src/lib/salad/rtree.c index d5d02cce2e3a7f288b9b6085a946972131a8eb18..28fd8d66383ccb522365ab53a69972149a269e52 100644 --- a/src/lib/salad/rtree.c +++ b/src/lib/salad/rtree.c @@ -615,7 +615,7 @@ rtree_page_insert(struct rtree *tree, struct rtree_page *page, struct rtree_page_branch br; if (--level != 0) { /* not a leaf page, minize area increase */ - unsigned mini; + unsigned mini = 0; char found = 0; area_t min_incr = 0, best_area = 0; for (unsigned i = 0; i < page->n; i++) { @@ -638,6 +638,7 @@ rtree_page_insert(struct rtree *tree, struct rtree_page *page, } } assert(found); + (void) found; struct rtree_page_branch *b; b = rtree_branch_get(tree, page, mini); struct rtree_page *p = b->data.page; diff --git a/test/unit/bps_tree.cc b/test/unit/bps_tree.cc index 1a3e96dc38cac256aeab86b0ab37ebed07854b85..1aa522dc3a9e484504a8cb0e363e4814b3be476a 100644 --- a/test/unit/bps_tree.cc +++ b/test/unit/bps_tree.cc @@ -84,12 +84,12 @@ simple_check() { header(); - const int rounds = 2000; + const unsigned int rounds = 2000; bps_tree_test tree; bps_tree_test_create(&tree, 0, extent_alloc, extent_free); printf("Insert 1..X, remove 1..X\n"); - for (int i = 0; i < rounds; i++) { + for (unsigned int i = 0; i < rounds; i++) { type_t v = i; if (bps_tree_test_find(&tree, v) != NULL) fail("element already in tree (1)", "true"); @@ -102,7 +102,7 @@ simple_check() if (bps_tree_test_size(&tree) != rounds) fail("Tree count mismatch (1)", "true"); - for (int i = 0; i < rounds; i++) { + for (unsigned int i = 0; i < rounds; i++) { type_t v = i; if (bps_tree_test_find(&tree, v) == NULL) fail("element in tree (1)", "false"); @@ -116,7 +116,7 @@ simple_check() fail("Tree count mismatch (2)", "true"); printf("Insert 1..X, remove X..1\n"); - for (int i = 0; i < rounds; i++) { + for (unsigned int i = 0; i < rounds; i++) { type_t v = i; if (bps_tree_test_find(&tree, v) != NULL) fail("element already in tree (2)", "true"); @@ -129,7 +129,7 @@ simple_check() if (bps_tree_test_size(&tree) != rounds) fail("Tree count mismatch (3)", "true"); - for (int i = 0; i < rounds; i++) { + for (unsigned int i = 0; i < rounds; i++) { type_t v = rounds - 1 - i; if (bps_tree_test_find(&tree, v) == NULL) fail("element in tree (2)", "false"); @@ -143,7 +143,7 @@ simple_check() fail("Tree count mismatch (4)", "true"); printf("Insert X..1, remove 1..X\n"); - for (int i = 0; i < rounds; i++) { + for (unsigned int i = 0; i < rounds; i++) { type_t v = rounds - 1 - i; if (bps_tree_test_find(&tree, v) != NULL) fail("element already in tree (3)", "true"); @@ -156,7 +156,7 @@ simple_check() if (bps_tree_test_size(&tree) != rounds) fail("Tree count mismatch (5)", "true"); - for (int i = 0; i < rounds; i++) { + for (unsigned int i = 0; i < rounds; i++) { type_t v = i; if (bps_tree_test_find(&tree, v) == NULL) fail("element in tree (3)", "false"); @@ -170,7 +170,7 @@ simple_check() fail("Tree count mismatch (6)", "true"); printf("Insert X..1, remove X..1\n"); - for (int i = 0; i < rounds; i++) { + for (unsigned int i = 0; i < rounds; i++) { type_t v = rounds - 1 - i; if (bps_tree_test_find(&tree, v) != NULL) fail("element already in tree (4)", "true"); @@ -183,7 +183,7 @@ simple_check() if (bps_tree_test_size(&tree) != rounds) fail("Tree count mismatch (7)", "true"); - for (int i = 0; i < rounds; i++) { + for (unsigned int i = 0; i < rounds; i++) { type_t v = rounds - 1 - i; if (bps_tree_test_find(&tree, v) == NULL) fail("element in tree (4)", "false"); diff --git a/test/unit/rtree.cc b/test/unit/rtree.cc index 11497c41713e585481c8f47212fcc566a8b68eab..6d482dc63ee95804055fd1ec1eeaf3ae44624e12 100644 --- a/test/unit/rtree.cc +++ b/test/unit/rtree.cc @@ -219,7 +219,7 @@ neighbor_test() { header(); - const int test_count = 1000; + const unsigned int test_count = 1000; struct rtree_rect arr[test_count]; static struct rtree_rect basis;