From: Patrick Donnelly Date: Tue, 30 Mar 2021 19:39:36 +0000 (-0700) Subject: include: add const qualifier to appropriate CompatSet methods X-Git-Tag: v17.1.0~1237^2~13 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=d179fa2bc0262854b1e001e0c9db3d2f508bf647;p=ceph.git include: add const qualifier to appropriate CompatSet methods Signed-off-by: Patrick Donnelly --- diff --git a/src/include/CompatSet.h b/src/include/CompatSet.h index 2f91317769262..3202384900cb0 100644 --- a/src/include/CompatSet.h +++ b/src/include/CompatSet.h @@ -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;