From 848e54bfbfc9faa84dd5f0a3962a5e16220ae64e Mon Sep 17 00:00:00 2001 From: William Throwe Date: Wed, 16 Oct 2024 15:12:47 -0400 Subject: [PATCH] Mark comparison operators in ck-core const --- src/ck-core/charm++.h | 6 +++--- src/ck-core/ckarray.h | 4 ++-- src/ck-core/ckarrayindex.h | 2 +- src/ck-core/ckcallback.h | 2 +- src/ck-core/cksection.h | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ck-core/charm++.h b/src/ck-core/charm++.h index 6c5c0bdf93..96a453a533 100644 --- a/src/ck-core/charm++.h +++ b/src/ck-core/charm++.h @@ -875,7 +875,7 @@ class CProxy_Group : public CProxy { /* CProxy_Group(const NodeGroup *g) //<- for compatability with NodeGroups :CProxy(), _ck_gid(g->ckGetGroupID()) {}*/ - bool operator==(const CProxy_Group& other) { + bool operator==(const CProxy_Group& other) const { return ckGetGroupID() == other.ckGetGroupID(); } @@ -918,7 +918,7 @@ class CProxyElement_Group : public CProxy_Group { /*CProxyElement_Group(const NodeGroup *g) //<- for compatability with NodeGroups :CProxy_Group(g), _onPE(CkMyPe()) {}*/ - bool operator==(const CProxyElement_Group& other) { + bool operator==(const CProxyElement_Group& other) const { return ckGetGroupID() == other.ckGetGroupID() && ckGetGroupPe() == other.ckGetGroupPe(); } @@ -1024,7 +1024,7 @@ class CProxy_NodeGroup : public CProxy{ /* CProxy_Group(const NodeGroup *g) //<- for compatability with NodeGroups :CProxy(), _ck_gid(g->ckGetGroupID()) {}*/ - bool operator==(const CProxy_NodeGroup& other) { + bool operator==(const CProxy_NodeGroup& other) const { return ckGetGroupID() == other.ckGetGroupID(); } diff --git a/src/ck-core/ckarray.h b/src/ck-core/ckarray.h index 968500935f..83fe9a862b 100644 --- a/src/ck-core/ckarray.h +++ b/src/ck-core/ckarray.h @@ -114,7 +114,7 @@ class CProxy_ArrayBase : public CProxy CProxy_ArrayBase(const ArrayElement* e); CProxy_ArrayBase(const CProxy_ArrayBase& cs) : CProxy(cs), _aid(cs.ckGetArrayID()) {} - bool operator==(const CProxy_ArrayBase& other) + bool operator==(const CProxy_ArrayBase& other) const { return ckGetArrayID() == other.ckGetArrayID(); } @@ -176,7 +176,7 @@ class CProxyElement_ArrayBase : public CProxy_ArrayBase return *this; } - bool operator==(const CProxyElement_ArrayBase& other) + bool operator==(const CProxyElement_ArrayBase& other) const { return ckGetArrayID() == other.ckGetArrayID() && ckGetIndex() == other.ckGetIndex(); } diff --git a/src/ck-core/ckarrayindex.h b/src/ck-core/ckarrayindex.h index f140b53387..59b0a8dfa8 100644 --- a/src/ck-core/ckarrayindex.h +++ b/src/ck-core/ckarrayindex.h @@ -58,7 +58,7 @@ struct CkArrayIndexBase p((char *)this, sizeof(CkArrayIndexBase)); } - bool operator==(CkArrayIndexBase &other) { + bool operator==(const CkArrayIndexBase &other) const { if(nInts != other.nInts) return false; if(dimension != other.dimension) return false; for (int i=0;i