]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
include: add const qualifier to appropriate CompatSet methods
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 30 Mar 2021 19:39:36 +0000 (12:39 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 30 Jul 2021 23:28:53 +0000 (16:28 -0700)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/include/CompatSet.h

index 2f913177692623cda52f3e9aea4654a07480eb06..3202384900cb0d34fbe1ce9d9432c758a4ccc799 100644 (file)
@@ -156,7 +156,7 @@ struct CompatSet {
    * -1: This CompatSet is missing at least one feature
    *     described in the other. It may still have more features, though.
    */
-  int compare(const CompatSet& other) {
+  int compare(const CompatSet& other) const {
     if ((other.compat.mask == compat.mask) &&
        (other.ro_compat.mask == ro_compat.mask) &&
        (other.incompat.mask == incompat.mask)) return 0;
@@ -172,7 +172,7 @@ struct CompatSet {
   /* Get the features supported by other CompatSet but not this one,
    * as a CompatSet.
    */
-  CompatSet unsupported(CompatSet& other) {
+  CompatSet unsupported(const CompatSet& other) const {
     CompatSet diff;
     uint64_t other_compat =
       ((other.compat.mask ^ compat.mask) & other.compat.mask);
@@ -183,13 +183,13 @@ struct CompatSet {
     for (int id = 1; id < 64; ++id) {
       uint64_t mask = (uint64_t)1 << id;
       if (mask & other_compat) {
-       diff.compat.insert( Feature(id, other.compat.names[id]));
+       diff.compat.insert( Feature(id, other.compat.names.at(id)));
       }
       if (mask & other_ro_compat) {
-       diff.ro_compat.insert(Feature(id, other.ro_compat.names[id]));
+       diff.ro_compat.insert(Feature(id, other.ro_compat.names.at(id)));
       }
       if (mask & other_incompat) {
-       diff.incompat.insert( Feature(id, other.incompat.names[id]));
+       diff.incompat.insert( Feature(id, other.incompat.names.at(id)));
       }
     }
     return diff;