]> granicus.if.org Git - postgis/commitdiff
Code cleanup to shut gcc up
authorBborie Park <bkpark at ucdavis.edu>
Fri, 29 Mar 2013 16:34:05 +0000 (16:34 +0000)
committerBborie Park <bkpark at ucdavis.edu>
Fri, 29 Mar 2013 16:34:05 +0000 (16:34 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@11223 b70326c6-7e19-0410-871a-916f4a2858ee

raster/loader/raster2pgsql.c
raster/rt_pg/rt_pg.c
raster/test/cunit/cu_band_stats.c
raster/test/cunit/cu_gdal.c
raster/test/cunit/cu_raster_geometry.c

index af3e6329f25c27fcf155b7309551ec5bfe0d8c40..8777fb9ebe16268f78de7cfc694b9395e5a1af8e 100644 (file)
@@ -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;
                        }
index 244da237c81a3e4ff1fa792271926f61400a69c0..762907546ee1d1d02c698a92cc5c075ba2585a60 100644 (file)
@@ -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
-                               );
-
                        }
                }
 
index 3dd1748919edfa0dfc9c0c83340841243d2e3afc..aa5fef1ccd8d128d429db01446ac74c0e67cdef9 100644 (file)
@@ -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);
index 699a004142a8f0c1ee667d99be4681ebc0216e5f..78b1c702f5049a04d88a580d09d6559bff7fddca 100644 (file)
@@ -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);
                }
        }
 
index c698e1416575df97239a3aa87609b2574e2eb15a..5615a9ea992ac779045add3e7c34c760ab5f1c6b 100644 (file)
@@ -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);
                }
        }