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 /connectivity/source/drivers/odbc | |
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 'connectivity/source/drivers/odbc')
-rw-r--r-- | connectivity/source/drivers/odbc/OPreparedStatement.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/connectivity/source/drivers/odbc/OPreparedStatement.cxx b/connectivity/source/drivers/odbc/OPreparedStatement.cxx index 67dfaeef65ed..74eb5c327b27 100644 --- a/connectivity/source/drivers/odbc/OPreparedStatement.cxx +++ b/connectivity/source/drivers/odbc/OPreparedStatement.cxx @@ -373,8 +373,8 @@ void OPreparedStatement::setParameter(const sal_Int32 parameterIndex, const sal_ SQLSMALLINT fCType, fSqlType; OTools::getBindTypes(useWChar, m_pConnection->useOldDateFormat(), OTools::jdbcTypeToOdbc(_nType), fCType, fSqlType); - SQLLEN *pDataLen=boundParams[parameterIndex-1].getBindLengthBuffer(); - *pDataLen=_nDataLen; + SQLLEN& rDataLen = boundParams[parameterIndex-1].getBindLengthBuffer(); + rDataLen = _nDataLen; SQLRETURN nRetcode; nRetcode = (*(T3SQLBindParameter)m_pConnection->getOdbcFunction(ODBC3SQLBindParameter))( @@ -389,7 +389,7 @@ void OPreparedStatement::setParameter(const sal_Int32 parameterIndex, const sal_ // we trust the ODBC driver not to touch it because SQL_PARAM_INPUT const_cast<void*>(_pData), _nDataAllocLen, - pDataLen); + &rDataLen); OTools::ThrowException(m_pConnection, nRetcode, m_aStatementHandle, SQL_HANDLE_STMT, *this); } @@ -742,7 +742,7 @@ SQLLEN* OPreparedStatement::getLengthBuf (sal_Int32 index) if ((index >= 1) && (index <= numParams)) { - b = boundParams[index - 1].getBindLengthBuffer (); + b = &boundParams[index - 1].getBindLengthBuffer (); } return b; |