length() returns int istead of size_t
authoralpar
Thu, 31 Mar 2005 13:30:27 +0000
changeset 128281e89e2b90d1
parent 1281 164ca6938d09
child 1283 fc20371677b9
length() returns int istead of size_t
src/lemon/concept/path.h
src/lemon/path.h
     1.1 --- a/src/lemon/concept/path.h	Thu Mar 31 13:29:05 2005 +0000
     1.2 +++ b/src/lemon/concept/path.h	Thu Mar 31 13:30:27 2005 +0000
     1.3 @@ -57,7 +57,7 @@
     1.4        Path(const Graph &_G) {}
     1.5  
     1.6        /// Length of the path.
     1.7 -      size_t length() const {return 0;}
     1.8 +      int length() const {return 0;}
     1.9        /// Returns whether the path is empty.
    1.10        bool empty() const { return true;}
    1.11  
     2.1 --- a/src/lemon/path.h	Thu Mar 31 13:29:05 2005 +0000
     2.2 +++ b/src/lemon/path.h	Thu Mar 31 13:30:27 2005 +0000
     2.3 @@ -102,7 +102,7 @@
     2.4      }
     2.5  
     2.6      /// Length of the path.
     2.7 -    size_t length() const { return edges.size(); }
     2.8 +    int length() const { return edges.size(); }
     2.9      /// Returns whether the path is empty.
    2.10      bool empty() const { return edges.empty(); }
    2.11  
    2.12 @@ -197,9 +197,7 @@
    2.13        bool operator<(const EdgeIt& e) const { return idx<e.idx; }
    2.14  
    2.15      private:
    2.16 -      // FIXME: comparison between signed and unsigned...
    2.17 -      // Jo ez igy? Vagy esetleg legyen a length() int?
    2.18 -      void validate() { if( size_t(idx) >= p->length() ) idx=-1; }
    2.19 +      void validate() { if(idx >= p->length() ) idx=-1; }
    2.20      };
    2.21  
    2.22      /**
    2.23 @@ -247,7 +245,7 @@
    2.24        bool operator<(const NodeIt& e) const { return idx<e.idx; }
    2.25  
    2.26      private:
    2.27 -      void validate() { if( size_t(idx) > p->length() ) idx=-1; }
    2.28 +      void validate() { if(idx > p->length() ) idx=-1; }
    2.29      };
    2.30  
    2.31      friend class Builder;