Skip to content

Commit

Permalink
Merge pull request #97 from lsst/tickets/DM-7736
Browse files Browse the repository at this point in the history
DM-7736: Avoid signed/unsigned integer comparison warnings.
  • Loading branch information
TallJimbo committed Oct 4, 2016
2 parents 8e01ba2 + 2974c91 commit f31e559
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/lsst/afw/table/FieldBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ struct FieldBase< Array<U> > {

template <typename Derived>
void setValueDeep(Element * p, ndarray::ExpressionBase<Derived> const & value) const {
if (value.template getSize<0>() != _size) {
if (value.template getSize<0>() != static_cast<std::size_t>(_size)) {
throw LSST_EXCEPT(
lsst::pex::exceptions::LengthError,
"Incorrect size in array field assignment."
Expand Down
2 changes: 1 addition & 1 deletion src/detection/Footprint.cc
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ Footprint::getCentroid() const
xc += npix*0.5*(x1 + x0);
yc += npix*y;
}
assert(n == _area);
assert(static_cast<std::size_t>(n) == _area);

return geom::Point2D(xc/_area, yc/_area);
}
Expand Down
2 changes: 1 addition & 1 deletion src/detection/FootprintSet.cc
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ static void findFootprints(
fp->addSpan(spans[i0]->y + row0, spans[i0]->x0 + col0, spans[i0]->x1 + col0);
}

if (good && !(fp->getNpix() < npixMin)) {
if (good && fp->getNpix() >= static_cast<std::size_t>(npixMin)) {
_footprints->push_back(fp);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/math/ChebyshevBoundedField.cc
Original file line number Diff line number Diff line change
Expand Up @@ -232,14 +232,14 @@ PTR(ChebyshevBoundedField) ChebyshevBoundedField::fit(
// ------------------ modifier factories ---------------------------------------------------------------

PTR(ChebyshevBoundedField) ChebyshevBoundedField::truncate(Control const & ctrl) const {
if (ctrl.orderX >= _coefficients.getSize<1>()) {
if (static_cast<std::size_t>(ctrl.orderX) >= _coefficients.getSize<1>()) {
throw LSST_EXCEPT(
pex::exceptions::LengthError,
(boost::format("New x order (%d) exceeds old x order (%d)")
% ctrl.orderX % (_coefficients.getSize<1>() - 1)).str()
);
}
if (ctrl.orderY >= _coefficients.getSize<0>()) {
if (static_cast<std::size_t>(ctrl.orderY) >= _coefficients.getSize<0>()) {
throw LSST_EXCEPT(
pex::exceptions::LengthError,
(boost::format("New y order (%d) exceeds old y order (%d)")
Expand Down
2 changes: 1 addition & 1 deletion src/table/arrays.cc
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ ndarray::Array<T const,1,1> ArrayKey<T>::get(BaseRecord const & record) const {
template <typename T>
void ArrayKey<T>::set(BaseRecord & record, ndarray::Array<T const,1,1> const & value) const {
LSST_THROW_IF_NE(
value.template getSize<0>(), _size,
value.template getSize<0>(), static_cast<std::size_t>(_size),
pex::exceptions::LengthError,
"Size of input array (%d) does not match size of array field (%d)"
);
Expand Down

0 comments on commit f31e559

Please sign in to comment.