diff options
7 files changed, 28 insertions, 24 deletions
diff --git a/compilerplugins/clang/defaultparams.cxx b/compilerplugins/clang/defaultparams.cxx index 76cbeed2abaa..4127aa305ba9 100644 --- a/compilerplugins/clang/defaultparams.cxx +++ b/compilerplugins/clang/defaultparams.cxx @@ -25,10 +25,10 @@ public: virtual void run() override { TraverseDecl(compiler.getASTContext().getTranslationUnitDecl()); } - bool VisitCallExpr(const CallExpr * callExpr); + bool VisitCallExpr(CallExpr * callExpr); }; -bool DefaultParams::VisitCallExpr(const CallExpr * callExpr) { +bool DefaultParams::VisitCallExpr(CallExpr * callExpr) { if (ignoreLocation(callExpr)) { return true; } @@ -40,18 +40,22 @@ bool DefaultParams::VisitCallExpr(const CallExpr * callExpr) { } const FunctionDecl* functionDecl = callExpr->getDirectCallee()->getCanonicalDecl(); unsigned i = callExpr->getNumArgs() - 1; - const Expr* arg = callExpr->getArg(i); + Expr* arg = callExpr->getArg(i); // variadic functions if (i >= functionDecl->getNumParams()) { return true; } + if (arg->isDefaultArgument()) { + return true; + } + // ignore this, it seems to trigger an infinite recursion + if (isa<UnaryExprOrTypeTraitExpr>(arg)) + return true; const ParmVarDecl* parmVarDecl = functionDecl->getParamDecl(i); const Expr* defaultArgExpr = parmVarDecl->getDefaultArg(); - if (!arg->isDefaultArgument() && - arg->isIntegerConstantExpr(compiler.getASTContext()) && - parmVarDecl->hasDefaultArg() && - !parmVarDecl->hasUninstantiatedDefaultArg() && - defaultArgExpr->isIntegerConstantExpr(compiler.getASTContext())) + if (parmVarDecl->hasDefaultArg() && + defaultArgExpr && + defaultArgExpr->getType()->isIntegralType(compiler.getASTContext())) { APSInt x1, x2; if (arg->EvaluateAsInt(x1, compiler.getASTContext()) && @@ -63,17 +67,17 @@ bool DefaultParams::VisitCallExpr(const CallExpr * callExpr) { "not necessary to pass this argument, it defaults to the same value", arg->getSourceRange().getBegin()) << arg->getSourceRange(); - report( + /*report( DiagnosticsEngine::Warning, "default method parameter declaration here", parmVarDecl->getSourceRange().getBegin()) - << parmVarDecl->getSourceRange(); + << parmVarDecl->getSourceRange();*/ } } return true; } -loplugin::Plugin::Registration< DefaultParams > X("defaultparams", false); +loplugin::Plugin::Registration< DefaultParams > X("defaultparams"); } diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx index 9f61747ca42d..6b7bac4b9bc9 100644 --- a/connectivity/source/drivers/file/FResultSet.cxx +++ b/connectivity/source/drivers/file/FResultSet.cxx @@ -1164,7 +1164,7 @@ void OResultSet::sortRows() m_pSortIndex = new OSortIndex(eKeyType,m_aOrderbyAscending); - while ( ExecuteRow( IResultSetHelper::NEXT, 1, false, true ) ) + while ( ExecuteRow( IResultSetHelper::NEXT, 1, false ) ) { m_aSelectRow->get()[0]->setValue( m_aRow->get()[0]->getValue() ); if ( m_pSQLAnalyzer->hasFunctions() ) diff --git a/connectivity/source/drivers/firebird/PreparedStatement.cxx b/connectivity/source/drivers/firebird/PreparedStatement.cxx index 3a783788f2ef..f5cfdeeca9c3 100644 --- a/connectivity/source/drivers/firebird/PreparedStatement.cxx +++ b/connectivity/source/drivers/firebird/PreparedStatement.cxx @@ -317,7 +317,7 @@ void SAL_CALL OPreparedStatement::setNull(sal_Int32 nIndex, sal_Int32 /*nSqlType checkDisposed(OStatementCommonBase_Base::rBHelper.bDisposed); ensurePrepared(); - setParameterNull(nIndex, true); + setParameterNull(nIndex); } void SAL_CALL OPreparedStatement::setBoolean(sal_Int32 /*nIndex*/, sal_Bool /*bValue*/) diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx index 854ea2371773..fa80969e02c6 100644 --- a/connectivity/source/drivers/flat/ETable.cxx +++ b/connectivity/source/drivers/flat/ETable.cxx @@ -88,7 +88,7 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale) QuotedTokenizedString aFirstLine; if(bRead) { - bRead = readLine(&rowPos.second, &rowPos.first, false); + bRead = readLine(&rowPos.second, &rowPos.first); if(bRead) setRowPos(rowNum++, rowPos); } @@ -98,7 +98,7 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale) // use first non-empty row as headerline because we need the number of columns while(bRead && m_aCurrentLine.Len() == 0) { - bRead = readLine(&rowPos.second, &rowPos.first, false); + bRead = readLine(&rowPos.second, &rowPos.first); if(bRead) setRowPos(rowNum++, rowPos); } @@ -161,7 +161,7 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale) } } ++nRowCount; - bRead = readLine(&rowPos.second, &rowPos.first, false); + bRead = readLine(&rowPos.second, &rowPos.first); if(bRead) setRowPos(rowNum++, rowPos); } @@ -208,7 +208,7 @@ void OFlatTable::impl_fillColumnInfo_nothrow(QuotedTokenizedString& aFirstLine, if ( bNumeric ) { // first without fielddelimiter - OUString aField = aFirstLine.GetTokenSpecial(nStartPosFirstLine,m_cFieldDelimiter,'\0'); + OUString aField = aFirstLine.GetTokenSpecial(nStartPosFirstLine,m_cFieldDelimiter); if (aField.isEmpty() || (m_cStringDelimiter && m_cStringDelimiter == aField[0])) { @@ -299,7 +299,7 @@ void OFlatTable::impl_fillColumnInfo_nothrow(QuotedTokenizedString& aFirstLine, } else if ( io_nType == DataType::DATE || io_nType == DataType::TIMESTAMP || io_nType == DataType::TIME) { - OUString aField = aFirstLine.GetTokenSpecial(nStartPosFirstLine,m_cFieldDelimiter,'\0'); + OUString aField = aFirstLine.GetTokenSpecial(nStartPosFirstLine,m_cFieldDelimiter); if (aField.isEmpty() || (m_cStringDelimiter && m_cStringDelimiter == aField[0])) { @@ -375,7 +375,7 @@ void OFlatTable::impl_fillColumnInfo_nothrow(QuotedTokenizedString& aFirstLine, } else { - OUString aField = aFirstLine.GetTokenSpecial(nStartPosFirstLine,m_cFieldDelimiter,'\0'); + OUString aField = aFirstLine.GetTokenSpecial(nStartPosFirstLine,m_cFieldDelimiter); if (aField.isEmpty() || (m_cStringDelimiter && m_cStringDelimiter == aField[0])) { @@ -776,7 +776,7 @@ bool OFlatTable::seekRow(IResultSetHelper::Movement eCursorPosition, sal_Int32 n m_pFileStream->Seek(m_nFilePos); TRowPositionInFile newRowPos; - if(!readLine(&newRowPos.second, &newRowPos.first, false)) + if(!readLine(&newRowPos.second, &newRowPos.first)) { m_nMaxRowCount = m_nRowPos - 1; return false; diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx index 10186778d3c5..366fb61ebc46 100644 --- a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx +++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx @@ -1427,7 +1427,7 @@ static void columnMetaData2DatabaseTypeDescription( if( domains ) queryBuf.appendAscii( " OR " ); queryBuf.appendAscii( "oid = " ); - queryBuf.append( row->getInt(12 ), 10 ); + queryBuf.append( row->getInt(12 ) ); domains ++; } } diff --git a/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx b/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx index 61584a478e3c..461241c34ee7 100644 --- a/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx +++ b/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx @@ -168,7 +168,7 @@ void ResultSetMetaData::checkForTypes() buf.appendAscii( " OR " ); int oid = m_colDesc[i].typeOid; buf.appendAscii( "oid=" ); - buf.append( (sal_Int32) oid, 10 ); + buf.append( (sal_Int32) oid ); } Reference< XResultSet > rs = stmt->executeQuery( buf.makeStringAndClear() ); Reference< XRow > xRow( rs, UNO_QUERY ); diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx b/connectivity/source/drivers/postgresql/pq_statement.cxx index 87b33c6509d3..52eb1f29f272 100644 --- a/connectivity/source/drivers/postgresql/pq_statement.cxx +++ b/connectivity/source/drivers/postgresql/pq_statement.cxx @@ -480,7 +480,7 @@ bool executePostgresCommand( const OString & cmd, struct CommandData *data ) if( *(data->pLastOidInserted) ) { buf.append( ", usedOid=" ); - buf.append( *(data->pLastOidInserted) , 10 ); + buf.append( *(data->pLastOidInserted) ); buf.append( ", diagnosedTable=" ); buf.append( OUStringToOString( *data->pLastTableInserted, pSettings->encoding ) ); @@ -723,7 +723,7 @@ Reference< XResultSet > getGeneratedValuesFromLastInsert( else bufferQuoteIdentifier( buf, lastTableInserted, pConnectionSettings ); buf.append( " WHERE oid = " ); - buf.append( nLastOid , 10 ); + buf.append( nLastOid ); query = buf.makeStringAndClear(); } else if ( lastTableInserted.getLength() && lastQuery.getLength() ) |