Skip to content

Commit 818e593

Browse files
committed
Suppress uninitialized-variable warnings.
My compiler doesn't like the lack of initialization of "flag", and I think it's right: if there were zero keys we'd have an undefined result. The AND of zero items is TRUE, so initialize to TRUE.
1 parent 2d02a85 commit 818e593

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/utils/adt/geo_spgist.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,8 @@ spg_box_quad_inner_consistent(PG_FUNCTION_ARGS)
515515

516516
for (quadrant = 0; quadrant < in->nNodes; quadrant++)
517517
{
518-
bool flag;
519518
RectBox *next_rect_box = nextRectBox(rect_box, centroid, quadrant);
519+
bool flag = true;
520520

521521
for (i = 0; i < in->nkeys; i++)
522522
{
@@ -609,7 +609,7 @@ spg_box_quad_leaf_consistent(PG_FUNCTION_ARGS)
609609
spgLeafConsistentIn *in = (spgLeafConsistentIn *) PG_GETARG_POINTER(0);
610610
spgLeafConsistentOut *out = (spgLeafConsistentOut *) PG_GETARG_POINTER(1);
611611
Datum leaf = in->leafDatum;
612-
bool flag;
612+
bool flag = true;
613613
int i;
614614

615615
/* All tests are exact. */

0 commit comments

Comments
 (0)