diff options
| author | Kurt Schwehr <schwehr@google.com> | 2018-05-12 19:37:43 -0700 |
|---|---|---|
| committer | Kurt Schwehr <schwehr@google.com> | 2018-05-12 19:37:43 -0700 |
| commit | b8296cd58aac02c93b1bc13b22c39d5cd76ec84f (patch) | |
| tree | 006afbd1713e3acf4886127e9cb129d99d5f083c | |
| parent | 86d61e185fbe8fb4cf4abf6cdaea24f3a084a68e (diff) | |
| download | PROJ-b8296cd58aac02c93b1bc13b22c39d5cd76ec84f.tar.gz PROJ-b8296cd58aac02c93b1bc13b22c39d5cd76ec84f.zip | |
ISEA_STATIC -> static
As this is a part of PROJ, having these functions possibly not static
is confusing. Time to declare this is just a part of PROJ.
| -rw-r--r-- | src/PJ_isea.c | 82 |
1 files changed, 24 insertions, 58 deletions
diff --git a/src/PJ_isea.c b/src/PJ_isea.c index 750587a3..6751a716 100644 --- a/src/PJ_isea.c +++ b/src/PJ_isea.c @@ -12,24 +12,13 @@ # define M_PI 3.14159265358979323846 #endif -/* - * Proj 4 provides its own entry points into - * the code, so none of the library functions - * need to be global - */ -#define ISEA_STATIC static -#ifndef ISEA_STATIC -#define ISEA_STATIC -#endif - struct hex { int iso; int x, y, z; }; /* y *must* be positive down as the xy /iso conversion assumes this */ -ISEA_STATIC -void hex_xy(struct hex *h) { +static void hex_xy(struct hex *h) { if (!h->iso) return; if (h->x >= 0) { h->y = -h->y - (h->x+1)/2; @@ -40,8 +29,7 @@ void hex_xy(struct hex *h) { h->iso = 0; } -ISEA_STATIC -void hex_iso(struct hex *h) { +static void hex_iso(struct hex *h) { if (h->iso) return; if (h->x >= 0) { @@ -55,8 +43,7 @@ void hex_iso(struct hex *h) { h->iso = 1; } -ISEA_STATIC -void hexbin2(double width, double x, double y, int *i, int *j) { +static void hexbin2(double width, double x, double y, int *i, int *j) { double z, rx, ry, rz; double abs_dx, abs_dy, abs_dz; int ix, iy, iz, s; @@ -102,9 +89,6 @@ void hexbin2(double width, double x, double y, int *i, int *j) { *i = h.x; *j = h.y; } -#ifndef ISEA_STATIC -#define ISEA_STATIC -#endif enum isea_poly { ISEA_NONE, ISEA_ICOSAHEDRON = 20 }; enum isea_topology { ISEA_HEXAGON=6, ISEA_TRIANGLE=3, ISEA_DIAMOND=4 }; @@ -150,7 +134,7 @@ struct snyder_constants { }; /* TODO put these in radians to avoid a later conversion */ -ISEA_STATIC const +static const struct snyder_constants constants[] = { {23.80018260, 62.15458023, 60.0, 3.75, 1.033, 0.968, 5.09, 1.195, 1.0}, {20.07675127, 55.69063953, 54.0, 2.65, 1.030, 0.983, 3.59, 1.141, 1.027}, @@ -177,8 +161,7 @@ struct snyder_constants constants[] = { #define RAD2DEG (180.0/M_PI) #define DEG2RAD (M_PI/180.0) -ISEA_STATIC -struct isea_geo vertex[] = { +static struct isea_geo vertex[] = { {0.0, DEG90}, {DEG180, V_LAT}, {-DEG108, V_LAT}, @@ -253,8 +236,7 @@ az_adjustment(int triangle) /* H = 0.25 R tan g = */ #define TABLE_H 0.1909830056 -ISEA_STATIC -struct isea_pt +static struct isea_pt isea_triangle_xy(int triangle) { struct isea_pt c; @@ -309,8 +291,7 @@ sph_azimuth(double f_lon, double f_lat, double t_lon, double t_lat) #endif /* coord needs to be in radians */ -ISEA_STATIC -int +static int isea_snyder_forward(struct isea_geo * ll, struct isea_pt * out) { int i; @@ -501,8 +482,7 @@ isea_snyder_forward(struct isea_geo * ll, struct isea_pt * out) * * TODO take a result pointer */ -ISEA_STATIC -struct isea_geo +static struct isea_geo snyder_ctran(struct isea_geo * np, struct isea_geo * pt) { struct isea_geo npt; @@ -547,8 +527,7 @@ snyder_ctran(struct isea_geo * np, struct isea_geo * pt) return npt; } -ISEA_STATIC -struct isea_geo +static struct isea_geo isea_ctran(struct isea_geo * np, struct isea_geo * pt, double lon0) { struct isea_geo npt; @@ -580,8 +559,7 @@ isea_ctran(struct isea_geo * np, struct isea_geo * pt, double lon0) /* fuller's at 5.2454 west, 2.3009 N, adjacent at 7.46658 deg */ -ISEA_STATIC -int +static int isea_grid_init(struct isea_dgg * g) { if (!g) @@ -599,8 +577,7 @@ isea_grid_init(struct isea_dgg * g) return 1; } -ISEA_STATIC -void +static void isea_orient_isea(struct isea_dgg * g) { if (!g) @@ -610,8 +587,7 @@ isea_orient_isea(struct isea_dgg * g) g->o_az = 0.0; } -ISEA_STATIC -void +static void isea_orient_pole(struct isea_dgg * g) { if (!g) @@ -621,8 +597,7 @@ isea_orient_pole(struct isea_dgg * g) g->o_az = 0; } -ISEA_STATIC -int +static int isea_transform(struct isea_dgg * g, struct isea_geo * in, struct isea_pt * out) { @@ -644,8 +619,7 @@ isea_transform(struct isea_dgg * g, struct isea_geo * in, #define DOWNTRI(tri) (((tri - 1) / 5) % 2 == 1) -ISEA_STATIC -void +static void isea_rotate(struct isea_pt * pt, double degrees) { double rad; @@ -663,8 +637,7 @@ isea_rotate(struct isea_pt * pt, double degrees) pt->y = y; } -ISEA_STATIC -int isea_tri_plane(int tri, struct isea_pt *pt, double radius) { +static int isea_tri_plane(int tri, struct isea_pt *pt, double radius) { struct isea_pt tc; /* center of triangle */ if (DOWNTRI(tri)) { @@ -680,8 +653,7 @@ int isea_tri_plane(int tri, struct isea_pt *pt, double radius) { } /* convert projected triangle coords to quad xy coords, return quad number */ -ISEA_STATIC -int +static int isea_ptdd(int tri, struct isea_pt *pt) { int downtri, quad; @@ -697,8 +669,7 @@ isea_ptdd(int tri, struct isea_pt *pt) { return quad; } -ISEA_STATIC -int +static int isea_dddi_ap3odd(struct isea_dgg *g, int quad, struct isea_pt *pt, struct isea_pt *di) { struct isea_pt v; @@ -776,8 +747,7 @@ isea_dddi_ap3odd(struct isea_dgg *g, int quad, struct isea_pt *pt, struct isea_p return quad; } -ISEA_STATIC -int +static int isea_dddi(struct isea_dgg *g, int quad, struct isea_pt *pt, struct isea_pt *di) { struct isea_pt v; double hexwidth; @@ -849,9 +819,8 @@ isea_dddi(struct isea_dgg *g, int quad, struct isea_pt *pt, struct isea_pt *di) return quad; } -ISEA_STATIC -int isea_ptdi(struct isea_dgg *g, int tri, struct isea_pt *pt, - struct isea_pt *di) { +static int isea_ptdi(struct isea_dgg *g, int tri, struct isea_pt *pt, + struct isea_pt *di) { struct isea_pt v; int quad; @@ -862,8 +831,7 @@ int isea_ptdi(struct isea_dgg *g, int tri, struct isea_pt *pt, } /* q2di to seqnum */ -ISEA_STATIC -int isea_disn(struct isea_dgg *g, int quad, struct isea_pt *di) { +static int isea_disn(struct isea_dgg *g, int quad, struct isea_pt *di) { int sidelength; int sn, height; int hexes; @@ -898,9 +866,8 @@ int isea_disn(struct isea_dgg *g, int quad, struct isea_pt *di) { * d' = d << 4 + q, d = d' >> 4, q = d' & 0xf */ /* convert a q2di to global hex coord */ -ISEA_STATIC -int isea_hex(struct isea_dgg *g, int tri, - struct isea_pt *pt, struct isea_pt *hex) { +static int isea_hex(struct isea_dgg *g, int tri, + struct isea_pt *pt, struct isea_pt *hex) { struct isea_pt v; #ifdef FIXME int sidelength; @@ -961,8 +928,7 @@ int isea_hex(struct isea_dgg *g, int tri, #endif } -ISEA_STATIC -struct isea_pt +static struct isea_pt isea_forward(struct isea_dgg *g, struct isea_geo *in) { int tri; |
