mirror of
https://git.osgeo.org/gitea/postgis/postgis
synced 2024-10-24 09:02:37 +00:00
Code cleanup to shut gcc up
git-svn-id: http://svn.osgeo.org/postgis/trunk@11223 b70326c6-7e19-0410-871a-916f4a2858ee
This commit is contained in:
parent
f2705864ef
commit
2f6ff216c8
|
@ -447,14 +447,14 @@ static void calc_tile_size(
|
|||
|
||||
int d = 0;
|
||||
double r = 0;
|
||||
int _d = 0;
|
||||
/*int _d = 0;*/
|
||||
double _r = -1;
|
||||
int _i = 0;
|
||||
|
||||
/* j = 0, X */
|
||||
for (j = 0; j < 2; j++) {
|
||||
_i = 0;
|
||||
_d = 0;
|
||||
/*_d = 0;*/
|
||||
_r = -1;
|
||||
|
||||
if (j < 1 && dimX <= max) {
|
||||
|
@ -483,7 +483,7 @@ static void calc_tile_size(
|
|||
(r < _r) ||
|
||||
FLT_EQ(r, _r)
|
||||
) {
|
||||
_d = d;
|
||||
/*_d = d;*/
|
||||
_r = r;
|
||||
_i = i;
|
||||
}
|
||||
|
|
|
@ -16051,7 +16051,6 @@ static int rtpg_nmapalgebraexpr_callback(
|
|||
SPITupleTable *tuptable = NULL;
|
||||
HeapTuple tuple;
|
||||
Datum datum;
|
||||
double v = 0;
|
||||
bool isnull = FALSE;
|
||||
|
||||
POSTGIS_RT_DEBUGF(4, "Running plan %d", id);
|
||||
|
@ -16072,22 +16071,17 @@ static int rtpg_nmapalgebraexpr_callback(
|
|||
/* [rast.x] */
|
||||
case 0:
|
||||
values[idx] = Int32GetDatum(arg->src_pixel[0][0] + 1);
|
||||
v = arg->src_pixel[0][0] + 1;
|
||||
break;
|
||||
/* [rast.y] */
|
||||
case 1:
|
||||
values[idx] = Int32GetDatum(arg->src_pixel[0][1] + 1);
|
||||
v = arg->src_pixel[0][1] + 1;
|
||||
v = values[idx];
|
||||
break;
|
||||
/* [rast.val] */
|
||||
case 2:
|
||||
/* [rast] */
|
||||
case 3:
|
||||
if (!arg->nodata[0][0][0]) {
|
||||
if (!arg->nodata[0][0][0])
|
||||
values[idx] = Float8GetDatum(arg->values[0][0][0]);
|
||||
v = arg->values[0][0][0];
|
||||
}
|
||||
else
|
||||
nulls[idx] = TRUE;
|
||||
break;
|
||||
|
@ -16095,21 +16089,17 @@ static int rtpg_nmapalgebraexpr_callback(
|
|||
/* [rast1.x] */
|
||||
case 4:
|
||||
values[idx] = Int32GetDatum(arg->src_pixel[0][0] + 1);
|
||||
v = arg->src_pixel[0][0] + 1;
|
||||
break;
|
||||
/* [rast1.y] */
|
||||
case 5:
|
||||
values[idx] = Int32GetDatum(arg->src_pixel[0][1] + 1);
|
||||
v = arg->src_pixel[0][1] + 1;
|
||||
break;
|
||||
/* [rast1.val] */
|
||||
case 6:
|
||||
/* [rast1] */
|
||||
case 7:
|
||||
if (!arg->nodata[0][0][0]) {
|
||||
if (!arg->nodata[0][0][0])
|
||||
values[idx] = Float8GetDatum(arg->values[0][0][0]);
|
||||
v = arg->values[0][0][0];
|
||||
}
|
||||
else
|
||||
nulls[idx] = TRUE;
|
||||
break;
|
||||
|
@ -16117,33 +16107,22 @@ static int rtpg_nmapalgebraexpr_callback(
|
|||
/* [rast2.x] */
|
||||
case 8:
|
||||
values[idx] = Int32GetDatum(arg->src_pixel[1][0] + 1);
|
||||
v = arg->src_pixel[1][0] + 1;
|
||||
break;
|
||||
/* [rast2.y] */
|
||||
case 9:
|
||||
values[idx] = Int32GetDatum(arg->src_pixel[1][1] + 1);
|
||||
v = arg->src_pixel[1][1] + 1;
|
||||
break;
|
||||
/* [rast2.val] */
|
||||
case 10:
|
||||
/* [rast2] */
|
||||
case 11:
|
||||
if (!arg->nodata[1][0][0]){
|
||||
if (!arg->nodata[1][0][0])
|
||||
values[idx] = Float8GetDatum(arg->values[1][0][0]);
|
||||
v = arg->values[1][0][0];
|
||||
}
|
||||
else
|
||||
nulls[idx] = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
POSTGIS_RT_DEBUGF(4, "(i, idx, value, null) = (%d, %d, %f, %d)",
|
||||
i,
|
||||
idx,
|
||||
v,
|
||||
nulls[idx] != TRUE ? 0 : 1
|
||||
);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@ static void test_band_stats() {
|
|||
uint32_t ymax = 100;
|
||||
uint32_t max_run;
|
||||
double nodata;
|
||||
int rtn;
|
||||
|
||||
uint32_t values[] = {0, 91, 55, 86, 76, 41, 36, 97, 25, 63, 68, 2, 78, 15, 82, 47};
|
||||
struct quantile_llist *qlls = NULL;
|
||||
|
@ -54,7 +53,7 @@ static void test_band_stats() {
|
|||
|
||||
for (x = 0; x < xmax; x++) {
|
||||
for (y = 0; y < ymax; y++) {
|
||||
rtn = rt_band_set_pixel(band, x, y, x + y, NULL);
|
||||
rt_band_set_pixel(band, x, y, x + y, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -150,7 +149,7 @@ static void test_band_stats() {
|
|||
|
||||
for (x = 0; x < xmax; x++) {
|
||||
for (y = 0; y < ymax; y++) {
|
||||
rtn = rt_band_set_pixel(band, x, y, values[(x * ymax) + y], NULL);
|
||||
rt_band_set_pixel(band, x, y, values[(x * ymax) + y], NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -183,7 +182,7 @@ static void test_band_stats() {
|
|||
|
||||
for (x = 0; x < xmax; x++) {
|
||||
for (y = 0; y < ymax; y++) {
|
||||
rtn = rt_band_set_pixel(band, x, y, (((double) x * y) + (x + y) + (x + y * x)) / (x + y + 1), NULL);
|
||||
rt_band_set_pixel(band, x, y, (((double) x * y) + (x + y) + (x + y * x)) / (x + y + 1), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -231,7 +230,7 @@ static void test_band_value_count() {
|
|||
|
||||
for (x = 0; x < xmax; x++) {
|
||||
for (y = 0; y < ymax; y++) {
|
||||
rtn = rt_band_set_pixel(band, x, y, (((double) x * y) + (x + y) + (x + y * x)) / (x + y + 1), NULL);
|
||||
rt_band_set_pixel(band, x, y, (((double) x * y) + (x + y) + (x + y * x)) / (x + y + 1), NULL);
|
||||
}
|
||||
}
|
||||
vcnts = rt_band_get_value_count(band, 1, NULL, 0, 0, NULL, &rtn);
|
||||
|
|
|
@ -412,7 +412,6 @@ static void test_raster_to_gdal() {
|
|||
uint32_t width = 100;
|
||||
uint32_t y;
|
||||
uint32_t height = 100;
|
||||
int rtn = 0;
|
||||
char srs[] = "PROJCS[\"unnamed\",GEOGCS[\"unnamed ellipse\",DATUM[\"unknown\",SPHEROID[\"unnamed\",6370997,0]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433]],PROJECTION[\"Lambert_Azimuthal_Equal_Area\"],PARAMETER[\"latitude_of_center\",45],PARAMETER[\"longitude_of_center\",-100],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"Meter\",1],AUTHORITY[\"EPSG\",\"2163\"]]";
|
||||
|
||||
uint64_t gdalSize;
|
||||
|
@ -429,7 +428,7 @@ static void test_raster_to_gdal() {
|
|||
|
||||
for (x = 0; x < width; x++) {
|
||||
for (y = 0; y < height; y++) {
|
||||
rtn = rt_band_set_pixel(band, x, y, (((double) x * y) + (x + y) + (x + y * x)) / (x + y + 1), NULL);
|
||||
rt_band_set_pixel(band, x, y, (((double) x * y) + (x + y) + (x + y * x)) / (x + y + 1), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -459,7 +458,7 @@ static void test_raster_to_gdal() {
|
|||
|
||||
for (x = 0; x < width; x++) {
|
||||
for (y = 0; y < height; y++) {
|
||||
rtn = rt_band_set_pixel(band, x, y, x, NULL);
|
||||
rt_band_set_pixel(band, x, y, x, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -502,7 +501,7 @@ static void test_gdal_to_raster() {
|
|||
for (x = 0; x < width; x++) {
|
||||
for (y = 0; y < height; y++) {
|
||||
values[x][y] = (((double) x * y) + (x + y) + (x + y * x)) / (x + y + 1);
|
||||
rtn = rt_band_set_pixel(band, x, y, values[x][y], NULL);
|
||||
rt_band_set_pixel(band, x, y, values[x][y], NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -545,7 +544,7 @@ static void test_gdal_to_raster() {
|
|||
for (x = 0; x < width; x++) {
|
||||
for (y = 0; y < height; y++) {
|
||||
values[x][y] = v++;
|
||||
rtn = rt_band_set_pixel(band, x, y, values[x][y], NULL);
|
||||
rt_band_set_pixel(band, x, y, values[x][y], NULL);
|
||||
if (v == 128)
|
||||
v = -127;
|
||||
}
|
||||
|
@ -589,7 +588,6 @@ static void test_gdal_warp() {
|
|||
uint32_t width = 100;
|
||||
uint32_t y;
|
||||
uint32_t height = 100;
|
||||
int rtn = 0;
|
||||
double value = 0;
|
||||
|
||||
char src_srs[] = "PROJCS[\"unnamed\",GEOGCS[\"unnamed ellipse\",DATUM[\"unknown\",SPHEROID[\"unnamed\",6370997,0]],PRIMEM[\"Greenwich\",0],UNIT[\"degree\",0.0174532925199433]],PROJECTION[\"Lambert_Azimuthal_Equal_Area\"],PARAMETER[\"latitude_of_center\",45],PARAMETER[\"longitude_of_center\",-100],PARAMETER[\"false_easting\",0],PARAMETER[\"false_northing\",0],UNIT[\"Meter\",1],AUTHORITY[\"EPSG\",\"2163\"]]";
|
||||
|
@ -607,7 +605,7 @@ static void test_gdal_warp() {
|
|||
|
||||
for (x = 0; x < width; x++) {
|
||||
for (y = 0; y < height; y++) {
|
||||
rtn = rt_band_set_pixel(band, x, y, (((double) x * y) + (x + y) + (x + y * x)) / (x + y + 1), NULL);
|
||||
rt_band_set_pixel(band, x, y, (((double) x * y) + (x + y) + (x + y * x)) / (x + y + 1), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -391,7 +391,6 @@ static void test_raster_pixel_as_polygon() {
|
|||
rt_raster rast;
|
||||
rt_band band;
|
||||
uint32_t x, y;
|
||||
int rtn;
|
||||
const int maxX = 10;
|
||||
const int maxY = 10;
|
||||
LWPOLY *poly = NULL;
|
||||
|
@ -404,7 +403,7 @@ static void test_raster_pixel_as_polygon() {
|
|||
|
||||
for (x = 0; x < maxX; x++) {
|
||||
for (y = 0; y < maxY; y++) {
|
||||
rtn = rt_band_set_pixel(band, x, y, 1, NULL);
|
||||
rt_band_set_pixel(band, x, y, 1, NULL);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue