]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: add const-correctness to rgw_obj_manifest and svc_tier_rados
authorJ. Eric Ivancich <ivancich@redhat.com>
Tue, 24 Mar 2020 16:02:00 +0000 (12:02 -0400)
committerJ. Eric Ivancich <ivancich@redhat.com>
Mon, 4 May 2020 17:20:08 +0000 (13:20 -0400)
Mark functions as "const" or function parameters as "const" in order
to make those functions more widely callable.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
src/rgw/rgw_obj_manifest.h
src/rgw/services/svc_tier_rados.h

index c2b6157ed060056ae1c74de5234bcbae60d34ff9..4b3e66e9fd649bcbb6754f8a175d7c72f626eb64 100644 (file)
@@ -456,10 +456,10 @@ public:
     void seek(uint64_t ofs);
 
     void operator++();
-    bool operator==(const obj_iterator& rhs) {
+    bool operator==(const obj_iterator& rhs) const {
       return (ofs == rhs.ofs);
     }
-    bool operator!=(const obj_iterator& rhs) {
+    bool operator!=(const obj_iterator& rhs) const {
       return (ofs != rhs.ofs);
     }
     const rgw_obj_select& get_location() {
@@ -504,7 +504,7 @@ public:
 
     friend class RGWObjManifest;
     void dump(Formatter *f) const;
-  };
+  }; // class obj_iterator
 
   const obj_iterator& obj_begin();
   const obj_iterator& obj_end();
@@ -552,4 +552,3 @@ public:
   };
 };
 WRITE_CLASS_ENCODER(RGWObjManifest)
-
index 925a2d25e069975dc50545b31076e6331d391643..a86b0a45111de09c950f5c1401397900b68caf49 100644 (file)
@@ -54,7 +54,7 @@ public:
     s.append(buf);
     return s;
   }
-  string get_part(string& part) const {
+  string get_part(const string& part) const {
     string s = prefix;
     s.append(".");
     s.append(part);
@@ -66,7 +66,7 @@ public:
   const string& get_key() const {
     return oid;
   }
-  bool from_meta(string& meta) {
+  bool from_meta(const string& meta) {
     int end_pos = meta.rfind('.'); // search for ".meta"
     if (end_pos < 0)
       return false;