Skip to content

Commit ee9d5fc

Browse files
committed
Get rid of static declarations.
1 parent 1391d21 commit ee9d5fc

File tree

9 files changed

+261
-279
lines changed

9 files changed

+261
-279
lines changed

box.c

Lines changed: 35 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,8 @@ sbox_circle_pos(const SCIRCLE *sc, const SBOX *sb)
129129
else if (FPzero(sb->sw.lng) && FPeq(sb->ne.lng, PID))
130130
{
131131
/* full latitude range */
132-
static const SPoint tmpn = {0.0, PIH};
133-
static const SPoint tmps = {0.0, -PIH};
132+
const SPoint tmpn = {0.0, PIH};
133+
const SPoint tmps = {0.0, -PIH};
134134

135135
if (spoint_eq(&sb->ne, &tmpn)
136136
&& FPge(sc->center.lat - sc->radius, sb->sw.lat))
@@ -172,18 +172,18 @@ sbox_circle_pos(const SCIRCLE *sc, const SBOX *sb)
172172
else
173173
{
174174
bool lat_b_cont_c =
175-
((sc->center.lat + sc->radius) <= sb->ne.lat) &&
176-
((sc->center.lat - sc->radius) >= sb->sw.lat);
175+
((sc->center.lat + sc->radius) <= sb->ne.lat) &&
176+
((sc->center.lat - sc->radius) >= sb->sw.lat);
177177
bool bcc = sbox_cont_point(sb, &sc->center);
178178
bool ccb = FALSE;
179-
static int8 pw,
179+
int8 pw,
180180
pe;
181-
static SLine bw,
181+
SLine bw,
182182
be;
183183

184184
/* west and east boundary */
185-
static SPoint bc;
186-
static SPoint p1,
185+
SPoint bc;
186+
SPoint p1,
187187
p2;
188188

189189
/* center */
@@ -258,11 +258,11 @@ sbox_circle_pos(const SCIRCLE *sc, const SBOX *sb)
258258
static int8
259259
sbox_line_pos(const SLine *sl, const SBOX *sb)
260260
{
261-
static SPoint p1, p2, pbg, ped;
262-
static SPoint lc[4];
263-
static int8 pw, pe, lcn,lcs;
264-
static SLine bw, be;
265-
static float8 minlat, maxlat;
261+
SPoint p1, p2, pbg, ped;
262+
SPoint lc[4];
263+
int8 pw, pe, lcn,lcs;
264+
SLine bw, be;
265+
float8 minlat, maxlat;
266266

267267
sline_begin(&pbg, sl);
268268
sline_end(&ped, sl);
@@ -380,8 +380,8 @@ sbox_line_pos(const SLine *sl, const SBOX *sb)
380380

381381
if (pw && pe)
382382
{
383-
static SPoint sp;
384-
static int i;
383+
SPoint sp;
384+
int i;
385385

386386
for (i = 0; i < lcn; i++)
387387
{
@@ -427,13 +427,13 @@ sbox_line_pos(const SLine *sl, const SBOX *sb)
427427
static int8
428428
sbox_path_pos(const SPATH *path, const SBOX *box)
429429
{
430-
static int8 pos;
431-
static int32 i;
432-
static SLine sl;
433-
static int32 n;
434-
static const int8 sb_in = (1 << PGS_BOX_CONT_LINE);
435-
static const int8 sb_ov = (1 << PGS_BOX_LINE_OVER);
436-
static const int8 sb_os = (1 << PGS_BOX_LINE_AVOID);
430+
int8 pos;
431+
int32 i;
432+
SLine sl;
433+
int32 n;
434+
const int8 sb_in = (1 << PGS_BOX_CONT_LINE);
435+
const int8 sb_ov = (1 << PGS_BOX_LINE_OVER);
436+
const int8 sb_os = (1 << PGS_BOX_LINE_AVOID);
437437

438438
n = path->npts - 1;
439439
pos = 0;
@@ -549,14 +549,14 @@ sbox_poly_pos(const SPOLY *poly, const SBOX *box)
549549
static int8
550550
sbox_ellipse_pos(const SELLIPSE *ell, const SBOX *box)
551551
{
552-
static SCIRCLE sco,
552+
SCIRCLE sco,
553553
sci;
554-
static SPoint ec;
555-
static int8 pw,
554+
SPoint ec;
555+
int8 pw,
556556
pe,
557557
po,
558558
pi;
559-
static SLine bw,
559+
SLine bw,
560560
be;
561561

562562
if (spoint_eq(&box->sw, &box->ne))
@@ -672,11 +672,8 @@ sbox_ellipse_pos(const SELLIPSE *ell, const SBOX *box)
672672
pe = sellipse_line_pos(ell, &be);
673673

674674
/* check meridians */
675-
676-
if (
677-
pw == PGS_ELLIPSE_LINE_AVOID &&
678-
pe == PGS_ELLIPSE_LINE_AVOID
679-
)
675+
if (pw == PGS_ELLIPSE_LINE_AVOID &&
676+
pe == PGS_ELLIPSE_LINE_AVOID)
680677
{
681678
/* center is between west and east meridians */
682679
if ((FPgt(box->sw.lng, box->ne.lng)
@@ -716,7 +713,7 @@ sbox_ellipse_pos(const SELLIPSE *ell, const SBOX *box)
716713
}
717714
else
718715
{
719-
static SPoint p1, p2;
716+
SPoint p1, p2;
720717

721718
/* create east/west boundaries */
722719
p1.lat = box->sw.lat;
@@ -749,10 +746,10 @@ sbox_ellipse_pos(const SELLIPSE *ell, const SBOX *box)
749746
static int8
750747
sbox_box_pos(const SBOX *b1, const SBOX *b2, bool recheck)
751748
{
752-
static SPoint p1, p2, bc;
753-
static int8 pw, pe;
754-
static SLine bw, be;
755-
static bool scp;
749+
SPoint p1, p2, bc;
750+
int8 pw, pe;
751+
SLine bw, be;
752+
bool scp;
756753

757754
if (spoint_eq(&b2->sw, &b2->ne))
758755
{
@@ -784,9 +781,11 @@ sbox_box_pos(const SBOX *b1, const SBOX *b2, bool recheck)
784781
/* create east/west boundaries from b2 */
785782
p1.lat = b2->sw.lat;
786783
p2.lat = b2->ne.lat;
784+
787785
/* west */
788786
p1.lng = p2.lng = b2->sw.lng;
789787
sline_from_points(&bw, &p1, &p2);
788+
790789
/* east */
791790
p1.lng = p2.lng = b2->ne.lng;
792791
sline_from_points(&be, &p1, &p2);

0 commit comments

Comments
 (0)