Skip to content

Commit

Permalink
Mark comparison operators in ck-core const
Browse files Browse the repository at this point in the history
  • Loading branch information
wthrowe committed Oct 16, 2024
1 parent 55b1360 commit 848e54b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/ck-core/charm++.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -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();
}

Expand Down
4 changes: 2 additions & 2 deletions src/ck-core/ckarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion src/ck-core/ckarrayindex.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<nInts;i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/ck-core/ckcallback.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class CkCallback {
bool isExtCallback = false;
#endif

bool operator==(CkCallback & other){
bool operator==(const CkCallback & other) const {
if(type != other.type)
return false;
switch (type) {
Expand Down
2 changes: 1 addition & 1 deletion src/ck-core/cksection.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class CkSectionInfo {
CkSectionInfo(int e, void *p, int r, CkArrayID _aid)
: val(p), aid(_aid), pe(e), redNo(r) { }

bool operator==(CkSectionInfo &other) const {
bool operator==(const CkSectionInfo &other) const {
return (val == other.val && aid == other.aid && pe == other.pe && redNo == other.redNo);
}

Expand Down

0 comments on commit 848e54b

Please sign in to comment.