Skip to content

Commit 080ce82

Browse files
committed
Use bool instead of grn_bool in geo.c
Not all of geo.c has been replaced. In this commit, only some of it was replaced. groongaGH-1638
1 parent e94637e commit 080ce82

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

lib/geo.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ grn_geo_table_sort_detect_far_point(grn_ctx *ctx,
288288
geo_entry *entries,
289289
grn_pat_cursor *pc,
290290
int n,
291-
grn_bool accessorp,
291+
bool accessorp,
292292
grn_geo_point *base_point,
293293
double *d_far,
294294
uint8_t *diff_bit)
@@ -570,7 +570,7 @@ grn_geo_table_sort_collect_points(grn_ctx *ctx,
570570
geo_entry *entries,
571571
int n_entries,
572572
int n,
573-
grn_bool accessorp,
573+
bool accessorp,
574574
grn_geo_point *base_point,
575575
double d_far,
576576
uint8_t diff_bit)
@@ -671,7 +671,7 @@ grn_geo_table_sort_by_distance(grn_ctx *ctx,
671671
grn_obj *index,
672672
grn_pat *pat,
673673
grn_pat_cursor *pc,
674-
grn_bool accessorp,
674+
bool accessorp,
675675
grn_geo_point *base_point,
676676
int offset,
677677
int limit,
@@ -685,7 +685,7 @@ grn_geo_table_sort_by_distance(grn_ctx *ctx,
685685
uint8_t diff_bit;
686686
double d_far;
687687
geo_entry *ep;
688-
grn_bool need_not_indexed_records;
688+
bool need_not_indexed_records;
689689
grn_hash *indexed_records = NULL;
690690

691691
n = grn_geo_table_sort_detect_far_point(ctx,
@@ -1615,22 +1615,22 @@ in_rectangle_data_prepare(grn_ctx *ctx,
16151615
((((uint8_t *)(a))[((n_bit) / 8)] & (1 << (7 - ((n_bit) % 8)))) >> \
16161616
(1 << (7 - ((n_bit) % 8))))
16171617

1618-
static grn_bool
1618+
static bool
16191619
extract_rectangle_in_area(grn_ctx *ctx,
16201620
grn_geo_area_type area_type,
16211621
const grn_geo_point *top_left,
16221622
const grn_geo_point *bottom_right,
16231623
grn_geo_point *area_top_left,
16241624
grn_geo_point *area_bottom_right)
16251625
{
1626-
grn_bool out_of_area = GRN_FALSE;
1627-
grn_bool cover_all_areas = GRN_FALSE;
1626+
bool out_of_area = false;
1627+
bool cover_all_areas = false;
16281628

16291629
if ((GRN_GEO_POINT_IN_NORTH_WEST(top_left) &&
16301630
GRN_GEO_POINT_IN_SOUTH_EAST(bottom_right)) ||
16311631
(GRN_GEO_POINT_IN_NORTH_EAST(top_left) &&
16321632
GRN_GEO_POINT_IN_SOUTH_WEST(bottom_right))) {
1633-
cover_all_areas = GRN_TRUE;
1633+
cover_all_areas = true;
16341634
}
16351635

16361636
switch (area_type) {
@@ -1647,7 +1647,7 @@ extract_rectangle_in_area(grn_ctx *ctx,
16471647
area_bottom_right->longitude = MAX(bottom_right->longitude, 0);
16481648
}
16491649
} else {
1650-
out_of_area = GRN_TRUE;
1650+
out_of_area = true;
16511651
}
16521652
break;
16531653
case GRN_GEO_AREA_NORTH_WEST:
@@ -1663,7 +1663,7 @@ extract_rectangle_in_area(grn_ctx *ctx,
16631663
area_bottom_right->longitude = MIN(bottom_right->longitude, -1);
16641664
}
16651665
} else {
1666-
out_of_area = GRN_TRUE;
1666+
out_of_area = true;
16671667
}
16681668
break;
16691669
case GRN_GEO_AREA_SOUTH_WEST:
@@ -1679,7 +1679,7 @@ extract_rectangle_in_area(grn_ctx *ctx,
16791679
area_bottom_right->longitude = MIN(bottom_right->longitude, -1);
16801680
}
16811681
} else {
1682-
out_of_area = GRN_TRUE;
1682+
out_of_area = true;
16831683
}
16841684
break;
16851685
case GRN_GEO_AREA_SOUTH_EAST:
@@ -1695,11 +1695,11 @@ extract_rectangle_in_area(grn_ctx *ctx,
16951695
area_bottom_right->longitude = MAX(bottom_right->longitude, 0);
16961696
}
16971697
} else {
1698-
out_of_area = GRN_TRUE;
1698+
out_of_area = true;
16991699
}
17001700
break;
17011701
default:
1702-
out_of_area = GRN_TRUE;
1702+
out_of_area = true;
17031703
break;
17041704
}
17051705

@@ -1716,7 +1716,7 @@ grn_geo_cursor_area_init(grn_ctx *ctx,
17161716
grn_geo_point area_top_left, area_bottom_right;
17171717
in_rectangle_area_data data;
17181718
grn_geo_cursor_entry *entry;
1719-
grn_bool out_of_area;
1719+
bool out_of_area;
17201720

17211721
out_of_area = extract_rectangle_in_area(ctx,
17221722
area_type,

0 commit comments

Comments
 (0)