From 4d87443bf59c3242d58b56cc1583d73213ae1f2f Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 29 Sep 2016 12:43:17 +0200 Subject: loplugin:constantparam Change-Id: Idbe8c8e6b3d44cacce296ec8c79b2b244281057c Reviewed-on: https://gerrit.libreoffice.org/29321 Tested-by: Jenkins Reviewed-by: Noel Grandin --- rsc/inc/rscclass.hxx | 2 +- rsc/inc/rsccont.hxx | 3 +-- rsc/inc/rscdef.hxx | 6 +++--- rsc/source/parser/rscibas.cxx | 6 +++--- rsc/source/parser/rsclex.cxx | 4 ++-- rsc/source/parser/rscyacc.y | 7 +++---- rsc/source/res/rscclass.cxx | 4 ++-- rsc/source/res/rsccont.cxx | 9 ++++----- rsc/source/tools/rscdef.cxx | 29 +++++++++-------------------- 9 files changed, 28 insertions(+), 42 deletions(-) (limited to 'rsc') diff --git a/rsc/inc/rscclass.hxx b/rsc/inc/rscclass.hxx index ed028e3651a9..ef0295bf18c5 100644 --- a/rsc/inc/rscclass.hxx +++ b/rsc/inc/rscclass.hxx @@ -115,7 +115,7 @@ public: class RscTupel : public RscClass { public: - RscTupel( Atom nId, sal_uInt32 nTypId, RscTop * pSuper ); + RscTupel( Atom nId, sal_uInt32 nTypId ); RSCINST GetTupelVar( const RSCINST & rInst, sal_uInt32 nPos, const RSCINST & rInitInst ) override; void WriteSrc( const RSCINST & rInst, FILE * fOutput, diff --git a/rsc/inc/rsccont.hxx b/rsc/inc/rsccont.hxx index 2843c6ca397b..d7f58d4c78e9 100644 --- a/rsc/inc/rsccont.hxx +++ b/rsc/inc/rsccont.hxx @@ -106,8 +106,7 @@ public: class RscContWriteSrc : public RscBaseCont { public: - RscContWriteSrc( Atom nId, sal_uInt32 nTypId, - RscTop * pSuper = nullptr ); + RscContWriteSrc( Atom nId, sal_uInt32 nTypId ); void WriteSrc( const RSCINST & rInst, FILE * fOutput, RscTypCont * pTC, sal_uInt32 nTab, const char * ) override; }; diff --git a/rsc/inc/rscdef.hxx b/rsc/inc/rscdef.hxx index 80ef6aba60bf..279be92cbcf1 100644 --- a/rsc/inc/rscdef.hxx +++ b/rsc/inc/rscdef.hxx @@ -211,7 +211,7 @@ public: RscFile(); ~RscFile(); - void InsertDependFile( sal_uLong lDepFile, size_t lPos ); + void InsertDependFile( sal_uLong lDepFile ); bool Depend( sal_uLong lDepend, sal_uLong lFree ); void SetIncFlag(){ bIncFile = true; }; bool IsIncFile(){ return bIncFile; }; @@ -256,9 +256,9 @@ public: const RscExpression * pExpDec ); RscDefine * NewDef( Index lKey, const OString& rDefName, - sal_Int32 lId, sal_uLong lPos ); + sal_Int32 lId ); RscDefine * NewDef( Index lKey, const OString& rDefName, - RscExpression *, sal_uLong lPos ); + RscExpression * ); // deletes all defines defined in this file void DeleteFileContext( Index lKey ); diff --git a/rsc/source/parser/rscibas.cxx b/rsc/source/parser/rscibas.cxx index 6c1ee886a2a5..c397ae4ff823 100644 --- a/rsc/source/parser/rscibas.cxx +++ b/rsc/source/parser/rscibas.cxx @@ -380,7 +380,7 @@ RscTupel * RscTypCont::InitGeometry() // Clientvariablen einfuegen pTupel = new RscTupel( pHS->getID( "TupelDeltaSystem" ), - RSC_NOTYPE, nullptr ); + RSC_NOTYPE ); nId = aNmTb.Put( "X", VARNAME ); pTupel->SetVariable( nId, &aShort ); nId = aNmTb.Put( "Y", VARNAME ); @@ -420,7 +420,7 @@ RscTupel * RscTypCont::InitStringTupel() Atom nId; // Clientvariablen einfuegen - pTupel = new RscTupel( pHS->getID( "CharsTupel" ), RSC_NOTYPE, nullptr ); + pTupel = new RscTupel( pHS->getID( "CharsTupel" ), RSC_NOTYPE ); nId = aNmTb.Put( "FILTER", VARNAME ); pTupel->SetVariable( nId, &aString ); nId = aNmTb.Put( "MASK", VARNAME ); @@ -435,7 +435,7 @@ RscTupel * RscTypCont::InitStringLongTupel() Atom nId; // Clientvariablen einfuegen - pTupel = new RscTupel( pHS->getID( "CharsLongTupel" ), RSC_NOTYPE, nullptr ); + pTupel = new RscTupel( pHS->getID( "CharsLongTupel" ), RSC_NOTYPE ); nId = aNmTb.Put( "ItemText", VARNAME ); pTupel->SetVariable( nId, &aString ); nId = aNmTb.Put( "ItemId", VARNAME ); diff --git a/rsc/source/parser/rsclex.cxx b/rsc/source/parser/rsclex.cxx index 1a665c1664d7..a1a32320f77b 100644 --- a/rsc/source/parser/rsclex.cxx +++ b/rsc/source/parser/rsclex.cxx @@ -386,13 +386,13 @@ void IncludeParser( RscFileInst * pFileInst ) { lKey = pTypCon->aFileTab.NewIncFile( aYYSType.string, aYYSType.string ); - pFName->InsertDependFile( lKey, ULONG_MAX ); + pFName->InsertDependFile( lKey ); } else if( INCLUDE_STRING == nToken ) { lKey = pTypCon->aFileTab.NewIncFile( aYYSType.string, OString() ); - pFName->InsertDependFile( lKey, ULONG_MAX ); + pFName->InsertDependFile( lKey ); } } } diff --git a/rsc/source/parser/rscyacc.y b/rsc/source/parser/rscyacc.y index 43272f2fc8c8..bf020892ed76 100644 --- a/rsc/source/parser/rscyacc.y +++ b/rsc/source/parser/rscyacc.y @@ -382,7 +382,7 @@ resource_definition { if( !pTC->aFileTab.NewDef( pFI->GetFileIndex(), rtl::OString( $3 ), - $4.GetLong(), ULONG_MAX ) ) + $4.GetLong() ) ) bError = true; } else if( $4.IsDefinition() ) @@ -397,7 +397,7 @@ resource_definition pExpr = new RscExpression( aExpType, '+', $4 ); if( !pTC->aFileTab.NewDef( pFI->GetFileIndex(), - rtl::OString( $3 ), pExpr, ULONG_MAX ) ) + rtl::OString( $3 ), pExpr ) ) { bError =true; } @@ -405,8 +405,7 @@ resource_definition else if( $4.IsExpression() ) { if( !pTC->aFileTab.NewDef( pFI->GetFileIndex(), - rtl::OString( $3 ), $4.aExp.pExp, - ULONG_MAX ) ) + rtl::OString( $3 ), $4.aExp.pExp ) ) { bError = true; } diff --git a/rsc/source/res/rscclass.cxx b/rsc/source/res/rscclass.cxx index 366d6836b068..a5f9e4f59e91 100644 --- a/rsc/source/res/rscclass.cxx +++ b/rsc/source/res/rscclass.cxx @@ -832,8 +832,8 @@ ERRTYPE RscSysDepend::WriteRc( const RSCINST & rInst, RscWriteRc & rMem, return aError; } -RscTupel::RscTupel( Atom nId, sal_uInt32 nTypeId, RscTop * pSuper ) - : RscClass( nId, nTypeId, pSuper ) +RscTupel::RscTupel( Atom nId, sal_uInt32 nTypeId ) + : RscClass( nId, nTypeId, nullptr ) { } diff --git a/rsc/source/res/rsccont.cxx b/rsc/source/res/rsccont.cxx index c6c50dd8b0e6..a48767089f0e 100644 --- a/rsc/source/res/rsccont.cxx +++ b/rsc/source/res/rsccont.cxx @@ -719,9 +719,8 @@ ERRTYPE RscBaseCont::WriteRc( const RSCINST & rInst, RscWriteRc & rMem, return aError; } -RscContWriteSrc::RscContWriteSrc( Atom nId, sal_uInt32 nTypeId, - RscTop * pSuper ) - : RscBaseCont( nId, nTypeId, pSuper, true ) +RscContWriteSrc::RscContWriteSrc( Atom nId, sal_uInt32 nTypeId ) + : RscBaseCont( nId, nTypeId, nullptr, true ) { } @@ -748,7 +747,7 @@ void RscContWriteSrc::WriteSrc( const RSCINST & rInst, FILE * fOutput, } RscCont::RscCont( Atom nId, sal_uInt32 nTypeId ) - : RscContWriteSrc( nId, nTypeId, nullptr ) + : RscContWriteSrc( nId, nTypeId ) { } @@ -771,7 +770,7 @@ ERRTYPE RscCont::WriteRc( const RSCINST & rInst, RscWriteRc & rMem, } RscContExtraData::RscContExtraData( Atom nId, sal_uInt32 nTypeId ) - : RscContWriteSrc( nId, nTypeId, nullptr ) + : RscContWriteSrc( nId, nTypeId ) { } diff --git a/rsc/source/tools/rscdef.cxx b/rsc/source/tools/rscdef.cxx index be4ea3ff2477..0d2595bee4ac 100644 --- a/rsc/source/tools/rscdef.cxx +++ b/rsc/source/tools/rscdef.cxx @@ -386,7 +386,7 @@ bool RscFile::Depend( sal_uLong lDepend, sal_uLong lFree ) return true; } -void RscFile::InsertDependFile( sal_uLong lIncFile, size_t lPos ) +void RscFile::InsertDependFile( sal_uLong lIncFile ) { for ( size_t i = 0, n = aDepLst.size(); i < n; ++i ) { @@ -395,18 +395,7 @@ void RscFile::InsertDependFile( sal_uLong lIncFile, size_t lPos ) return; } - // current pointer points to last element - if( lPos >= aDepLst.size() ) - { // the last element must always stay the last one - // put dependency before the last position - aDepLst.push_back( new RscDepend( lIncFile ) ); - } - else - { - RscDependList::iterator it = aDepLst.begin(); - ::std::advance( it, lPos ); - aDepLst.insert( it, new RscDepend( lIncFile ) ); - } + aDepLst.push_back( new RscDepend( lIncFile ) ); } RscDefTree::~RscDefTree() @@ -559,7 +548,7 @@ bool RscFileTab::TestDef( Index lFileKey, size_t lPos, } RscDefine * RscFileTab::NewDef( Index lFileKey, const OString& rDefName, - sal_Int32 lId, sal_uLong lPos ) + sal_Int32 lId ) { RscDefine * pDef = FindDef( rDefName ); @@ -569,7 +558,7 @@ RscDefine * RscFileTab::NewDef( Index lFileKey, const OString& rDefName, if( pFile ) { - pDef = pFile->aDefLst.New( lFileKey, rDefName, lId, lPos ); + pDef = pFile->aDefLst.New( lFileKey, rDefName, lId, ULONG_MAX ); aDefTree.Insert( pDef ); } } @@ -580,20 +569,20 @@ RscDefine * RscFileTab::NewDef( Index lFileKey, const OString& rDefName, } RscDefine * RscFileTab::NewDef( Index lFileKey, const OString& rDefName, - RscExpression * pExp, sal_uLong lPos ) + RscExpression * pExp ) { RscDefine * pDef = FindDef( rDefName ); if( !pDef ) { // are macros in expressions defined? - if( TestDef( lFileKey, lPos, pExp ) ) + if( TestDef( lFileKey, ULONG_MAX, pExp ) ) { RscFile * pFile = GetFile( lFileKey ); if( pFile ) { - pDef = pFile->aDefLst.New( lFileKey, rDefName, pExp, lPos ); + pDef = pFile->aDefLst.New( lFileKey, rDefName, pExp, ULONG_MAX ); aDefTree.Insert( pDef ); } } @@ -633,7 +622,7 @@ RscFileTab::Index RscFileTab::NewCodeFile( const OString& rName ) pFName->aFileName = rName; pFName->aPathName = rName; lKey = Insert( pFName ); - pFName->InsertDependFile( lKey, ULONG_MAX ); + pFName->InsertDependFile( lKey ); } return lKey; } @@ -649,7 +638,7 @@ RscFileTab::Index RscFileTab::NewIncFile(const OString& rName, pFName->aPathName = rPath; pFName->SetIncFlag(); lKey = Insert( pFName ); - pFName->InsertDependFile( lKey, ULONG_MAX ); + pFName->InsertDependFile( lKey ); } return lKey; } -- cgit