Skip to content

Commit

Permalink
Merge pull request #3009 from SunBlack/modernize-use-nullptr_filters
Browse files Browse the repository at this point in the history
Use nullptr in module filters
  • Loading branch information
SergioRAgostinho authored Apr 22, 2019
2 parents a160917 + 746d328 commit 514ecb4
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
8 changes: 4 additions & 4 deletions filters/include/pcl/filters/impl/conditional_removal.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ template <typename PointT>
pcl::FieldComparison<PointT>::FieldComparison (
const std::string &field_name, ComparisonOps::CompareOp op, double compare_val)
: ComparisonBase<PointT> ()
, compare_val_ (compare_val), point_data_ (NULL)
, compare_val_ (compare_val), point_data_ (nullptr)
{
field_name_ = field_name;
op_ = op;
Expand Down Expand Up @@ -93,10 +93,10 @@ pcl::FieldComparison<PointT>::FieldComparison (
template <typename PointT>
pcl::FieldComparison<PointT>::~FieldComparison ()
{
if (point_data_ != NULL)
if (point_data_ != nullptr)
{
delete point_data_;
point_data_ = NULL;
point_data_ = nullptr;
}
}

Expand Down Expand Up @@ -682,7 +682,7 @@ pcl::ConditionalRemoval<PointT>::applyFilter (PointCloud &output)
return;
}

if (condition_.get () == NULL)
if (condition_.get () == nullptr)
{
PCL_WARN ("[pcl::%s::applyFilter] No filtering condition given!\n", getClassName ().c_str ());
return;
Expand Down
4 changes: 2 additions & 2 deletions filters/include/pcl/filters/normal_space.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ namespace pcl
/** \brief Empty constructor. */
NormalSpaceSampling ()
: sample_ (std::numeric_limits<unsigned int>::max ())
, seed_ (static_cast<unsigned int> (time (NULL)))
, seed_ (static_cast<unsigned int> (time (nullptr)))
, binsx_ ()
, binsy_ ()
, binsz_ ()
, input_normals_ ()
, rng_uniform_distribution_ (NULL)
, rng_uniform_distribution_ (nullptr)
{
filter_name_ = "NormalSpaceSampling";
}
Expand Down
4 changes: 2 additions & 2 deletions filters/include/pcl/filters/random_sample.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ namespace pcl
RandomSample (bool extract_removed_indices = false) :
FilterIndices<PointT> (extract_removed_indices),
sample_ (UINT_MAX),
seed_ (static_cast<unsigned int> (time (NULL)))
seed_ (static_cast<unsigned int> (time (nullptr)))
{
filter_name_ = "RandomSample";
}
Expand Down Expand Up @@ -166,7 +166,7 @@ namespace pcl
typedef boost::shared_ptr<const RandomSample<pcl::PCLPointCloud2> > ConstPtr;

/** \brief Empty constructor. */
RandomSample () : sample_ (UINT_MAX), seed_ (static_cast<unsigned int> (time (NULL)))
RandomSample () : sample_ (UINT_MAX), seed_ (static_cast<unsigned int> (time (nullptr)))
{
filter_name_ = "RandomSample";
}
Expand Down
2 changes: 1 addition & 1 deletion filters/include/pcl/filters/sampling_surface_normal.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace pcl

/** \brief Empty constructor. */
SamplingSurfaceNormal () :
sample_ (10), seed_ (static_cast<unsigned int> (time (NULL))), ratio_ ()
sample_ (10), seed_ (static_cast<unsigned int> (time (nullptr))), ratio_ ()
{
filter_name_ = "SamplingSurfaceNormal";
srand (seed_);
Expand Down
6 changes: 3 additions & 3 deletions filters/include/pcl/filters/voxel_grid_covariance.h
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ namespace pcl
return ret;
}
else
return NULL;
return nullptr;
}

/** \brief Get the voxel containing point p.
Expand All @@ -335,7 +335,7 @@ namespace pcl
return ret;
}
else
return NULL;
return nullptr;
}

/** \brief Get the voxel containing point p.
Expand All @@ -362,7 +362,7 @@ namespace pcl
return ret;
}
else
return NULL;
return nullptr;

}

Expand Down

0 comments on commit 514ecb4

Please sign in to comment.