Skip to content

Commit

Permalink
silenced new gcc warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ukoethe committed Nov 18, 2013
1 parent bde0aff commit e6c21f3
Show file tree
Hide file tree
Showing 31 changed files with 16 additions and 79 deletions.
2 changes: 2 additions & 0 deletions docsrc/installation.dxx
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
> make examples # build examples (optional, Linux/Unix and MinGW only)
\endcode

When you use gcc 4.8.1, make sure to change the optimization level to <tt>-O2</tt> in the cmake configuration (this is best done in the cmake GUI that you get by calling <tt>ccmake .</tt> before invoking <tt>make</tt>). The <tt>-O3</tt> level in that compiler is buggy and leads to crashes.

If you use Microsoft Visual C++, you just execute <tt>cmake</tt> (not <tt>make</tt>) or <tt>cmake-gui</tt> with the appropriate generator which creates a solution file '&lt;vigra_build_path&gt;/vigra.sln'. This file must be opened in Visual Studio, and the projects 'ALL_BUILD', 'check', 'doc', 'INSTALL', and 'examples' should be generated. <b>Important note</b>: If you include <b>"windows.h"</b> in your projects: there are some name clashes with VIGRA -- always include <b>"vigra/windows.h"</b> instead.

cmake [options] customize installation directories and guide cmake in its search for the VIGRA dependencies. On a Linux system, it is often possible to configure without any options. The most commonly used options are:
Expand Down
4 changes: 2 additions & 2 deletions include/vigra/colorconversions.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ inline ValueType sRGBCorrection(double value, double norm)
value /= norm;
typedef typename NumericTraits<ValueType>::RealPromote Promote;
return NumericTraits<ValueType>::fromRealPromote(
RequiresExplicitCast<ValueType>::cast(
RequiresExplicitCast<Promote>::cast(
(value <= 0.0031308)
? norm*12.92*value
: norm*(1.055*std::pow(value, 0.41666666666666667) - 0.055)));
Expand All @@ -88,7 +88,7 @@ inline ValueType inverse_sRGBCorrection(double value, double norm)
value /= norm;
typedef typename NumericTraits<ValueType>::RealPromote Promote;
return NumericTraits<ValueType>::fromRealPromote(
RequiresExplicitCast<ValueType>::cast(
RequiresExplicitCast<Promote>::cast(
(value <= 0.04045)
? norm*value / 12.92
: norm*VIGRA_CSTD::pow((value + 0.055)/1.055, 2.4)));
Expand Down
1 change: 0 additions & 1 deletion include/vigra/impex.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,6 @@ namespace vigra
const ImageScaler& image_scaler)
{
typedef typename ImageIterator::row_iterator ImageRowIterator;
typedef typename ImageAccessor::value_type ImageValueType;

typedef RequiresExplicitCast<ValueType> explicit_cast;

Expand Down
3 changes: 0 additions & 3 deletions include/vigra/impexalpha.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,7 @@ namespace vigra
const AlphaScaler& alpha_scaler)
{
typedef typename ImageIterator::row_iterator ImageRowIterator;
typedef typename ImageAccessor::value_type ImageValueType;

typedef typename AlphaIterator::row_iterator AlphaRowIterator;
typedef typename AlphaAccessor::value_type AlphaValueType;

typedef detail::RequiresExplicitCast<ValueType> explicit_cast;

Expand Down
12 changes: 10 additions & 2 deletions include/vigra/labelvolume.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ unsigned int labelVolume(SrcIterator s_Iter, SrcShape srcShape, SrcAccessor sa,
int j=0;
while(nc.direction() != Neighborhood3D::Error)
{
/*

SrcShape s(x,y,z), sn = s + *nc;

if (sn[0]<0 || sn[0]>=w || sn[1]<0 || sn[1]>=h || sn[2]<0 || sn[2]>=d)
Expand All @@ -280,7 +280,7 @@ unsigned int labelVolume(SrcIterator s_Iter, SrcShape srcShape, SrcAccessor sa,
atBorder << std::endl;

}
*/

// colors equal???
if(equal(sa(xs), sa(xs, *nc)))
{
Expand Down Expand Up @@ -617,6 +617,14 @@ unsigned int labelVolumeWithBackground(SrcIterator s_Iter, SrcShape srcShape, Sr
int j=0;
while(nc.direction() != Neighborhood3D::Error)
{
SrcShape s(x,y,z), sn = s + *nc;

if (sn[0]<0 || sn[0]>=w || sn[1]<0 || sn[1]>=h || sn[2]<0 || sn[2]>=d)
{
std::cerr << "coordinate error at " << s << ", offset " << *nc << ", index " << (nc).direction() << " at border " <<
atBorder << std::endl;

}
// colors equal???
if(equal(sa(xs), sa(xs, *nc)))
{
Expand Down
4 changes: 0 additions & 4 deletions include/vigra/linear_solve.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,6 @@ template <class T, class C1, class C2, class C3>
bool linearSolveUpperTriangular(const MultiArrayView<2, T, C1> &r, const MultiArrayView<2, T, C2> &b,
MultiArrayView<2, T, C3> x)
{
typedef MultiArrayShape<2>::type Shape;
MultiArrayIndex m = rowCount(r);
MultiArrayIndex rhsCount = columnCount(b);
vigra_precondition(m == columnCount(r),
Expand Down Expand Up @@ -1197,9 +1196,6 @@ bool linearSolve(MultiArrayView<2, T, C1> const & A,
MultiArrayView<2, T, C3> res,
std::string method = "QR")
{
typedef typename Matrix<T>::difference_type Shape;
typedef typename Matrix<T>::view_type SubMatrix;

const MultiArrayIndex n = columnCount(A);
const MultiArrayIndex m = rowCount(A);

Expand Down
4 changes: 0 additions & 4 deletions include/vigra/localminmax.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -1530,8 +1530,6 @@ extendedLocalMinima(SrcIterator sul, SrcIterator slr, SrcAccessor sa,
DestIterator dul, DestAccessor da,
typename DestAccessor::value_type marker)
{
typedef typename SrcAccessor::value_type SrcType;

extendedLocalMinima(sul, slr, sa, dul, da,
marker, EightNeighborCode());
}
Expand Down Expand Up @@ -1880,8 +1878,6 @@ extendedLocalMaxima(SrcIterator sul, SrcIterator slr, SrcAccessor sa,
DestIterator dul, DestAccessor da,
typename DestAccessor::value_type marker)
{
typedef typename SrcAccessor::value_type SrcType;

extendedLocalMaxima(sul, slr, sa, dul, da,
marker, EightNeighborCode());
}
Expand Down
4 changes: 0 additions & 4 deletions include/vigra/multi_convolution.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,6 @@ internalSeparableConvolveSubarray(

typedef MultiArrayNavigator<SrcIterator, N> SNavigator;
typedef MultiArrayNavigator<TmpIterator, N> TNavigator;
typedef MultiArrayNavigator<DestIterator, N> DNavigator;

TmpAcessor acc;

Expand Down Expand Up @@ -1253,8 +1252,6 @@ gaussianSmoothMultiArray( SrcIterator s, SrcShape const & shape, SrcAccessor src
const ConvolutionOptions<SrcShape::static_size> & opt,
const char *const function_name = "gaussianSmoothMultiArray" )
{
typedef typename DestAccessor::value_type DestType;

static const int N = SrcShape::static_size;

typename ConvolutionOptions<N>::ScaleIterator params = opt.scaleParams();
Expand Down Expand Up @@ -2142,7 +2139,6 @@ gaussianDivergenceMultiArray(Iterator vectorField, Iterator vectorFieldEnd,
MultiArrayView<N, T, S> divergence,
ConvolutionOptions<N> opt)
{
typedef typename MultiArrayShape<N>::type Shape;
typedef typename std::iterator_traits<Iterator>::value_type ArrayType;
typedef typename ArrayType::value_type SrcType;
typedef typename NumericTraits<SrcType>::RealPromote TmpType;
Expand Down
2 changes: 1 addition & 1 deletion include/vigra/multi_localminmax.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ localMinMax(MultiArrayView<N, T1, C1> const & src,
vigra_precondition(src.shape() == dest.shape(),
"localMinMax(): shape mismatch between input and output.");

NeighborhoodType neighborhood;
NeighborhoodType neighborhood = DirectNeighborhood;

if(options.neigh == 0 || options.neigh == 2*N)
neighborhood = DirectNeighborhood;
Expand Down
6 changes: 0 additions & 6 deletions include/vigra/multi_morphology.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,6 @@ multiGrayscaleErosion( SrcIterator s, SrcShape const & shape, SrcAccessor src,
// temporary array to hold the current line to enable in-place operation
ArrayVector<TmpType> tmp( shape[0] );

typedef MultiArrayNavigator<SrcIterator, N> SNavigator;
typedef MultiArrayNavigator<DestIterator, N> DNavigator;

int MaxDim = 0;
for( int i=0; i<N; i++)
if(MaxDim < shape[i]) MaxDim = shape[i];
Expand Down Expand Up @@ -623,9 +620,6 @@ void multiGrayscaleDilation( SrcIterator s, SrcShape const & shape, SrcAccessor

// temporary array to hold the current line to enable in-place operation
ArrayVector<TmpType> tmp( shape[0] );

typedef MultiArrayNavigator<SrcIterator, N> SNavigator;
typedef MultiArrayNavigator<DestIterator, N> DNavigator;

int MaxDim = 0;
for( int i=0; i<N; i++)
Expand Down
1 change: 0 additions & 1 deletion include/vigra/multi_resize.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ resizeMultiArraySplineInterpolation(
{
enum { N = 1 + SrcIterator::level };
typedef typename NumericTraits<typename DestAccessor::value_type>::RealPromote TmpType;
typedef MultiArray<N, TmpType> TmpArray;
typedef typename AccessorTraits<TmpType>::default_accessor TmpAccessor;

if(N==1)
Expand Down
4 changes: 0 additions & 4 deletions include/vigra/multi_watersheds.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,8 @@ unionFindWatersheds(Graph const & g,
T2Map const & lowestNeighborIndex,
T3Map & labels)
{
typedef typename Graph::Node Node;
typedef typename Graph::NodeIt graph_scanner;
typedef typename Graph::OutBackArcIt neighbor_iterator;
typedef typename T1Map::value_type DataType;
typedef typename T3Map::value_type LabelType;

vigra::detail::UnionFindArray<LabelType> regions;
Expand Down Expand Up @@ -288,8 +286,6 @@ watershedsGraph(Graph const & g,
T2Map & labels,
WatershedOptions const & options)
{
typedef typename T2Map::value_type LabelType;

if(options.method == WatershedOptions::UnionFind)
{
vigra_precondition(g.maxDegree() <= NumericTraits<unsigned short>::max(),
Expand Down
4 changes: 0 additions & 4 deletions include/vigra/noise_normalization.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -548,9 +548,6 @@ findHomogeneousRegionsFoerstner(
int w = slr.x - sul.x;
int h = slr.y - sul.y;

typedef typename NumericTraits<typename SrcAccessor::value_type>::RealPromote TmpType;
typedef BasicImage<TmpType> TmpImage;

BImage btmp(w, h);
transformImage(srcIterRange(sul, slr, src), destImage(btmp),
ifThenElse(Arg1() <= Param(homogeneityThreshold), Param(1), Param(0)));
Expand Down Expand Up @@ -1067,7 +1064,6 @@ void noiseVarianceEstimation(SrcIterator sul, SrcIterator slr, SrcAccessor src,
BackInsertable & result,
NoiseNormalizationOptions const & options = NoiseNormalizationOptions())
{
typedef typename BackInsertable::value_type ResultType;
typedef typename SrcAccessor::value_type SrcType;
typedef typename NumericTraits<SrcType>::isScalar isScalar;

Expand Down
4 changes: 0 additions & 4 deletions include/vigra/nonlineardiffusion.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,6 @@ void internalNonlinearDiffusionAOSStep(
DestIterator dul, DestAccessor ad, double timestep)
{
// use traits to determine SumType as to prevent possible overflow
typedef typename
NumericTraits<typename DestAccessor::value_type>::RealPromote
DestType;

typedef typename
NumericTraits<typename WeightAccessor::value_type>::RealPromote
WeightType;
Expand Down
2 changes: 0 additions & 2 deletions include/vigra/numpy_array.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -1198,7 +1198,6 @@ destImageRange(NumpyArray<3, Multiband<PixelType>, Stride> & img)
{
StridedImageIterator<PixelType>
ul(img.data(), 1, img.stride(0), img.stride(1));
typedef typename AccessorTraits<PixelType>::default_accessor Accessor;
return triple<StridedImageIterator<PixelType>,
StridedImageIterator<PixelType>,
MultibandVectorAccessor<PixelType> >
Expand All @@ -1224,7 +1223,6 @@ maskImage(NumpyArray<3, Multiband<PixelType>, Stride> const & img)
{
ConstStridedImageIterator<PixelType>
ul(img.data(), 1, img.stride(0), img.stride(1));
typedef typename AccessorTraits<PixelType>::default_accessor Accessor;
return pair<ConstStridedImageIterator<PixelType>, MultibandVectorAccessor<PixelType> >
(ul, MultibandVectorAccessor<PixelType>(img.shape(2), img.stride(2)));
}
Expand Down
1 change: 0 additions & 1 deletion include/vigra/polynomial.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -938,7 +938,6 @@ struct PolynomialRootCompare
template <class POLYNOMIAL, class VECTOR>
bool polynomialRoots(POLYNOMIAL const & poriginal, VECTOR & roots, bool polishRoots)
{
typedef typename POLYNOMIAL::value_type T;
typedef typename POLYNOMIAL::Real Real;
typedef typename POLYNOMIAL::Complex Complex;
typedef typename POLYNOMIAL::ComplexPolynomial WorkPolynomial;
Expand Down
1 change: 0 additions & 1 deletion include/vigra/random_forest/rf_algorithm.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,6 @@ public:
{
MultiArray<2, T> dist(distance);
std::vector<std::pair<int, int> > addr;
typedef std::pair<int, int> Entry;
int index = 0;
for(int ii = 0; ii < distance.shape(0); ++ii)
{
Expand Down
4 changes: 0 additions & 4 deletions include/vigra/random_forest/rf_common.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ class RandomForestOptions

void make_from_map(map_type & in) // -> const: .operator[] -> .find
{
typedef MultiArrayShape<2>::type Shp;
#define PULL(item_, type_) item_ = type_(in[#item_][0]);
#define PULLBOOL(item_, type_) item_ = type_(in[#item_][0] > 0);
PULL(training_set_proportion_,double);
Expand All @@ -317,7 +316,6 @@ class RandomForestOptions
}
void make_map(map_type & in) const
{
typedef MultiArrayShape<2>::type Shp;
#define PUSH(item_, type_) in[#item_] = double_array(1, double(item_));
#define PUSHFUNC(item_, type_) in[#item_] = double_array(1, double(item_!=0));
PUSH(training_set_proportion_,double);
Expand Down Expand Up @@ -764,7 +762,6 @@ public:

void make_from_map(map_type & in) // -> const: .operator[] -> .find
{
typedef MultiArrayShape<2>::type Shp;
#define PULL(item_, type_) item_ = type_(in[#item_][0]);
PULL(column_count_,int);
PULL(class_count_, int);
Expand All @@ -781,7 +778,6 @@ public:
}
void make_map(map_type & in) const
{
typedef MultiArrayShape<2>::type Shp;
#define PUSH(item_) in[#item_] = double_array(1, double(item_));
PUSH(column_count_);
PUSH(class_count_)
Expand Down
1 change: 0 additions & 1 deletion include/vigra/random_forest/rf_ridge_split.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ class RidgeSplit: public SplitBase<Tag>
{

//std::cerr << "Split called" << std::endl;
typedef typename Region::IndexIterator IndexIterator;
typedef typename MultiArrayView <2, T, C>::difference_type fShape;
typedef typename MultiArrayView <2, T2, C2>::difference_type lShape;
typedef typename MultiArrayView <2, double>::difference_type dShape;
Expand Down
2 changes: 0 additions & 2 deletions include/vigra/recursiveconvolution.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ void recursiveFilterLine(SrcIterator is, SrcIterator isend, SrcAccessor as,

typedef typename
NumericTraits<typename SrcAccessor::value_type>::RealPromote TempType;
typedef NumericTraits<typename DestAccessor::value_type> DestTraits;

// speichert den Ergebnis der linkseitigen Filterung.
std::vector<TempType> vline(w+1);
Expand Down Expand Up @@ -469,7 +468,6 @@ recursiveGaussianFilterLine(SrcIterator is, SrcIterator isend, SrcAccessor as,

typedef typename
NumericTraits<typename SrcAccessor::value_type>::RealPromote TempType;
typedef NumericTraits<typename DestAccessor::value_type> DestTraits;

// speichert das Ergebnis der linkseitigen Filterung.
std::vector<TempType> yforward(w);
Expand Down
8 changes: 0 additions & 8 deletions include/vigra/regression.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,6 @@ weightedLeastSquares(MultiArrayView<2, T, C1> const & A,
MultiArrayView<2, T, C2> const &b, MultiArrayView<2, T, C3> const &weights,
MultiArrayView<2, T, C4> &x, std::string method = "QR")
{
typedef T Real;

const unsigned int rows = rowCount(A);
const unsigned int cols = columnCount(A);
const unsigned int rhsCount = columnCount(b);
Expand Down Expand Up @@ -183,8 +181,6 @@ bool
ridgeRegression(MultiArrayView<2, T, C1> const & A,
MultiArrayView<2, T, C2> const &b, MultiArrayView<2, T, C3> &x, double lambda)
{
typedef T Real;

const unsigned int rows = rowCount(A);
const unsigned int cols = columnCount(A);
const unsigned int rhsCount = columnCount(b);
Expand Down Expand Up @@ -257,8 +253,6 @@ weightedRidgeRegression(MultiArrayView<2, T, C1> const & A,
MultiArrayView<2, T, C2> const &b, MultiArrayView<2, T, C3> const &weights,
MultiArrayView<2, T, C4> &x, double lambda)
{
typedef T Real;

const unsigned int rows = rowCount(A);
const unsigned int cols = columnCount(A);
const unsigned int rhsCount = columnCount(b);
Expand Down Expand Up @@ -310,8 +304,6 @@ bool
ridgeRegressionSeries(MultiArrayView<2, T, C1> const & A,
MultiArrayView<2, T, C2> const &b, MultiArrayView<2, T, C3> &x, Array const & lambda)
{
typedef T Real;

const unsigned int rows = rowCount(A);
const unsigned int cols = columnCount(A);
const unsigned int lambdaCount = lambda.size();
Expand Down
6 changes: 0 additions & 6 deletions include/vigra/separableconvolution.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -902,8 +902,6 @@ void convolveLine(SrcIterator is, SrcIterator iend, SrcAccessor sa,
int kleft, int kright, BorderTreatmentMode border,
int start = 0, int stop = 0)
{
typedef typename KernelAccessor::value_type KernelValue;

vigra_precondition(kleft <= 0,
"convolveLine(): kleft must be <= 0.\n");
vigra_precondition(kright >= 0,
Expand Down Expand Up @@ -1093,8 +1091,6 @@ void separableConvolveX(SrcIterator supperleft,
KernelIterator ik, KernelAccessor ka,
int kleft, int kright, BorderTreatmentMode border)
{
typedef typename KernelAccessor::value_type KernelValue;

vigra_precondition(kleft <= 0,
"separableConvolveX(): kleft must be <= 0.\n");
vigra_precondition(kright >= 0,
Expand Down Expand Up @@ -1250,8 +1246,6 @@ void separableConvolveY(SrcIterator supperleft,
KernelIterator ik, KernelAccessor ka,
int kleft, int kright, BorderTreatmentMode border)
{
typedef typename KernelAccessor::value_type KernelValue;

vigra_precondition(kleft <= 0,
"separableConvolveY(): kleft must be <= 0.\n");
vigra_precondition(kright >= 0,
Expand Down
1 change: 0 additions & 1 deletion include/vigra/singular_value_decomposition.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ singularValueDecomposition(MultiArrayView<2, T, C1> const & A,
MultiArrayView<2, T, C2> &U, MultiArrayView<2, T, C3> &S, MultiArrayView<2, T, C4> &V)
{
typedef T Real;
typedef MultiArrayShape<2>::type Shape;

const MultiArrayIndex rows = rowCount(A);
const MultiArrayIndex cols = columnCount(A);
Expand Down
5 changes: 1 addition & 4 deletions src/impex/pnm.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -742,10 +742,7 @@ namespace vigra {
void PnmEncoderImpl::write_bilevel_raw()
{
// cast the bands to the correct type
typedef void_vector< UInt8 > vector_type;
//vector_type & cbands = static_cast< vector_type & >(bands);

// XXX
vigra_fail("PNM write bilevel raw is not implemented, sorry.");
}

void PnmEncoderImpl::write_raw()
Expand Down
Loading

0 comments on commit e6c21f3

Please sign in to comment.