diff options
author | Noel Grandin <noel@peralex.com> | 2014-06-18 12:14:29 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-06-24 11:34:21 +0200 |
commit | e2080e70fe8b085f18e868e46340454720fa94ca (patch) | |
tree | 4038d1d57b41b68a47d5ebbbe6ad390648ec6303 /lotuswordpro/source/filter/bento.hxx | |
parent | f910280b8704ed9c289150a4ca3c8d60e15d0d97 (diff) |
new compilerplugin returnbyref
Find places where we are returning a pointer to something, where we can
be returning a reference.
e.g.
class A {
struct X x;
public X* getX() { return &x; }
}
which can be:
public X& getX() { return x; }
Change-Id: I796fd23fd36a18aedf6e36bc28f8fab4f518c6c7
Diffstat (limited to 'lotuswordpro/source/filter/bento.hxx')
-rw-r--r-- | lotuswordpro/source/filter/bento.hxx | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/lotuswordpro/source/filter/bento.hxx b/lotuswordpro/source/filter/bento.hxx index 1940e16d7a10..677533105fb8 100644 --- a/lotuswordpro/source/filter/bento.hxx +++ b/lotuswordpro/source/filter/bento.hxx @@ -225,8 +225,8 @@ public: // Internal methods BenObjectID GetNextAvailObjectID() { return cNextAvailObjectID; } void SetNextAvailObjectID(BenObjectID ID) { cNextAvailObjectID = ID; } - pCUtList GetObjects() { return &cObjects; } - pCUtList GetNamedObjects() { return &cNamedObjects; } + CUtList& GetObjects() { return cObjects; } + CUtList& GetNamedObjects() { return cNamedObjects; } LtcUtBenValueStream * FindNextValueStreamWithPropertyName(const char * sPropertyName, LtcUtBenValueStream * pCurrentValueStream); LtcUtBenValueStream * FindValueStreamWithPropertyName(const char * sPropertyName); @@ -257,7 +257,7 @@ public: // Internal methods CBenObject(pLtcBenContainer pContainer, BenObjectID ObjectID, pCBenIDListElmt pPrev) : CBenIDListElmt(ObjectID, pPrev) { cpContainer = pContainer; } - pCUtList GetProperties() { return &cProperties; } + CUtList& GetProperties() { return cProperties; } private: // Data pLtcBenContainer cpContainer; @@ -296,7 +296,7 @@ public: // Internal methods inline pCBenValueSegment GetNextValueSegment(pCBenValueSegment pCurrValueSegment); inline pLtcBenContainer GetContainer(); - pCUtList GetValueSegments() { return &cValueSegments; } + CUtList& GetValueSegments() { return cValueSegments; } // Currently, no generation support BenGeneration GetGeneration() { return 1; } @@ -313,7 +313,7 @@ public: // different type. But we never use it that way, so in this code a // property has exactly one value - pCBenValue UseValue() { return &cValue; } + CBenValue& UseValue() { return cValue; } pCBenObject GetBenObject() { return cpObject; } pLtcBenContainer GetContainer() { return GetBenObject()->GetContainer(); } @@ -351,11 +351,11 @@ class CBenValueSegment : public CUtListElmt { public: // Internal methods CBenValueSegment(pCBenValue pValue, BenContainerPos Pos, - unsigned long Size) : CUtListElmt(pValue->GetValueSegments()) + unsigned long Size) : CUtListElmt(&pValue->GetValueSegments()) { cpValue = pValue; cImmediate = false; cPos = Pos; cSize = Size; } CBenValueSegment(pCBenValue pValue, BenConstDataPtr pImmData, - unsigned short Size) : CUtListElmt(pValue->GetValueSegments()) + unsigned short Size) : CUtListElmt(&pValue->GetValueSegments()) { cpValue = pValue; cImmediate = true; UtHugeMemcpy(cImmData, pImmData, Size); cSize = Size; } CBenValueSegment(BenContainerPos Pos, unsigned long Size) @@ -366,7 +366,7 @@ public: // Internal methods UtHugeMemcpy(cImmData, pImmData, Size); cSize = Size; } bool IsLast() { - return cpValue == NULL || cpValue->GetValueSegments()->GetLast() == + return cpValue == NULL || cpValue->GetValueSegments().GetLast() == this; } bool IsImmediate() { return cImmediate; } @@ -411,7 +411,7 @@ public: // Internal methods void SetPosition(BenContainerPos Pos) { cPos = Pos; } BenContainerPos GetPosition(void) { return cPos; } size_t GetLength(void) { return csName.length()+ 1; } - pCBenNamedObjectListElmt GetNameListElmt() { return &cNameListElmt; } + CBenNamedObjectListElmt& GetNameListElmt() { return cNameListElmt; } private: // Data std::string csName; |