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/benlist.cxx | |
parent | Translated German comments - correction (diff) | |
download | core-e2080e70fe8b085f18e868e46340454720fa94ca.tar.gz core-e2080e70fe8b085f18e868e46340454720fa94ca.zip |
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/benlist.cxx')
-rw-r--r-- | lotuswordpro/source/filter/benlist.cxx | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lotuswordpro/source/filter/benlist.cxx b/lotuswordpro/source/filter/benlist.cxx index c2ec1235134a..39943c470c86 100644 --- a/lotuswordpro/source/filter/benlist.cxx +++ b/lotuswordpro/source/filter/benlist.cxx @@ -61,8 +61,8 @@ pCBenNamedObject FindNamedObject(pCUtList pList, const char * sName, pCBenNamedObjectListElmt * ppPrev) { - pCUtListElmt pTerminating = pList->GetTerminating(); - for (pCUtListElmt pCurr = pList->GetLast(); pCurr != pTerminating; + CUtListElmt& rTerminating = pList->GetTerminating(); + for (pCUtListElmt pCurr = pList->GetLast(); pCurr != &rTerminating; pCurr = pCurr->GetPrev()) { pCBenNamedObjectListElmt pCurrNamedObjectListElmt = @@ -84,7 +84,7 @@ FindNamedObject(pCUtList pList, const char * sName, } if (ppPrev != NULL) - *ppPrev = (pCBenNamedObjectListElmt) pTerminating; + *ppPrev = (pCBenNamedObjectListElmt) &rTerminating; return NULL; } @@ -92,8 +92,8 @@ FindNamedObject(pCUtList pList, const char * sName, pCBenIDListElmt FindID(pCUtList pList, BenObjectID ObjectID, pCBenIDListElmt * ppPrev) { - pCUtListElmt pTerminating = pList->GetTerminating(); - for (pCUtListElmt pCurr = pList->GetLast(); pCurr != pTerminating; + CUtListElmt& rTerminating = pList->GetTerminating(); + for (pCUtListElmt pCurr = pList->GetLast(); pCurr != &rTerminating; pCurr = pCurr->GetPrev()) { pCBenIDListElmt pCurrIDListElmt = (pCBenIDListElmt) pCurr; @@ -111,7 +111,7 @@ FindID(pCUtList pList, BenObjectID ObjectID, pCBenIDListElmt * ppPrev) } if (ppPrev != NULL) - *ppPrev = (pCBenIDListElmt) pTerminating; + *ppPrev = (pCBenIDListElmt) &rTerminating; return NULL; } } //end namespace OpenStormBento |