From fbc3f2f80374f45ac2d1530e96d8bbc7c4db57ce Mon Sep 17 00:00:00 2001 From: joncruz Date: Fri, 4 Jul 2008 04:31:36 +0000 Subject: [PATCH] Mask out dead code causing warning --- src/2geom/poly.h | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/2geom/poly.h b/src/2geom/poly.h index 2af24d25f..f76bc3eee 100644 --- a/src/2geom/poly.h +++ b/src/2geom/poly.h @@ -93,26 +93,28 @@ public: return result; } // equivalent to multiply by x^terms, discard negative terms - Poly shifted(unsigned terms) const { + Poly shifted(unsigned terms) const { Poly result; // This was a no-op and breaks the build on x86_64, as it's trying // to take maximum of 32-bit and 64-bit integers //const unsigned out_size = std::max(unsigned(0), size()+terms); const size_type out_size = size() + terms; result.reserve(out_size); - - if(terms < 0) { - for(unsigned i = 0; i < out_size; i++) { - result.push_back((*this)[i-terms]); - } - } else { + +// By definition an unsigned can not be less than zero +// TODO someone who understands the intent needs to correct this properly +// if(terms < 0) { +// for(unsigned i = 0; i < out_size; i++) { +// result.push_back((*this)[i-terms]); +// } +// } else { for(unsigned i = 0; i < terms; i++) { result.push_back(0.0); } for(unsigned i = 0; i < size(); i++) { result.push_back((*this)[i]); } - } +// } assert(result.size() == out_size); return result; -- 2.30.2