]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
lists templates: const cleanup
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 13 Oct 2010 17:33:00 +0000 (10:33 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Wed, 13 Oct 2010 17:33:00 +0000 (10:33 -0700)
Signed-off-by: Colin McCabe <colinm@hq.newdream.net>
src/include/dlist.h
src/include/elist.h
src/include/xlist.h

index 5a4811db72e8669ce2f34031ec7b375c7b8b20e0..bf44276c0a7d9cf8398c8217c6581deab1ebfc4e 100644 (file)
@@ -31,8 +31,8 @@ public:
     const item& operator= (const item& right);
 
     
-    bool empty() { return _prev == this; }
-    bool is_on_list() { return !empty(); }
+    bool empty() const { return _prev == this; }
+    bool is_on_list() const { return !empty(); }
 
     bool remove_myself() {
       if (_next == this) {
index 112e3706e724ab634d9fa68b83f271d1d10f9c23..553fd419de9c92a9c1c2cb964cd7d9dbde31be29 100644 (file)
@@ -43,8 +43,8 @@ public:
     const item& operator= (const item& right);
 
     
-    bool empty() { return _prev == this; }
-    bool is_on_list() { return !empty(); }
+    bool empty() const { return _prev == this; }
+    bool is_on_list() const { return !empty(); }
 
     bool remove_myself() {
       if (_next == this) {
@@ -88,7 +88,7 @@ public:
     assert(_head.empty());
   }
 
-  bool empty() 
+  bool empty() const {
     return _head.empty();
   }
 
@@ -165,7 +165,7 @@ public:
       next = cur->_next;
       return *this;
     }
-    bool end() {
+    bool end() const {
       return cur == head;
     }
   };
index f6139a16ae56f2da20607c753a25874dbda52316..054c8771156ed95318481e7e0f9d76e65bd0660f 100644 (file)
@@ -34,7 +34,7 @@ public:
 
     
     xlist* get_list() { return _list; }
-    bool is_on_list() { return _list ? true:false; }
+    bool is_on_list() const { return _list ? true:false; }
     bool remove_myself() {
       if (_list) {
        _list->remove(this);
@@ -65,8 +65,8 @@ public:
     assert(_back == 0);
   }
 
-  int size() { return _size; }
-  bool empty() { 
+  int size() const { return _size; }
+  bool empty() const 
     assert((bool)_front == (bool)_size);
     return _front == 0; 
   }
@@ -144,7 +144,7 @@ public:
       cur = cur->_next;
       return *this;
     }
-    bool end() { return cur == 0; }
+    bool end() const { return cur == 0; }
   };
 
   iterator begin() { return iterator(_front); }