Opened 7 years ago

Closed 7 years ago

#5790 closed defect (fixed)

Unused templates in gdalwarpkernel

Reported by: Kurt Schwehr Owned by: Kurt Schwehr
Priority: normal Milestone:
Component: default Version: svn-trunk
Severity: normal Keywords:
Cc:

Description

Is there a case where the these two templates are actually used?

(cd alg; /Applications/Xcode.app/Contents/Developer/usr/bin/make)
/bin/sh /Users/schwehr/src/gdal/gdal/libtool --mode=compile --tag=CXX g++ -Wall -Wextra -Werror  -I/Users/schwehr/src/gdal/gdal/port -I/Users/schwehr/src/gdal/gdal/gcore -I/Users/schwehr/src/gdal/gdal/alg -I/Users/schwehr/src/gdal/gdal/ogr -I/Users/schwehr/src/gdal/gdal/ogr/ogrsf_frmts -g -O2  -Wall  -DHAVE_SSE_AT_COMPILE_TIME -DHAVE_AVX_AT_COMPILE_TIME -DOGR_ENABLED -I/sw/include -I/Users/schwehr/src/gdal/gdal/port -I/sw/include -I/sw -I/sw/include  -DGDAL_COMPILATION  -c -o gdalwarpkernel.lo gdalwarpkernel.cpp
libtool: compile:  g++ -Wall -Wextra -Werror -I/Users/schwehr/src/gdal/gdal/port -I/Users/schwehr/src/gdal/gdal/gcore -I/Users/schwehr/src/gdal/gdal/alg -I/Users/schwehr/src/gdal/gdal/ogr -I/Users/schwehr/src/gdal/gdal/ogr/ogrsf_frmts -g -O2 -Wall -DHAVE_SSE_AT_COMPILE_TIME -DHAVE_AVX_AT_COMPILE_TIME -DOGR_ENABLED -I/sw/include -I/Users/schwehr/src/gdal/gdal/port -I/sw/include -I/sw -I/sw/include -DGDAL_COMPILATION -c gdalwarpkernel.cpp  -fno-common -DPIC -o .libs/gdalwarpkernel.o
gdalwarpkernel.cpp:1094:19: error: unused function 'GWKRoundValueT' [-Werror,-Wunused-function]
template<> double GWKRoundValueT<double>(double dfValue)
                  ^
gdalwarpkernel.cpp:1114:19: error: unused function 'GWKClampValueT' [-Werror,-Wunused-function]
template<> double GWKClampValueT<double>(double dfValue)
                  ^
2 errors generated.

Proposed change:

  • alg/gdalwarpkernel.cpp

     
    10911091                                                 (T)(dfValue + 0.5);
    10921092}
    10931093
    1094 template<> double GWKRoundValueT<double>(double dfValue)
    1095 {
    1096     return dfValue;
    1097 }
    1098 
    10991094/************************************************************************/
    11001095/*                            GWKClampValueT()                          */
    11011096/************************************************************************/
     
    11111106        return GWKRoundValueT<T>(dfValue);
    11121107}
    11131108
    1114 template<> double GWKClampValueT<double>(double dfValue)
    1115 {
    1116     return dfValue;
    1117 }
    1118 
    11191109/************************************************************************/
    11201110/*                         GWKSetPixelValueRealT()                      */
    11211111/************************************************************************/

Change History (3)

comment:1 Changed 7 years ago by Even Rouault

Not currently used, but could potentially be if other templates would specialize double. You can disable them with #ifdef notused.

comment:2 Changed 7 years ago by Kurt Schwehr

Owner: changed from warmerdam to Kurt Schwehr
Status: newassigned

r28226 in trunk

comment:3 Changed 7 years ago by Kurt Schwehr

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.