Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b549924

Browse files
author
Bryan Henderson
committed
Quiet compiler warnings.
1 parent 17befd6 commit b549924

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

src/test/regress/regress.c

+15-13
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
/*
2-
* $Header: /cvsroot/pgsql/src/test/regress/regress.c,v 1.2 1996/11/11 16:33:12 scrappy Exp $
2+
* $Header: /cvsroot/pgsql/src/test/regress/regress.c,v 1.3 1996/11/12 11:09:13 bryanh Exp $
33
*/
44

55
#include <float.h> /* faked on sunos */
66
#include <stdio.h>
7+
#include <string.h> /* for memset() */
78

89
#include <postgres.h>
10+
#include "libpq-fe.h"
911

1012
#include "utils/geo-decls.h" /* includes <math.h> */
11-
#include "libpq-fe.h"
13+
#include "executor/executor.h" /* For GetAttributeByName */
1214

1315
#define P_MAXDIG 12
1416
#define LDELIM '('
@@ -129,21 +131,21 @@ interpt_pp(p1,p2)
129131
int i,j;
130132
LSEG seg1, seg2;
131133
LINE *ln;
134+
bool found; /* We've found the intersection */
132135

133-
for (i = 0; i < p1->npts - 1; i++)
134-
for (j = 0; j < p2->npts - 1; j++)
136+
found = false; /* Haven't found it yet */
137+
138+
for (i = 0; i < p1->npts - 1 && !found; i++)
139+
for (j = 0; j < p2->npts - 1 && !found; j++)
135140
{
136-
regress_lseg_construct(&seg1, &p1->p[i], &p1->p[i+1]);
137-
regress_lseg_construct(&seg2, &p2->p[j], &p2->p[j+1]);
138-
if (lseg_intersect(&seg1, &seg2))
139-
{
140-
ln = line_construct_pp(&seg2.p[0], &seg2.p[1]);
141-
retval = interpt_sl(&seg1, ln);
142-
goto exit;
143-
}
141+
regress_lseg_construct(&seg1, &p1->p[i], &p1->p[i+1]);
142+
regress_lseg_construct(&seg2, &p2->p[j], &p2->p[j+1]);
143+
if (lseg_intersect(&seg1, &seg2)) found = true;
144144
}
145145

146-
exit:
146+
ln = line_construct_pp(&seg2.p[0], &seg2.p[1]);
147+
retval = interpt_sl(&seg1, ln);
148+
147149
return(retval);
148150
}
149151

0 commit comments

Comments
 (0)