summaryrefslogtreecommitdiff
path: root/rsc/source
diff options
context:
space:
mode:
authorMatteo Casalin <matteo.casalin@yahoo.com>2016-03-01 23:21:02 +0100
committerMatteo Casalin <matteo.casalin@yahoo.com>2016-03-01 23:51:05 +0100
commitf00967cf38ed0c2c197284391fc521825bb3c2ac (patch)
treed1505cfff1707c51a74ece3091dcc25afbc5d778 /rsc/source
parent4845155e0126571e4176819c5f27b76160146ce0 (diff)
sal_uIntPtr/sal_uLong to Index (aka sal_uInt32) in UniqueIndex
Change-Id: I212cb3bb9d920741629fc4564bbd28b393e8fe00
Diffstat (limited to 'rsc/source')
-rw-r--r--rsc/source/parser/rscdb.cxx24
-rw-r--r--rsc/source/parser/rsclex.cxx2
-rw-r--r--rsc/source/parser/rscyacc.y1
-rw-r--r--rsc/source/rsc/rsc.cxx26
-rw-r--r--rsc/source/tools/rscdef.cxx49
5 files changed, 50 insertions, 52 deletions
diff --git a/rsc/source/parser/rscdb.cxx b/rsc/source/parser/rscdb.cxx
index c3c34e76c150..2c253e8736c4 100644
--- a/rsc/source/parser/rscdb.cxx
+++ b/rsc/source/parser/rscdb.cxx
@@ -297,13 +297,13 @@ sal_uInt32 RscTypCont::PutSysName( sal_uInt32 nRscTyp, char * pFileName,
return pSysEntry->nKey;
}
-void RscTypCont::WriteInc( FILE * fOutput, sal_uLong lFileKey )
+void RscTypCont::WriteInc( FILE * fOutput, RscFileTab::Index lFileKey )
{
- if( NOFILE_INDEX == lFileKey )
+ if( lFileKey == RscFileTab::IndexNotFound )
{
- sal_uIntPtr aIndex = aFileTab.FirstIndex();
- while( aIndex != UNIQUEINDEX_ENTRY_NOTFOUND )
+ RscFileTab::Index aIndex = aFileTab.FirstIndex();
+ while( aIndex != RscFileTab::IndexNotFound )
{
RscFile * pFName = aFileTab.Get( aIndex );
if( pFName->IsIncFile() )
@@ -503,7 +503,7 @@ ERRTYPE RscTypCont::WriteRc( WriteRcContext& rContext )
return aError;
}
-void RscTypCont::WriteSrc( FILE * fOutput, sal_uLong nFileKey,
+void RscTypCont::WriteSrc( FILE * fOutput, RscFileTab::Index nFileKey,
bool bName )
{
RscEnumerateRef aEnumRef( this, pRoot, fOutput );
@@ -517,10 +517,10 @@ void RscTypCont::WriteSrc( FILE * fOutput, sal_uLong nFileKey,
RscFile* pFName;
WriteInc( fOutput, nFileKey );
- if( NOFILE_INDEX == nFileKey )
+ if( nFileKey == RscFileTab::IndexNotFound )
{
- sal_uIntPtr aIndex = aFileTab.FirstIndex();
- while( aIndex != UNIQUEINDEX_ENTRY_NOTFOUND )
+ RscFileTab::Index aIndex = aFileTab.FirstIndex();
+ while( aIndex != RscFileTab::IndexNotFound )
{
pFName = aFileTab.Get( aIndex );
if( !pFName->IsIncFile() )
@@ -542,10 +542,10 @@ void RscTypCont::WriteSrc( FILE * fOutput, sal_uLong nFileKey,
else
{
RscId::SetNames( false );
- if( NOFILE_INDEX == nFileKey )
+ if( nFileKey == RscFileTab::IndexNotFound )
{
- sal_uIntPtr aIndex = aFileTab.FirstIndex();
- while( aIndex != UNIQUEINDEX_ENTRY_NOTFOUND )
+ RscFileTab::Index aIndex = aFileTab.FirstIndex();
+ while( aIndex != RscFileTab::IndexNotFound )
{
aEnumRef.WriteSrc( aIndex );
aIndex = aFileTab.NextIndex( aIndex );
@@ -579,7 +579,7 @@ IMPL_LINK_TYPED( RscDel, Delete, const NameNode&, r, void )
pNode->pObjBiTree = pNode->GetObjNode()->DelObjNode( pNode, lFileKey );
}
-void RscTypCont::Delete( sal_uLong lFileKey )
+void RscTypCont::Delete( RscFileTab::Index lFileKey )
{
// delete resource instance
RscDel aDel( pRoot, lFileKey );
diff --git a/rsc/source/parser/rsclex.cxx b/rsc/source/parser/rsclex.cxx
index 47c31877ef6e..f5f7c0cb7871 100644
--- a/rsc/source/parser/rsclex.cxx
+++ b/rsc/source/parser/rsclex.cxx
@@ -369,7 +369,7 @@ void IncludeParser( RscFileInst * pFileInst )
int nToken; // token value
YYSTYPE aYYSType; // token data
RscFile * pFName; // file structure
- sal_uLong lKey; // file key
+ RscFileTab::Index lKey; // file key
RscTypCont * pTypCon = pFileInst->pTypCont;
pFName = pTypCon->aFileTab.Get( pFileInst->GetFileIndex() );
diff --git a/rsc/source/parser/rscyacc.y b/rsc/source/parser/rscyacc.y
index c084d9b2e988..c0a9114ed3a1 100644
--- a/rsc/source/parser/rscyacc.y
+++ b/rsc/source/parser/rscyacc.y
@@ -20,6 +20,7 @@
#include "sal/config.h"
+#include <limits.h>
#include <stdio.h>
#include <ctype.h>
#include <string.h>
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index 77ec2b85aa7d..6d663a220344 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -333,8 +333,8 @@ ERRTYPE RscCompiler::Start()
pTC->pEH->SetListFile( nullptr );
- sal_uIntPtr aIndex = pTC->aFileTab.FirstIndex();
- while( aIndex != UNIQUEINDEX_ENTRY_NOTFOUND && aError.IsOk() )
+ RscFileTab::Index aIndex = pTC->aFileTab.FirstIndex();
+ while( aIndex != RscFileTab::IndexNotFound && aError.IsOk() )
{
pFName = pTC->aFileTab.Get( aIndex );
if( !pFName->bScanned && !pFName->IsIncFile() )
@@ -353,8 +353,8 @@ ERRTYPE RscCompiler::Start()
if ( pTC->pEH->GetVerbosity() >= RscVerbosityVerbose )
{
pTC->pEH->StdOut( "Files: " );
- sal_uIntPtr aIndex = pTC->aFileTab.FirstIndex();
- while( aIndex != UNIQUEINDEX_ENTRY_NOTFOUND )
+ RscFileTab::Index aIndex = pTC->aFileTab.FirstIndex();
+ while( aIndex != RscFileTab::IndexNotFound )
{
pFName = pTC->aFileTab.Get( aIndex );
pTC->pEH->StdOut( pFName->aFileName.getStr() );
@@ -395,13 +395,13 @@ void RscCompiler::EndCompile()
else
{
// write file
- sal_uIntPtr aIndex = pTC->aFileTab.FirstIndex();
- while( aIndex != UNIQUEINDEX_ENTRY_NOTFOUND )
+ RscFileTab::Index aIndex = pTC->aFileTab.FirstIndex();
+ while( aIndex != RscFileTab::IndexNotFound )
{
RscFile* pFN = pTC->aFileTab.Get( aIndex );
if( !pFN->IsIncFile() )
{
- pTC->WriteSrc( foutput, NOFILE_INDEX, false );
+ pTC->WriteSrc( foutput, RscFileTab::IndexNotFound, false );
break; // ?T 281091MM only one source file
}
}
@@ -572,8 +572,8 @@ ERRTYPE RscCompiler::Link()
for( it = pCL->m_aOutputFiles.begin(); it != pCL->m_aOutputFiles.end(); ++it )
{
// cleanup nodes
- for( sal_uIntPtr aIndex = pTC->aFileTab.FirstIndex();
- aIndex != UNIQUEINDEX_ENTRY_NOTFOUND && aError.IsOk();
+ for( RscFileTab::Index aIndex = pTC->aFileTab.FirstIndex();
+ aIndex != RscFileTab::IndexNotFound && aError.IsOk();
aIndex = pTC->aFileTab.NextIndex( aIndex ) )
{
pFName = pTC->aFileTab.Get( aIndex );
@@ -673,8 +673,8 @@ ERRTYPE RscCompiler::Link()
}
// parse files for specific language
- for( sal_uIntPtr aIndex = pTC->aFileTab.FirstIndex();
- aIndex != UNIQUEINDEX_ENTRY_NOTFOUND && aError.IsOk();
+ for( RscFileTab::Index aIndex = pTC->aFileTab.FirstIndex();
+ aIndex != RscFileTab::IndexNotFound && aError.IsOk();
aIndex = pTC->aFileTab.NextIndex( aIndex ) )
{
pFName = pTC->aFileTab.Get( aIndex );
@@ -725,8 +725,8 @@ ERRTYPE RscCompiler::Link()
else
{
// parse files
- for( sal_uIntPtr aIndex = pTC->aFileTab.FirstIndex();
- aIndex != UNIQUEINDEX_ENTRY_NOTFOUND && aError.IsOk();
+ for( RscFileTab::Index aIndex = pTC->aFileTab.FirstIndex();
+ aIndex != RscFileTab::IndexNotFound && aError.IsOk();
aIndex = pTC->aFileTab.NextIndex( aIndex ) )
{
pFName = pTC->aFileTab.Get( aIndex );
diff --git a/rsc/source/tools/rscdef.cxx b/rsc/source/tools/rscdef.cxx
index 155382de4917..c3dbffe28d88 100644
--- a/rsc/source/tools/rscdef.cxx
+++ b/rsc/source/tools/rscdef.cxx
@@ -21,6 +21,8 @@
// overall program includes
#include <rscdef.hxx>
+#include <limits.h>
+
bool RscId::bNames = true;
void RscId::SetNames( bool bSet )
@@ -489,24 +491,21 @@ RscFileTab::~RscFileTab()
aDefTree.Remove();
- sal_uIntPtr aIndex = LastIndex();
- while( aIndex != UNIQUEINDEX_ENTRY_NOTFOUND )
+ Index aIndex = LastIndex();
+ while( aIndex != IndexNotFound )
{
delete Remove( aIndex );
aIndex = LastIndex();
};
}
-sal_uLong RscFileTab::Find( const OString& rName )
+RscFileTab::Index RscFileTab::Find( const OString& rName )
{
- sal_uIntPtr aIndex = FirstIndex();
- while( aIndex != UNIQUEINDEX_ENTRY_NOTFOUND && (Get(aIndex)->aFileName != rName) )
+ Index aIndex = FirstIndex();
+ while( aIndex != IndexNotFound && (Get(aIndex)->aFileName != rName) )
aIndex = NextIndex(aIndex);
- if( aIndex != UNIQUEINDEX_ENTRY_NOTFOUND )
- return aIndex;
- else
- return NOFILE_INDEX;
+ return aIndex;
}
RscDefine * RscFileTab::FindDef( const char * pName )
@@ -516,13 +515,13 @@ RscDefine * RscFileTab::FindDef( const char * pName )
/* This method gives back true when lDepend
exists and is behind lFree, or when lDepend does not exist. */
-bool RscFileTab::Depend( sal_uLong lDepend, sal_uLong lFree )
+bool RscFileTab::Depend( Index lDepend, Index lFree )
{
if( lDepend == lFree )
return true;
- sal_uIntPtr aIndex = FirstIndex();
- while( aIndex != UNIQUEINDEX_ENTRY_NOTFOUND )
+ Index aIndex = FirstIndex();
+ while( aIndex != IndexNotFound )
{
RscFile * pFile = Get(aIndex);
if( !pFile->IsIncFile() )
@@ -536,7 +535,7 @@ bool RscFileTab::Depend( sal_uLong lDepend, sal_uLong lFree )
return true;
}
-bool RscFileTab::TestDef( sal_uLong lFileKey, size_t lPos,
+bool RscFileTab::TestDef( Index lFileKey, size_t lPos,
const RscDefine * pDefDec )
{
if( lFileKey == pDefDec->GetFileKey() )
@@ -554,7 +553,7 @@ bool RscFileTab::TestDef( sal_uLong lFileKey, size_t lPos,
return TestDef( lFileKey, lPos, pDefDec->pExp );
}
-bool RscFileTab::TestDef( sal_uLong lFileKey, size_t lPos,
+bool RscFileTab::TestDef( Index lFileKey, size_t lPos,
const RscExpression * pExpDec )
{
if( !pExpDec )
@@ -579,7 +578,7 @@ bool RscFileTab::TestDef( sal_uLong lFileKey, size_t lPos,
return true;
}
-RscDefine * RscFileTab::NewDef( sal_uLong lFileKey, const OString& rDefName,
+RscDefine * RscFileTab::NewDef( Index lFileKey, const OString& rDefName,
sal_Int32 lId, sal_uLong lPos )
{
RscDefine * pDef = FindDef( rDefName );
@@ -600,7 +599,7 @@ RscDefine * RscFileTab::NewDef( sal_uLong lFileKey, const OString& rDefName,
return pDef;
}
-RscDefine * RscFileTab::NewDef( sal_uLong lFileKey, const OString& rDefName,
+RscDefine * RscFileTab::NewDef( Index lFileKey, const OString& rDefName,
RscExpression * pExp, sal_uLong lPos )
{
RscDefine * pDef = FindDef( rDefName );
@@ -630,11 +629,9 @@ RscDefine * RscFileTab::NewDef( sal_uLong lFileKey, const OString& rDefName,
return pDef;
}
-void RscFileTab::DeleteFileContext( sal_uLong lFileKey )
+void RscFileTab::DeleteFileContext( Index lFileKey )
{
- RscFile * pFName;
-
- pFName = GetFile( lFileKey );
+ RscFile* pFName = GetFile( lFileKey );
if( pFName )
{
for ( size_t i = 0, n = pFName->aDefLst.maList.size(); i < n; ++i )
@@ -647,10 +644,10 @@ void RscFileTab::DeleteFileContext( sal_uLong lFileKey )
}
}
-sal_uLong RscFileTab::NewCodeFile( const OString& rName )
+RscFileTab::Index RscFileTab::NewCodeFile( const OString& rName )
{
- sal_uLong lKey = Find( rName );
- if( UNIQUEINDEX_ENTRY_NOTFOUND == lKey )
+ Index lKey = Find( rName );
+ if( lKey == IndexNotFound )
{
RscFile * pFName = new RscFile();
pFName->aFileName = rName;
@@ -661,11 +658,11 @@ sal_uLong RscFileTab::NewCodeFile( const OString& rName )
return lKey;
}
-sal_uLong RscFileTab::NewIncFile(const OString& rName,
+RscFileTab::Index RscFileTab::NewIncFile(const OString& rName,
const OString& rPath)
{
- sal_uLong lKey = Find( rName );
- if( UNIQUEINDEX_ENTRY_NOTFOUND == lKey )
+ Index lKey = Find( rName );
+ if( lKey == IndexNotFound )
{
RscFile * pFName = new RscFile();
pFName->aFileName = rName;