From 66e04bf4e5cdb27a44e9bea6bacad22c02df2f0d Mon Sep 17 00:00:00 2001 From: Even Rouault Date: Sun, 26 Feb 2017 00:22:03 +0100 Subject: Fix warnings related to -Wshadow -Wnull-dereference -Wfloat-conversionr -Wmissing-prototypes -Wmissing-declarations --- src/PJ_isea.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/PJ_isea.c') diff --git a/src/PJ_isea.c b/src/PJ_isea.c index ab9a5a8c..cd87d565 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; @@ -892,7 +895,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; @@ -918,8 +921,8 @@ int isea_hex(struct isea_dgg *g, int tri, return 1; - d = v.x; - i = v.y; + d = (int)v.x; + i = (int)v.y; /* Aperture 3 odd resolutions */ if (g->aperture == 3 && g->resolution % 2 != 0) { -- cgit v1.2.3