Update mussa to build on ubuntu 10.04 with qt 4.6.2 +boost 1.40.0.1
[mussa.git] / alg / sequence_location.cpp
index 704cb89e4469c974b772e684c2ab9daedd368f88..4b3ddc8b5a1b282400670a69e462df62d9e2c12b 100644 (file)
@@ -1,4 +1,6 @@
 #include "alg/sequence_location.hpp"
+
+#include <cstdlib>
     
 SequenceLocation::SequenceLocation(
     const boost::shared_ptr<Sequence> s, 
@@ -60,14 +62,14 @@ int SequenceLocation::getLeft() const
   return left;
 }
 
-void SequenceLocation::setCount(int c)
+void SequenceLocation::setCount(SequenceLocation::size_type c)
 {
   right = left + c;
 }
 
-int SequenceLocation::getCount() const
+SequenceLocation::size_type SequenceLocation::getCount() const
 {
-  return right - left;
+  return std::max(right - left, 0);
 }
 
 void SequenceLocation::setRight(int r)
@@ -79,3 +81,8 @@ int SequenceLocation::getRight() const
 {
   return right;
 }
+
+SequenceLocation::size_type SequenceLocation::size() const
+{
+  return getCount();
+}