]> granicus.if.org Git - postgis/commitdiff
Quiet warnings about misuse of abs() / fabs() on
authorPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 29 Apr 2015 15:49:19 +0000 (15:49 +0000)
committerPaul Ramsey <pramsey@cleverelephant.ca>
Wed, 29 Apr 2015 15:49:19 +0000 (15:49 +0000)
wrong types (new clang in OSX 10.10)

git-svn-id: http://svn.osgeo.org/postgis/trunk@13457 b70326c6-7e19-0410-871a-916f4a2858ee

postgis/lwgeom_accum.c
postgis/lwgeom_inout.c
raster/rt_core/rt_band.c
raster/rt_core/rt_raster.c
raster/rt_core/rt_warp.c

index c615a8f34a34c14d05746506eabff9380d7228fc..6a23d8ab2a1313a327ee68a53f19ad2937d3a736 100644 (file)
@@ -424,7 +424,7 @@ pgis_twkb_accum_finalfn(PG_FUNCTION_ARGS)
                }
        
        }               
-       if  (fabs(state->precision)>7)
+       if  (abs(state->precision)>7)
                lwerror("precision cannot be more than 7");
        
        twkb = lwgeom_agg_to_twkb(&lwgeom_arrays, state->variant , &twkb_size,(int8_t) state->precision);
index 8d2b85824f626698f5d6f6c11c97a32ba3ca3167..58520f16328bf278822851259ca57b018dcf2f9e 100644 (file)
@@ -447,7 +447,7 @@ Datum TWKBFromLWGEOM(PG_FUNCTION_ARGS)
        if ( (PG_NARGS()>1) && (!PG_ARGISNULL(1)) )
        {
                prec = PG_GETARG_INT32(1);
-               if  (fabs(prec)>7)
+               if  (abs(prec)>7)
                        lwerror("precision cannot be more than 7");
        }
        else
index f18d8855c00f2f1b561d13cb2241f9be47a7ecde..70562fb55b4910f9375a02fe335cd446d76f0a76 100644 (file)
@@ -445,7 +445,7 @@ rt_band_load_offline_data(rt_band band) {
 
        VRTAddSimpleSource(
                hbandDst, GDALGetRasterBand(hdsSrc, band->data.offline.bandNum + 1),
-               abs(offset[0]), abs(offset[1]),
+               fabs(offset[0]), fabs(offset[1]),
                band->width, band->height,
                0, 0,
                band->width, band->height,
index eff0cf3f1317341f2db4791941260708e0a19ef0..90e1cbd6d6798a5df8c2ed63a66529fee260da49 100644 (file)
@@ -2631,8 +2631,8 @@ rt_raster_gdal_rasterize(
                (FLT_NEQ(*width, 0.0)) &&
                (FLT_NEQ(*height, 0.0))
        ) {
-               _dim[0] = fabs(*width);
-               _dim[1] = fabs(*height);
+               _dim[0] = abs(*width);
+               _dim[1] = abs(*height);
 
                if (FLT_NEQ(extent.MaxX, extent.MinX))
                        _scale[0] = fabs((extent.MaxX - extent.MinX) / _dim[0]);
@@ -2700,8 +2700,8 @@ rt_raster_gdal_rasterize(
                        (wkbtype == wkbLineString) ||
                        (wkbtype == wkbMultiLineString)
                ) &&
-               FLT_EQ(_dim[0], 0) &&
-               FLT_EQ(_dim[1], 0)
+               _dim[0] == 0 &&
+               _dim[1] == 0
        ) {
                int result;
                LWPOLY *epoly = NULL;
index 50fb03350227fc2b25be268059a29ea40b407feb..4544fa2cf406b7f948013204fefcbef0cbcb51f2 100644 (file)
@@ -744,8 +744,8 @@ rt_raster rt_raster_gdal_warp(
        RASTER_DEBUGF(3, "Raster dimensions (width x height): %d x %d",
                _dim[0], _dim[1]);
 
-       if (FLT_EQ(_dim[0], 0) || FLT_EQ(_dim[1], 0)) {
-               rterror("rt_raster_gdal_warp: The width (%f) or height (%f) of the warped raster is zero", _dim[0], _dim[1]);
+       if ( _dim[0] == 0 || _dim[1] == 0 ) {
+               rterror("rt_raster_gdal_warp: The width (%d) or height (%d) of the warped raster is zero", _dim[0], _dim[1]);
                _rti_warp_arg_destroy(arg);
                return NULL;
        }