From: Bborie Park Date: Fri, 29 Mar 2013 16:34:05 +0000 (+0000) Subject: Code cleanup to shut gcc up X-Git-Tag: 2.1.0beta2~133 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2f6ff216c894fd3500f48fba04d1354e3395a39b;p=postgis Code cleanup to shut gcc up git-svn-id: http://svn.osgeo.org/postgis/trunk@11223 b70326c6-7e19-0410-871a-916f4a2858ee --- diff --git a/raster/loader/raster2pgsql.c b/raster/loader/raster2pgsql.c index af3e6329f..8777fb9eb 100644 --- a/raster/loader/raster2pgsql.c +++ b/raster/loader/raster2pgsql.c @@ -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; } diff --git a/raster/rt_pg/rt_pg.c b/raster/rt_pg/rt_pg.c index 244da237c..762907546 100644 --- a/raster/rt_pg/rt_pg.c +++ b/raster/rt_pg/rt_pg.c @@ -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 - ); - } } diff --git a/raster/test/cunit/cu_band_stats.c b/raster/test/cunit/cu_band_stats.c index 3dd174891..aa5fef1cc 100644 --- a/raster/test/cunit/cu_band_stats.c +++ b/raster/test/cunit/cu_band_stats.c @@ -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); diff --git a/raster/test/cunit/cu_gdal.c b/raster/test/cunit/cu_gdal.c index 699a00414..78b1c702f 100644 --- a/raster/test/cunit/cu_gdal.c +++ b/raster/test/cunit/cu_gdal.c @@ -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); } } diff --git a/raster/test/cunit/cu_raster_geometry.c b/raster/test/cunit/cu_raster_geometry.c index c698e1416..5615a9ea9 100644 --- a/raster/test/cunit/cu_raster_geometry.c +++ b/raster/test/cunit/cu_raster_geometry.c @@ -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); } }