1. Rashad M
  2. OTB-Rashad

Commits

Rashad M  committed aff2d76

WRG: fixed some warnings

  • Participants
  • Parent commits 8d96a36
  • Branches default

Comments (0)

Files changed (24)

File Applications/Classification/otbFusionOfClassifications.cxx

View file
  • Ignore whitespace
     SetDocLimitations("None");
     SetDocAuthors("OTB-Team");
     SetDocSeeAlso("ImageClassifier application");
- 
+
     AddDocTag(Tags::Learning);
     AddDocTag(Tags::Analysis);
 
         std::vector<std::string> confusionMatricesFilenameList = GetParameterStringList("method.dempstershafer.cmfl");
 
         MassOfBeliefDefinitionMethod massOfBeliefDefMethod;
+        //setting default to supress warning
+        massOfBeliefDefMethod = ConfusionMatrixToMassOfBeliefType::PRECISION;
         switch (GetParameterInt("method.dempstershafer.mob"))
           {
           case Mode_MOB_Precision:
 
       }
   }
-  
+
   std::vector<itk::LightObject::Pointer> m_Filters;
 };
 

File Applications/ContrastEnhancement/otbColorHistogramEqualize.cxx

View file
  • Ignore whitespace
     index[1] = GetParameterInt("green");
     index[2] = GetParameterInt("blue");
 
-    int delta;
+    int delta = 128;
     if (type == "uint8")
       delta = 128;
     else if(type == "uint16")

File Applications/ContrastEnhancement/otbColorSpaceTransform.cxx

View file
  • Ignore whitespace
     index[1] = GetParameterInt("green");
     index[2] = GetParameterInt("blue");
 
-    int delta;
+    int delta = 128;
     if (type == "uint8")
       delta = 128;
     else if(type == "uint16")

File Applications/DisparityMap/otbStereoFramework.cxx

View file
  • Ignore whitespace
   typedef Application                         Superclass;
   typedef itk::SmartPointer<Self>             Pointer;
   typedef itk::SmartPointer<const Self>       ConstPointer;
-  
+
   /** Standard macro */
   itkNewMacro(Self);
 
   itkTypeMacro(StereoFramework, otb::Application);
-  
+
   /** Filters typedefs */
   typedef FloatImageType::PixelType           FloatPixelType;
-  
+
   typedef otb::StereorectificationDeformationFieldSource
     <FloatImageType,FloatVectorImageType>     DeformationFieldSourceType;
-  
+
   typedef itk::Vector<double,2>               DeformationType;
   typedef otb::Image<DeformationType>         DeformationFieldType;
 
   typedef otb::InverseDeformationFieldImageFilter
    <DeformationFieldType,DeformationFieldType> InverseDeformationFieldFilterType;
 
-  
+
 
   typedef otb::StreamingWarpImageFilter
     <FloatImageType,
 
   typedef otb::BCOInterpolateImageFunction
     <FloatImageType>                          InterpolatorType;
-  
+
    typedef otb::Functor::SSDBlockMatching<FloatImageType,FloatImageType> SSDBlockMatchingFunctorType;
    typedef otb::Functor::SSDDivMeanBlockMatching<FloatImageType,FloatImageType> SSDDivMeanBlockMatchingFunctorType;
 
      FloatImageType,
      DeformationFieldType,
      FloatImageType>                          DisparityToElevationFilterType;
-  
+
   typedef otb::DEMToImageGenerator
     <FloatImageType>                          DEMToImageGeneratorType;
-  
+
   typedef otb::StreamingMinMaxImageFilter
     <FloatImageType>                          MinMaxFilterType;
-  
+
   typedef otb::StreamingStatisticsImageFilter
     <FloatImageType>                          StatisticsFilterType;
-   
+
   typedef otb::ExtractROI
     <FloatPixelType,FloatPixelType>           ExtractFilterType;
-  
+
   typedef otb::ImageList<FloatImageType>      ImageListType;
-  
+
   typedef otb::ImageListToVectorImageFilter
     <ImageListType,
      FloatVectorImageType>                    ImageListToVectorImageFilterType;
-  
+
   typedef otb::ImageFileReader
     <FloatVectorImageType>                    ReaderType;
-  
+
   typedef otb::ImageFileWriter
     <FloatVectorImageType>                    WriterType;
-  
+
   typedef otb::VectorImageToImageListFilter
     <FloatVectorImageType,
      ImageListType>                           VectorImageToListFilterType;
-  
+
   typedef MultiToMonoChannelExtractROI<FloatVectorImageType::InternalPixelType,
                                          FloatImageType::PixelType>               ExtractROIFilterType;
 
 
     typedef itk::ImageToImageFilter<FloatImageType,FloatImageType>  FilterType;
 private:
-  
+
   StereoFramework()
     {
 
      m_Interpolator = InterpolatorType::New();
      m_Multi3DMapToDEMFilter =  Multi3DFilterType::New();
     }
-  
+
   std::vector<std::vector<int> > CreateCouplesList(string couples)
     {
     std::vector<std::vector<int> > couplesList;
     SetMinimumParameterIntValue("input.channel", 1);
 
     ElevationParametersHandler::AddElevationParameters(this, "elev");
-    
+
     // Add the output paramters in a group
     AddParameter(ParameterType_Group, "output", "Output parameters");
     SetParameterDescription("output","This group of parameters allows to choose the DSM resolution, nodata value, and projection parameters.");
 
     AddChoice("bm.metric.ssdmean","Sum of Squared Distances divided by mean of block");
     SetParameterDescription("bm.metric.ssdmean","derived version of Sum of Squared Distances between pixels value in the metric window (SSD divided by mean over window)");
-    
+
     AddChoice("bm.metric.ssd","Sum of Squared Distances");
     SetParameterDescription("bm.metric.ssd","Sum of squared distances between pixels value in the metric window");
 
     DisableParameter("postproc.metrict");
 
     AddParameter(ParameterType_Group,"mask","Masks");
-    
+
     AddParameter(ParameterType_InputImage, "mask.left","Input left mask");
     SetParameterDescription("mask.left","Mask for left input image");
     MandatoryOff("mask.left");
     DisableParameter("mask.left");
-    
+
     AddParameter(ParameterType_InputImage, "mask.right","Input right mask");
     SetParameterDescription("mask.right","Mask for right input image");
     MandatoryOff("mask.right");
     DisableParameter("mask.right");
-    
+
     AddParameter(ParameterType_Float,"mask.variancet","Discard pixels with low local variance");
     SetParameterDescription("mask.variancet","This parameter allows to discard pixels whose local variance is too small (the size of the neighborhood is given by the radius parameter)");
     MandatoryOff("mask.variancet");
     SetDefaultParameterFloat("mask.variancet",50.);
     //DisableParameter("mask.variancet");
-    
+
     AddRAMParameter();
-    
+
 
     SetDocExampleParameterValue("input.il","sensor_stereo_left.tif sensor_stereo_right.tif");
     SetDocExampleParameterValue("elev.default","200");
     SetDocExampleParameterValue("output.res","2.5");
     SetDocExampleParameterValue("output.out","dem.tif");
 
-    
+
   }
-  
+
   void DoUpdateParameters()
   {
     if( HasValue("input.il") )
       {
       // Get the input image list
       FloatVectorImageListType::Pointer inList = this->GetParameterImageList("input.il");
-    
+
       // Set channel interval
       SetMaximumParameterIntValue("input.channel", inList->GetNthElement(0)->GetNumberOfComponentsPerPixel());
       }
   }
-  
+
 
   template<class TInputImage, class TMetricFunctor>
     void
         }
 
       // Compute disparities
-      FilterType* blockMatcherFilterPointer;
+      FilterType* blockMatcherFilterPointer = NULL;
       FilterType* invBlockMatcherFilterPointer = NULL;
-      FilterType* subPixelFilterPointer;
+      FilterType* subPixelFilterPointer = NULL;
       BijectionFilterType::Pointer bijectFilter;
 
       // pointer
             finalMaskFilter->GetOutput(),
             minimize, minDisp, maxDisp);
           break;
-        
-        
+
+
         case 3: //LP
           otbAppLogINFO(<<"Using Lp Metric for BlockMatching.");
 
         }
 
 
-      FloatImageType::Pointer hDispOutput = subPixelFilterPointer->GetOutput(0);
+     FloatImageType::Pointer hDispOutput = subPixelFilterPointer->GetOutput(0);
       FloatImageType::Pointer finalMaskImage=finalMaskFilter->GetOutput();
       if (IsParameterEnabled("postproc.med"))
         {
     SetParameterOutputImage("output.out", m_Multi3DMapToDEMFilter->GetOutput());
 
   }
-  
+
   // private filters
   std::vector<itk::LightObject::Pointer> m_Filters;
 
   InterpolatorType::Pointer m_Interpolator;
-  
+
   MultiDisparityTo3DFilterListType  m_MultiDisparityTo3DFilterList;
   Multi3DFilterType::Pointer        m_Multi3DMapToDEMFilter;
 

File Applications/Projections/otbRefineSensorModel.cxx

View file
  • Ignore whitespace
   typedef std::vector<TiePointType>            TiePointsType;
 
   typedef otb::GenericRSTransform<double,3,3>  RSTransformType;
-  
+
   /** Standard macro */
   itkNewMacro(Self);
   itkTypeMacro(RefineSensorModel, otb::Application);
   {
     SetName("RefineSensorModel");
     SetDescription("Perform least-square fit of a sensor model to a set of tie points");
-    
+
     SetDocName("Refine Sensor Model");
     SetDocLongDescription("This application reads a geom file containing a sensor model and a text file containing a list of ground control point, and performs a least-square fit of the sensor model adjustable parameters to these tie points. It produces an updated geom file as output, as well as an optional ground control points based statistics file and a vector file containing residues. The output geom file can then be used to ortho-rectify the data more accurately. Plaease note that for a proper use of the application, elevation must be correctly set (including DEM and geoid file). The map parameters allows to choose a map projection in which the accuracy will be estimated in meters.");
 
     SetDocLimitations("None");
     SetDocSeeAlso("OrthoRectification,HomologousPointsExtraction");
     SetDocAuthors("OTB-Team");
-    
+
     AddParameter(ParameterType_InputFilename,"ingeom","Input geom file");
     SetParameterDescription("ingeom","Geom file containing the sensor model to refine");
 
 
     otb::SensorModelAdapter::Pointer sm     = otb::SensorModelAdapter::New();
     otb::SensorModelAdapter::Pointer sm_ref = otb::SensorModelAdapter::New();
-    
+
     // Read the geom file
     sm->ReadGeomFile(GetParameterString("ingeom"));
     sm_ref->ReadGeomFile(GetParameterString("ingeom"));
     // Parse the input file for ground control points
     std::ifstream ifs;
     ifs.open(GetParameterString("inpoints").c_str());
-   
+
   TiePointsType tiepoints;
 
   while(!ifs.eof())
     {
     std::string line;
     std::getline(ifs,line);
-    
+
     double x,y,z,lat,lon;
-    
+
     // Avoid commented lines or too short ones
     if (!line.empty() && line[0] != '#')
       {
       pos = nextpos + 1;
       nextpos = line.find_first_of("\t", pos);
       lat = atof(line.substr(pos, nextpos).c_str());
-      
+
       z = otb::DEMHandler::Instance()->GetHeightAboveEllipsoid(lon,lat);
 
       otbAppLogINFO("Adding tie point x="<<x<<", y="<<y<<", z="<<z<<", lon="<<lon<<", lat="<<lat);
-      
+
       sm->AddTiePoint(x,y,z,lon,lat);
 
       PointType p1,p2;
       }
     }
   ifs.close();
-  
+
   otbAppLogINFO("Optimization in progress ...");
   sm->Optimize();
   otbAppLogINFO("Done.\n");
 
-  bool canWrite = sm->WriteGeomFile(GetParameterString("outgeom"));
+//  bool canWrite = sm->WriteGeomFile(GetParameterString("outgeom"));
 
   double rmse = 0;
   double rmsex = 0;
     double gerror = distance->Evaluate(ref,tmpPoint);
     double xerror = ref[0]-tmpPoint[0];
     double yerror = ref[1]-tmpPoint[1];
-    
+
     double gerror_ref = distance->Evaluate(ref,tmpPoint_ref);
     double xerror_ref = ref[0]-tmpPoint_ref[0];
     double yerror_ref = ref[1]-tmpPoint_ref[1];
   // Create the datasource (for matches export)
   otb::ogr::Layer layer(NULL, false);
   otb::ogr::DataSource::Pointer ogrDS;
-  
+
   ogrDS = otb::ogr::DataSource::New(GetParameterString("outvector"), otb::ogr::DataSource::Modes::Overwrite);
   std::string projref = MapProjectionParametersHandler::GetProjectionRefFromChoice(this, "map");
   OGRSpatialReference oSRS(projref.c_str());
-  
+
   // and create the layer
   layer = ogrDS->CreateLayer("matches", &oSRS, wkbMultiLineString);
   OGRFeatureDefn & defn = layer.GetLayerDefn();
   ogr::Feature feature(defn);
-  
+
   feature.SetGeometry(&mls);
   layer.CreateFeature(feature);
   }

File Code/ApplicationEngine/otbWrapperApplication.h

View file
  • Ignore whitespace
 #include "otbMacro.h"
 #include "itkObject.h"
 #include "itkObjectFactory.h"
-
 #include "otbWrapperTypes.h"
 #include "otbWrapperTags.h"
 #include "otbWrapperParameterGroup.h"

File Code/BasicFilters/otbClampImageFilter.txx

View file
  • Ignore whitespace
 {
   m_Lower = itk::NumericTraits<OutputImagePixelType>::NonpositiveMin();
   m_Upper = itk::NumericTraits<OutputImagePixelType>::max();
-  
+
   m_DLower = static_cast<double>(m_Lower);
   m_DUpper = static_cast<double>(m_Upper);
 }
     itkExceptionMacro(<<"Lower threshold cannot be greater than upper threshold.");
     return;
     }
-  
+
   if (m_Lower != lower || m_Upper != upper)
     {
     m_Lower = lower;
 
   // support progress methods/callbacks
   itk::ProgressReporter progress(this, threadId, outputRegionForThread.GetNumberOfPixels());
-          
+
   // walk the regions, threshold each pixel
   while( !outIt.IsAtEnd() && !inIt.IsAtEnd()  )
     {
     // with the double version of the upper and the lower bounds of
     // output image
     const double value = static_cast<double>(inIt.Get());
-    OutputImagePixelType      outPix;
+    OutputImagePixelType      outPix = m_Lower;
 
     if ( m_DLower <= value && value <= m_DUpper)
       {
       // pixel passes to output unchanged
       outPix = static_cast<OutputImagePixelType>(value);
       }
+    /* Already outPix is initialized with m_Lower even for preventing Warning.
+     *
     else if ( value < m_DLower )
       {
       outPix = m_Lower;
       }
+     */
     else if ( value > m_DUpper)
       {
       outPix = m_Upper;

File Code/BasicFilters/otbLabelImageRegionPruningFilter.txx

View file
  • Ignore whitespace
         m_PointCounts[label] = newPointCounts[canLabel];
         }
       }
-
+    /* -Wunused-variable
     unsigned int oldRegionCount = regionCount;
+    */
     regionCount = label;
 
     /* reassign labels in label image */

File Code/BasicFilters/otbTileImageFilter.txx

View file
  • Ignore whitespace
 {
   // First, call superclass implementation
   Superclass::GenerateOutputInformation();
-  
+
   // Get the number of images
   unsigned int numberOfImages = m_Layout[0] * m_Layout[1];
-  
+
   // Check we have enough inputs
   if(numberOfImages != this->GetNumberOfInputs())
     {
       // First, get current tile
       const ImageType * currentTile = this->GetInput(col + row * m_Layout[0]);
       typename ImageType::SizeType currentSize = currentTile->GetLargestPossibleRegion().GetSize();
-      
+
       // Retrieve row and column sizes
       if(col == 0)
         {
         {
         m_ColumnsSizes.push_back(currentSize[0]);
         }
-      
+
       // Check for consistent layout
       if(currentSize[1] != m_RowsSizes[row]
          || currentSize[0] != m_ColumnsSizes[col])
     {
     totalSize[1]+=m_RowsSizes[i];
     }
-  
+
   // Fill out output image settings
   typename ImageType::RegionType outRegion;
   outRegion.SetSize(totalSize);
 
   //std::cout<<"Output largest region: "<<outRegion<<std::endl;
-  
+
   ImageType * outputPtr = this->GetOutput();
-  
+
   // Copy information from first tile
   outputPtr->CopyInformation(this->GetInput());
- 
+
   // Set region
   outputPtr->SetLargestPossibleRegion(outRegion);
 }
   for(unsigned int i = 0; i < numberOfImages; ++i)
     {
     ImageType * inputTile = const_cast<ImageType *>(this->GetInput(i));
-    
+
     RegionType inRegion = OutputRegionToInputRegion(i,outRegion);
 
     //std::cout<<"In region: "<<i<<", "<<inRegion<<std::endl;
   for(unsigned int i = 0; i < numberOfImages; ++i)
     {
     const ImageType * inputTile = this->GetInput(i);
-  
+
     RegionType inRegion = OutputRegionToInputRegion(i,outputRegionForThread);
     RegionType outRegion = InputRegionToOutputRegion(i,inRegion);
 
 
   RegionType out2inRegion = requestedRegion;
   typename RegionType::IndexType regionIndex = out2inRegion.GetIndex();
-  
+
   // Compute tile offsets
   for(unsigned int i = 0; i < tileXIndex; ++i)
     {
     regionIndex[0]-=m_ColumnsSizes.at(i);
     }
 
-  unsigned int tileYOffset = 0;
   for(unsigned int i = 0; i < tileYIndex; ++i)
     {
     regionIndex[1]-=m_RowsSizes.at(i);
 ::InputRegionToOutputRegion(unsigned int tileIndex, const RegionType & requestedRegion)
 {
   // Retrieve the nth tile pointer
-  const ImageType * tile = this->GetInput(tileIndex);
+//  const ImageType * tile = this->GetInput(tileIndex);
 
   unsigned int tileYIndex = tileIndex / m_Layout[0];
   unsigned int tileXIndex = tileIndex % m_Layout[0];
 
   RegionType out2inRegion = requestedRegion;
   typename RegionType::IndexType regionIndex = out2inRegion.GetIndex();
-  
+
 
   // Compute tile offsets
   for(unsigned int i = 0; i < tileXIndex; ++i)

File Code/Common/otbMath.h

View file
  • Ignore whitespace
 const long double CONST_2PIl =      6.2831853071795864769252867665590058L;  /* 2*pi */
 const long double CONST_PI_180l =   0.0174532925199432957692369076848861L;  /* pi/180 */
 const long double CONST_180_PIl =   57.295779513082320876798154814105170L;  /* 180/pi */
-const long double CONST_LNPIl =     std::log(CONST_PIl);                    /* ln(pi)*/
-const long double CONST_SQRTPIl =   std::sqrt(CONST_PIl);                   /* sqrt(pi)*/
+//-Wunused const long double CONST_LNPIl =     std::log(CONST_PIl);                    /* ln(pi)*/
+//-Wunused const long double CONST_SQRTPIl =   std::sqrt(CONST_PIl);                   /* sqrt(pi)*/
 const long double CONST_SQRT2l =    1.4142135623730950488016887242096981L;  /* sqrt(2) */
 const long double CONST_SQRT1_2l =  0.7071067811865475244008443621048490L;  /* 1/sqrt(2) */
 const long double CONST_SQRT3l =    1.7320508075688772935274463415058724L;  /* sqrt(3) */

File Code/ContrastEnhancement/otbGlobalHistogramEqualizationFilter.txx

View file
  • Ignore whitespace
   m_LookupArray.Fill(0);
 
   CumulativeArray[0] = static_cast<unsigned int>(m_Histogram->GetFrequency(0));
-  for( int i = 1;  i < histoSize; i++ )
+  for( unsigned int i = 1;  i < histoSize; i++ )
     {
     CumulativeArray[i] = m_Histogram->GetFrequency(i)+ CumulativeArray[i-1];
     }

File Code/DisparityMap/otbMulti3DMapToDEMFilter.txx

View file
  • Ignore whitespace
             }
 
           //test if position is in DEM BBOX
+          /**    -Wunused-variable
           bool isInDEM = (position[0] >= minLong) && (position[0] < maxLong) && (position[1] >= minLat) && (position[1]
-              < maxLat);
-
+                      < maxLat);
+          **/
           // Is point inside DEM area ?
           typename OutputImageType::PointType point2D;
           point2D[0] = position[0];
           cellIndex[1] = static_cast<int> (vcl_floor(continuousIndex[1]));
           //std::cout<<"cellindex "<<cellIndex<<std::endl;
           //index from physical
-          typename OutputImageType::IndexType physCellIndex;
+          /** -Wunused-variable
+            typename OutputImageType::IndexType physCellIndex;
+
           //double CellIndexLong=(position[0]-outOrigin[0])/step[0];
           //double CellIndexLat=(position[1]-outOrigin[1])/step[1];
           typename OutputImageType::IndexType cellIndex2;
-
+          **/
           if (outputRequestedRegion.IsInside(cellIndex))
             {
             //std::cout<<"is inside "<<std::endl;

File Code/DisparityMap/otbStereorectificationDeformationFieldSource.txx

View file
  • Ignore whitespace
   double mean_spacing=0.5*(vcl_abs(m_LeftImage->GetSpacing()[0])+vcl_abs(m_LeftImage->GetSpacing()[1]));
   //double ratio_x = mean_spacing / vcl_abs(m_LeftImage->GetSpacing()[0]);
   //double ratio_y = mean_spacing / vcl_abs(m_LeftImage->GetSpacing()[1]);
-  
+
   outputSpacing[0]*=mean_spacing;
   outputSpacing[1]*=mean_spacing;
 
     {
     double a = (leftEpiLineEnd[1] - leftEpiLineStart[1])
              / (leftEpiLineEnd[0] - leftEpiLineStart[0]);
-    double b = leftEpiLineStart[1] - a * leftEpiLineStart[0];
+//    double b = leftEpiLineStart[1] - a * leftEpiLineStart[0];
     if (leftEpiLineEnd[0] > leftEpiLineStart[0])
       {
       alpha = vcl_atan(a);
       {
       alpha = otb::CONST_PI + vcl_atan(a);
       }
-    
+
     }
 
   // And compute the unitary vectors of the new axis (equivalent to
 
   // Use the mean spacing as before
   double mean_spacing=0.5*(vcl_abs(m_LeftImage->GetSpacing()[0])+vcl_abs(m_LeftImage->GetSpacing()[1]));
-  
+
   // Initialize
   currentPoint1 = m_OutputOriginInLeftImage;
   if(m_UseDEM)
 
     // And we compute the equivalent displacement in right image
     currentPoint2 = m_LeftToRightTransform->TransformPoint(currentPoint1);
-    
+
     // 5 - Finally, we have to handle a special case for beginning of
     // line, since at this position we are able to compute the
     // position of the beginning of next line
         tmpPoint[1] = nextLineStart1[1];
         nextLineStart1[2] = demHandler->GetHeightAboveEllipsoid(leftToGroundTransform->TransformPoint(tmpPoint));
         }
-      
+
 
       // By construction, nextLineStart2 is always the image of
       // nextLineStart1 by the left to right transform at the m_AverageElevation

File Code/FeatureExtraction/otbLineSegmentDetector.txx

View file
  • Ignore whitespace
 
   region.SetIndex(id);
   region.SetSize(size);
-  
+
   itk::ImageRegionIterator<OutputImageType> it(modulusImage, region);
-  
+
   it.GoToBegin();
   while (!it.IsAtEnd())
     {
     unsigned int    bin = static_cast<unsigned int> (static_cast<double>(it.Value()-min) / lengthBin);
-    
+
     // Highlights bug 498
     assert(bin<NbBin);
 
   while (itRec != m_RectangleList.end())
     {
     VertexType start, end;
-    
+
     start[0] = origin[0]
       + static_cast<TPrecision>((*itRec)[0]) * spacing[0];
     start[1] = origin[1]
       + static_cast<TPrecision>((*itRec)[2]) * spacing[0];
     end[1] = origin[1]
       + static_cast<TPrecision>((*itRec)[3]) * spacing[1];
-    
+
     typename DataNodeType::Pointer CurrentGeometry = DataNodeType::New();
     CurrentGeometry->SetNodeId("FEATURE_LINE");
     CurrentGeometry->SetNodeType(otb::FEATURE_LINE);
 
     ++itRec;
     }
-  
+
   return EXIT_SUCCESS;
 }
 
       CopyRectangle(rec, r);
       }
     }
- 
+
   return NFA;
 
 }
 {
   /** Add the point to the used list point*/
   this->SetPixelToUsed(index);
-  
+
   /** Neighborhooding */
   typedef itk::ConstNeighborhoodIterator<OutputImageType> NeighborhoodIteratorType;
   typename NeighborhoodIteratorType::SizeType radius;
     diff -= CONST_2PI;
     if (diff < 0.0) diff = -diff;
     }
-  
+
   return diff < prec;
 }
 
    */
   RectangleType          rec(8, 0.);       // Definition of a
                                            // rectangle : 8 components
-  
+
   if (vcl_abs(wl - wr)
       - vcl_sqrt( static_cast<double> (largestRegion.GetSize(0) * largestRegion.GetSize(0) +
                                        largestRegion.GetSize(1) * largestRegion.GetSize(1)))
     rec[5] = theta;
     rec[6] = m_Prec;
     rec[7] = m_DirectionsAllowed;
-    
+
     if (rec[4] - 1. < 1e-10) rec[4] = 1.;
-    
+
     }
   return rec;
 }
   /** Get The Bounding Region*/
   OutputImageDirRegionType region = m_OrientationFilter->GetOutput()->GetLargestPossibleRegion();
   region.Crop(rectangle->GetBoundingRegion());
-  
+
 
   itk::ImageRegionIterator<OutputImageDirType> it(m_OrientationFilter->GetOutput(), region);
   it.GoToBegin();
-  
+
   int pts = 0;
 
   while (!it.IsAtEnd())
   if (k == 0)
     return -logNT;
 
-  double x = p;
+//  double x = p;
   double a = k_d;
   double b = n_d - k_d + 1.0;
   val = -logNT - log10( dbetai_(&p, &a, &b) );

File Code/Fuzzy/otbDSFusionOfClassifiersImageFilter.txx

View file
  • Ignore whitespace
 
   // Calculation of the four constants A, B, C and K
   MassType A = 0, B = 1, C = 1, K;
+  K = 0; //supress warning. not sure about default value ??
   for (itMapMOBClk = mapJointMassesStepI.begin(); itMapMOBClk != mapJointMassesStepI.end(); ++itMapMOBClk)
     {
     classLabelk = itMapMOBClk->first;

File Code/IO/otbGDALImageIO.cxx

View file
  • Ignore whitespace
 
 void GDALImageIO::InternalWriteImageInformation(const void* buffer)
 {
-  char **     papszOptions = NULL;
+  //char **     papszOptions = NULL;
   std::string driverShortName;
   m_NbBands = this->GetNumberOfComponents();
 

File Code/IO/otbJPEG2000ImageIO.cxx

View file
  • Ignore whitespace
   {
     this->Clean();
   }
-  
+
   boost::shared_ptr<opj_image_t> DecodeTile(unsigned int tileIndex);
 
   const std::vector<unsigned int> & GetAvailableResolutions(){return this->m_AvailableResolutions; };
   unsigned int         m_TileHeight;
   unsigned int         m_XNbOfTile;
   unsigned int         m_YNbOfTile;
-  
+
   std::vector<unsigned int> m_AvailableResolutions;
 
   unsigned int m_ResolutionFactor;
     this->Clean();
     return boost::shared_ptr<opj_image_t>();
     }
-  
+
   // Creating the codec
   boost::shared_ptr<opj_codec_t> codec = boost::shared_ptr<opj_codec_t>(otbopenjpeg_opj_create_decompress_v2(this->m_CodecFormat),otbopenjpeg_opj_destroy_codec);
-  
+
   if (!codec)
     {
     this->Clean();
     return boost::shared_ptr<opj_image_t>();
     }
-  
+
   // Setting default parameters
   opj_dparameters_t parameters;
   otbopenjpeg_opj_set_default_decoder_parameters(&parameters);
   parameters.cp_reduce = static_cast<int>(this->m_ResolutionFactor);
-  
+
   // Set default event mgr
   opj_event_mgr_t eventManager;
   eventManager.info_handler = info_callback;
   eventManager.warning_handler = warning_callback;
   eventManager.error_handler = error_callback;
-  
+
   // Setup the decoder decoding parameters using user parameters
   if (!otbopenjpeg_opj_setup_decoder_v2(codec.get(), &parameters, &eventManager))
     {
     this->Clean();
     return boost::shared_ptr<opj_image_t>();
     }
-  
+
   // Read the main header of the codestream and if necessary the JP2
   // boxes
   opj_image_t * unsafeOpjImgPtr = NULL;
-  
+
   if (!otbopenjpeg_opj_read_header(stream.get(), codec.get(),&unsafeOpjImgPtr))
     {
     boost::shared_ptr<opj_image_t> image = boost::shared_ptr<opj_image_t>(unsafeOpjImgPtr,OpjImageDestroy);
     this->Clean();
     return boost::shared_ptr<opj_image_t>();
     }
-  
+
   boost::shared_ptr<opj_image_t> image = boost::shared_ptr<opj_image_t>(unsafeOpjImgPtr,OpjImageDestroy);
 
   if( otbopenjpeg_opj_get_decoded_tile(codec.get(), stream.get(), image.get(), tileIndex))
   // This helper class makes sure the Mutex is unlocked
   // in the event an exception is thrown.
   itk::MutexLockHolder<itk::SimpleMutexLock> mutexHolder(m_Mutex);
-  
+
   if(!m_IsReady)
     {
     std::cerr<<(this)<<" Cache is not configured !"<<std::endl;
       {
       open = (*it)->m_IsOpen && open;
       }
-  
+
   if ( !open )
     {
     if ( !this->CanReadFile( m_FileName.c_str() ) )
 
     // Set-up multi-threader
     this->GetMultiThreader()->SetSingleMethod(this->ThreaderCallback, &str);
-    
+
     // multithread the execution
     this->GetMultiThreader()->SingleMethodExecute();
     }
     }
 
  // Get nb. of lines and columns of the region to read
+  /* -Wunused-variable
   int lNbLines     = this->GetIORegion().GetSize()[1];
+  */
   int lNbColumns   = this->GetIORegion().GetSize()[0];
+  /* -Wunused-variable
   int lFirstLine   = this->GetIORegion().GetIndex()[1]; // [1... ]
   int lFirstColumn = this->GetIORegion().GetIndex()[0]; // [1... ]
+  */
   unsigned int lWidthSrc; // Width of the input pixel in nb of pixel
   unsigned int lHeightDest; // Height of the area where write in nb of pixel
   unsigned int lWidthDest; // Width of the area where write in nb of pixel
 
   threadId = ((itk::MultiThreader::ThreadInfoStruct *)(arg))->ThreadID;
   threadCount = ((itk::MultiThreader::ThreadInfoStruct *)(arg))->NumberOfThreads;
-  
+
   str = (ThreadStruct *)(((itk::MultiThreader::ThreadInfoStruct *)(arg))->UserData);
 
   // Retrieve data
     otbMsgDevMacro(<< " Tile " << tiles->at(i).first << " decoded by thread "<<threadId);
 
     io->LoadTileData(buffer, currentTile.get());
-     
+
     if (cache->GetCacheSizeInTiles() != 0)
      {
      cache->AddTile(tiles->at(i).first, currentTile);
     otbMsgDevMacro(<< " Tile " <<tiles->at(lastTile).first  << " decoded by thread "<<threadId);
 
     io->LoadTileData(buffer, currentTile.get());
-     
+
     if (cache->GetCacheSizeInTiles() != 0)
      {
      cache->AddTile(tiles->at(lastTile).first, currentTile);
   itk::ExposeMetaData<unsigned int>(this->GetMetaDataDictionary(),
                                     MetaDataKey::CacheSizeInBytes,
                                     m_CacheSizeInByte);
-  
+
   // Initialize some parameters of the tile cache
   this->m_TileCache->Initialize(m_InternalReaders.front()->m_TileWidth,
                                 m_InternalReaders.front()->m_TileHeight,
         std::ostringstream lStream;
         lStream << MetaDataKey::MetadataKey << cpt;
         key = lStream.str();
-        
+
         itk::EncapsulateMetaData<std::string>(dict, key, static_cast<std::string> (papszGMLMetadata[cpt]));
         otbMsgDevMacro( << static_cast<std::string>(papszGMLMetadata[cpt]));
         }
   // Encapsulate tile hints for streaming
   unsigned int tileHintX = m_InternalReaders.front()->m_TileWidth / static_cast<unsigned int>(vcl_pow(2.0, static_cast<int>(m_ResolutionFactor) ));
   unsigned int tileHintY = m_InternalReaders.front()->m_TileHeight / static_cast<unsigned int>(vcl_pow(2.0, static_cast<int>(m_ResolutionFactor) ));
-  
+
   itk::EncapsulateMetaData<unsigned int>(dict, MetaDataKey::TileHintX, tileHintX);
   itk::EncapsulateMetaData<unsigned int>(dict, MetaDataKey::TileHintY, tileHintY);
 

File Code/IO/otbOGRIOHelper.cxx

View file
  • Ignore whitespace
       }
       }
 
-      
+
     OGRFeature::DestroyFeature(feature);
     chrono.Stop();
     ++counter;
     itk::ExposeMetaData<VectorDataKeywordlist>(dataNode->GetMetaDataDictionary(),
                                                MetaDataKey::VectorDataKeywordlistKey,
                                                kwl);
-    
+
     // Create the field once
     if (ogrCurrentLayer != NULL && !fieldsAddedToOGRLayer)
       {
         {
         OGRFeature *ogrFeature;
         ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn());
-    
+
         // Add the fields to the features
         for (unsigned int i  = 0; i < kwl.GetNumberOfFields(); ++i)
           {
             ogrFeature->SetField(ogrFeature->GetFieldIndex(key) , kwl.GetFieldAsString(key).c_str());
             }
           }
-    
+
 //        ogrFeature->SetField("Name", dataNode->GetNodeId());
         ogrFeature->SetGeometry(&ogrPoint);
 
           // Edit the value of the field and add it to the current feature
           ogrFeature->SetField(ogrFeature->GetFieldIndex(key) , kwl.GetFieldAsString(key).c_str());
           }
-    
+
 //        ogrFeature->SetField("Name", dataNode->GetNodeId());
         ogrFeature->SetGeometry(&ogrLine);
 
         {
         OGRFeature *ogrFeature;
         ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn());
-    
+
         // Add the fields to the features
         for (unsigned int i  = 0; i < kwl.GetNumberOfFields(); ++i)
           {
           // Edit the value of the field and add it to the current feature
           ogrFeature->SetField(ogrFeature->GetFieldIndex(key) , kwl.GetFieldAsString(key).c_str());
           }
-    
+
         ogrFeature->SetGeometry(ogrPolygon);
-    
+
         if (ogrCurrentLayer->CreateFeature(ogrFeature) != OGRERR_NONE)
           {
           itkExceptionMacro(<< "Failed to create feature in shapefile.");
           }
-    
+
         OGRFeature::DestroyFeature(ogrFeature);
         }
       else
                                  OGRLayer* ogrCurrentLayer,
                                  OGRSpatialReference * oSRS)
 {
-  
+
   // Create the in memory datasource if NULL
   if (inMemoryDataSource == NULL)
     {
     }
 
   std::vector<OGRLayer*>  ogrLayerVector;
-  unsigned int kept = 0;
+  //unsigned int kept = 0;
   bool fieldsAddedToOGRLayer = false;
   // Get the children list from the input node
   typedef InternalTreeNodeType::ChildrenListType ChildrenListType;
   for (ChildrenListType::iterator it = children.begin(); it != children.end(); ++it)
     {
     DataNodePointerType dataNode = (*it)->Get();
-    
+
     // Get the kwl
     otb::VectorDataKeywordlist kwl;
     itk::ExposeMetaData<VectorDataKeywordlist>(dataNode->GetMetaDataDictionary(),
                                                MetaDataKey::VectorDataKeywordlistKey,
                                                kwl);
-    
+
     // Create the field once
     if (ogrCurrentLayer != NULL && !fieldsAddedToOGRLayer)
       {
       //Save it in the structure
       OGRFeature *ogrFeature;
       ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn());
-    
+
       // Add the fields to the features
       for (unsigned int i  = 0; i < kwl.GetNumberOfFields(); ++i)
         {
         // Get the key of the Nth OGRFieldRefn
         const char * key = kwl.GetNthField(i).first->GetNameRef();
-          
+
         if (std::string(key) != "FID")
           {
           // Edit the value of the field and add it to the current feature
 
       OGRFeature *ogrFeature;
       ogrFeature = OGRFeature::CreateFeature(ogrCurrentLayer->GetLayerDefn());
-    
+
       // Add the fields to the features
       for (unsigned int i  = 0; i < kwl.GetNumberOfFields(); ++i)
         {
         // Edit the value of the field and add it to the current feature
         ogrFeature->SetField(ogrFeature->GetFieldIndex(key) , kwl.GetFieldAsString(key).c_str());
         }
-    
+
       ogrFeature->SetGeometry(ogrPolygon);
-    
+
       if (ogrCurrentLayer->CreateFeature(ogrFeature) != OGRERR_NONE)
         {
         itkExceptionMacro(<< "Failed to create feature in shapefile.");
         }
-    
+
       OGRFeature::DestroyFeature(ogrFeature);
       OGRGeometryFactory::destroyGeometry(ogrPolygon);
       break;

File Code/Segmentation/otbOGRLayerStreamStitchingFilter.txx

View file
  • Ignore whitespace
                          #endif
                     }
 
-
+                     /** -Wunused-variable
                      long upperFID = upper.feat.GetFID();
                      long lowerFID = lower.feat.GetFID();
+                     **/
                      fusionList.push_back(fusion);
                     }
                 }
                  }
             }
          }
-         
+
          // Update progress
          progress.CompletedPixel();
-         
+
       } //end for x
       m_OGRLayer.ogr().CommitTransaction();
 
-      
+
    } //end for y
    m_OGRLayer.ogr().CommitTransaction();
 
    {
       itkExceptionMacro(<<"Input OGR layer is null!");
    }
-   
+
    this->InvokeEvent(itk::StartEvent());
 
    typename InputImageType::ConstPointer inputImage = this->GetInput();
-  
+
   //compute the number of stream division in row and column
    SizeType imageSize = this->GetInput()->GetLargestPossibleRegion().GetSize();
    unsigned int nbRowStream = static_cast<unsigned int>(imageSize[1] / m_StreamSize[1] + 1);
    unsigned int nbColStream = static_cast<unsigned int>(imageSize[0] / m_StreamSize[0] + 1);
-   
+
    itk::ProgressReporter progress(this,0,2*nbRowStream*nbColStream,100,0);
    //Process column
    this->ProcessStreamingLine(false, progress);
    //Process row
    this->ProcessStreamingLine(true, progress);
-   
+
    this->InvokeEvent(itk::EndEvent());
 }
 

File Code/UtilitiesAdapters/OGRAdapters/otbOGRFeatureWrapper.cxx

View file
  • Ignore whitespace
     Field const& field = (*this)[i];
     field.PrintSelf(os, indent);
     }
-  OGRGeometry const* g = GetGeometry();
 }
 
 bool otb::ogr::operator==(otb::ogr::Feature const& lhs, otb::ogr::Feature const& rhs)

File Code/UtilitiesAdapters/OGRAdapters/otbOGRFeatureWrapper.txx

View file
  • Ignore whitespace
 void otb::ogr::Feature::SetGeometryDirectly(UniqueGeometryPtr geometry)
 {
   CheckInvariants();
-  OGRGeometry * g = geometry.get();
+  //OGRGeometry * g = geometry.get();
   UncheckedSetGeometryDirectly(otb::move(geometry));
-  assert(m_Feature->GetGeometryRef() == g && "The new geometry hasn't been set as expected");
+  assert(m_Feature->GetGeometryRef() == geometry.get() && "The new geometry hasn't been set as expected");
   assert(! geometry && "UniqueGeometryPtr hasn't released its pointer");
 }
 

File Code/UtilitiesAdapters/OGRAdapters/otbOGRFieldWrapper.cxx

View file
  • Ignore whitespace
 std::ostream & otb::ogr::Field::UncheckedPrintSelf(
   std::ostream& os, itk::Indent indent) const
 {
-  const itk::Indent one_indent = itk::Indent().GetNextIndent();
+  //const itk::Indent one_indent = itk::Indent().GetNextIndent();
   // os << indent << "|" << one_indent << "+ ";
   os << indent << this->GetName() << ": ";
   switch (this->GetType())

File Code/UtilitiesAdapters/OGRAdapters/otbOGRFieldWrapper.txx

View file
  • Ignore whitespace
   BOOST_MPL_ASSERT_MSG(!boost::is_array<InterfaceType>::value, InterFaceType_Cant_Be_An_array, (T, InterfaceType));
   typedef typename boost::mpl::at<internal::FieldType_Map, InterfaceType>::type Kind;
   BOOST_MPL_ASSERT_MSG(!(boost::is_same<Kind, boost::mpl::void_>::value), UNEXPECTED_KIND_TYPE, (T, InterfaceType, Kind));
-  const int VALUE = Kind::value;
+  //const int VALUE = Kind::value;
   assert(m_Definition.GetType() == VALUE && "OGR field type mismatches the type of new field value");
   typedef typename boost::mpl::at<internal::FieldSetters_Map, Kind>::type SetterType;
   // If you experience a static assertion failure in the line below, it means
   CheckInvariants();
   assert(HasBeenSet() && "Cannot access the value of a field that hasn't been set");
   typedef typename boost::mpl::at<internal::FieldType_Map, T>::type Kind;
-  const int VALUE = Kind::value;
+  //const int VALUE = Kind::value;
   BOOST_STATIC_ASSERT(!(boost::is_same<Kind, boost::mpl::void_>::value));
   assert(m_Definition.GetType() == VALUE && "OGR field type mismatches the type of requested field value");
   typedef typename boost::mpl::at<internal::FieldGetters_Map, Kind>::type GetterType;

File Code/Visualization/otbVectorDataEditionModel.cxx

View file
  • Ignore whitespace
 {
   srcPoint[0] = this->GetOrigin()[0] + srcPoint[0] / this->GetSpacing()[0];
   srcPoint[1] = this->GetOrigin()[1] + srcPoint[1] / this->GetSpacing()[1];
-  
+
   if ( m_SearchIndex != -1 )
     {
     // Set the geometry the srcPoint belongs to, as the SelectedGeometry
     }
 
     // needed variables
-    int size = newVertexList->Size();
-    unsigned int vidx = 0;
+    /* -Wunused-variable
+    *  int size = newVertexList->Size();
+    *  unsigned int vidx = 0;
+    */
     bool found = false;
 
     // Try with VertexIterator
     {
     itk::TimeProbe chrono;
     chrono.Start();
-    
+
     // Set the current Geometry the geometry which the srcPoint
     // belongs to
     this->SetSelectedGeometry(m_SearchIndex);
       case FEATURE_LINE:
       {
       newVertexList = const_cast< VertexListType*>(GetSelectedGeometry()->GetLine()->GetVertexList());
-      
+
       this->ProcessVertexListTranslation(newVertexList, tx, ty);
       }
       break;
 
   // Initialize the search index
   m_SearchIndex = -1;
-  
+
   // Search wich geometry the src point belong to
   itk::PreOrderTreeIterator<VectorDataType::DataTreeType> it(this->GetVectorData()->GetDataTree());
   it.GoToBegin();
   int count = 0;
-    
+
   while (!it.IsAtEnd() )
     {
     if (it.Get()->IsPointFeature() || it.Get()->IsLineFeature() || it.Get()->IsPolygonFeature())
       {
       double dist = it.Get()->EuclideanDistance(srcPoint);
-      
+
       if (dist < m_Threshold )
         {
         m_SearchIndex = count;
 {
   itk::TimeProbe chrono;
   chrono.Start();
-  
+
   // From RemoteSensingRegion To Datanode (polygon)
   DataNodeType::Pointer  regionNode = DataNodeType::New();
   PolygonType::Pointer regionPolygon = PolygonType::New();
   regionNode->SetNodeId("FEATURE_POLYGON");
   regionNode->SetNodeType(otb::FEATURE_POLYGON);
   regionNode->SetPolygonExteriorRing(regionPolygon);
-  
+
   // Add the verticies to the polygon
   VertexType p;
   VertexType ul,ur, ll, lr;
         {
         // Remove the node
         it.Remove();
-        
+
         // must go the to begin, because the iterator seems lost when
         // removing a node from its tree
         it.GoToBegin();
-        
+
         //nbGeomDeleted++;
         }
       //count++;
 }
 
 }
-