Skip to content

Commit

Permalink
make Symbol methods const (#936)
Browse files Browse the repository at this point in the history
The following methods should be const methods of the class Symbol:
- getVersions
- getVersionFileName
- getVersionNum
- getVersionHidden
- getReferringSymbol
  • Loading branch information
kupsch committed Dec 16, 2020
1 parent 432630f commit 13ea0fa
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
12 changes: 6 additions & 6 deletions symtabAPI/h/Symbol.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class SYMTAB_EXPORT Symbol : public AnnotatableSparse
int getStrIndex() const { return strindex_; }
bool setStrIndex(int strindex) { strindex_ = strindex; return true; }
void setReferringSymbol (Symbol *referringSymbol);
Symbol* getReferringSymbol ();
Symbol* getReferringSymbol () const;

//////////////// Modification
bool setOffset (Offset newOffset);
Expand All @@ -236,17 +236,17 @@ class SYMTAB_EXPORT Symbol : public AnnotatableSparse
bool setVersionNum(unsigned verNum);
void setVersionHidden() { versionHidden_ = true; }

bool getVersionFileName(std::string &fileName);
bool getVersions(std::vector<std::string> *&vers);
bool getVersionNum(unsigned &verNum);
bool getVersionHidden() { return versionHidden_; }
bool getVersionFileName(std::string &fileName) const;
bool getVersions(std::vector<std::string> *&vers) const;
bool getVersionNum(unsigned &verNum) const;
bool getVersionHidden() const { return versionHidden_; }

friend
std::ostream& operator<< (std::ostream &os, const Symbol &s);

public:
static std::string emptyString;
int getInternalType() { return internal_type_; }
int getInternalType() const { return internal_type_; }
void setInternalType(int i) { internal_type_ = i; }

private:
Expand Down
7 changes: 4 additions & 3 deletions symtabAPI/src/Symbol.C
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ SYMTAB_EXPORT bool Symbol::setVersions(std::vector<std::string> &vers)
return true;
}

SYMTAB_EXPORT bool Symbol::getVersionFileName(std::string &fileName)
SYMTAB_EXPORT bool Symbol::getVersionFileName(std::string &fileName) const
{
std::string *fn_p = NULL;

Expand All @@ -224,7 +224,7 @@ SYMTAB_EXPORT bool Symbol::getVersionFileName(std::string &fileName)
return false;
}

SYMTAB_EXPORT bool Symbol::getVersions(std::vector<std::string> *&vers)
SYMTAB_EXPORT bool Symbol::getVersions(std::vector<std::string> *&vers) const
{
std::vector<std::string> *vn_p = NULL;

Expand Down Expand Up @@ -409,7 +409,8 @@ void Symbol::setReferringSymbol(Symbol* referringSymbol)
referring_= referringSymbol;
}

Symbol* Symbol::getReferringSymbol() {
Symbol* Symbol::getReferringSymbol() const
{
return referring_;
}

0 comments on commit 13ea0fa

Please sign in to comment.