From d179fa2bc0262854b1e001e0c9db3d2f508bf647 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Tue, 30 Mar 2021 12:39:36 -0700 Subject: [PATCH] include: add const qualifier to appropriate CompatSet methods Signed-off-by: Patrick Donnelly --- src/include/CompatSet.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/include/CompatSet.h b/src/include/CompatSet.h index 2f913177692..3202384900c 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; -- 2.47.3