aboutsummaryrefslogtreecommitdiff
path: root/src/PJ_isea.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/PJ_isea.c')
-rw-r--r--src/PJ_isea.c35
1 files changed, 26 insertions, 9 deletions
diff --git a/src/PJ_isea.c b/src/PJ_isea.c
index ab9a5a8c..6bc6a66c 100644
--- a/src/PJ_isea.c
+++ b/src/PJ_isea.c
@@ -75,9 +75,12 @@ int hexbin2(double width, double x, double y,
z = -x - y;
- ix = rx = floor(x + 0.5);
- iy = ry = floor(y + 0.5);
- iz = rz = floor(z + 0.5);
+ rx = floor(x + 0.5);
+ ix = (int)rx;
+ ry = floor(y + 0.5);
+ iy = (int)ry;
+ rz = floor(z + 0.5);
+ iz = (int)rz;
s = ix + iy + iz;
@@ -126,7 +129,7 @@ struct isea_dgg {
int triangle; /* triangle of last transformed point */
int quad; /* quad of last transformed point */
unsigned long serial;
-};
+};
struct isea_pt {
double x, y;
@@ -314,6 +317,12 @@ sph_azimuth(double f_lon, double f_lat, double t_lon, double t_lat)
return az;
}
+#ifdef _MSC_VER
+#pragma warning( push )
+/* disable unreachable code warning for return 0 */
+#pragma warning( disable : 4702 )
+#endif
+
/* coord needs to be in radians */
ISEA_STATIC
int
@@ -488,6 +497,10 @@ isea_snyder_forward(struct isea_geo * ll, struct isea_pt * out)
return 0; /* suppresses a warning */
}
+#ifdef _MSC_VER
+#pragma warning( pop )
+#endif
+
/*
* return the new coordinates of any point in original coordinate system.
* Define a point (newNPold) in original coordinate system as the North Pole in
@@ -892,7 +905,7 @@ int isea_disn(struct isea_dgg *g, int quad, struct isea_pt *di) {
sn += 2;
} else {
sidelength = (int) (pow(g->aperture, g->resolution / 2.0) + 0.5);
- sn = (quad - 1) * hexes + sidelength * di->x + di->y + 2;
+ sn = (int) ((quad - 1) * hexes + sidelength * di->x + di->y + 2);
}
g->serial = sn;
@@ -908,8 +921,11 @@ ISEA_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;
- int d, i, x, y, quad;
+ int d, i, x, y;
+#endif
+ int quad;
quad = isea_ptdi(g, tri, pt, &v);
@@ -917,9 +933,9 @@ int isea_hex(struct isea_dgg *g, int tri,
hex->y = v.y;
return 1;
-
- d = v.x;
- i = v.y;
+#ifdef FIXME
+ d = (int)v.x;
+ i = (int)v.y;
/* Aperture 3 odd resolutions */
if (g->aperture == 3 && g->resolution % 2 != 0) {
@@ -961,6 +977,7 @@ int isea_hex(struct isea_dgg *g, int tri,
}
return 1;
+#endif
}
ISEA_STATIC