summaryrefslogtreecommitdiff
path: root/l10ntools
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-05-27 16:33:44 +0200
committerNoel Grandin <noel@peralex.com>2015-05-28 12:49:54 +0200
commitd5129a9dd68978f9eccdd4597b5b6834557c422a (patch)
treedf43250172f784f3048ce42ce1c3410d1d449c1e /l10ntools
parentf3331f7694e74f349375c223ce7ed84838e92d89 (diff)
new clang plugin: loopvartoosmall
Idea from bubli - look for loops where the index variable is of such size that it cannot cover the range revealed by examining the length part of the condition. So far, I have only run the plugin up till the VCL module. Also the plugin deliberately excludes anything more complicated than a straightforward incrementing for loop. Change-Id: Ifced18b01c03ea537c64168465ce0b8287a42015
Diffstat (limited to 'l10ntools')
-rw-r--r--l10ntools/source/cfgmerge.cxx2
-rw-r--r--l10ntools/source/export.cxx8
-rw-r--r--l10ntools/source/propmerge.cxx4
-rw-r--r--l10ntools/source/xrmmerge.cxx4
4 files changed, 9 insertions, 9 deletions
diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx
index d68327d29e70..5093bd4adfb1 100644
--- a/l10ntools/source/cfgmerge.cxx
+++ b/l10ntools/source/cfgmerge.cxx
@@ -470,7 +470,7 @@ void CfgMerge::WorkOnResourceEnd()
if ( pEntrys ) {
OString sCur;
- for( unsigned int i = 0; i < aLanguages.size(); ++i ){
+ for( size_t i = 0; i < aLanguages.size(); ++i ){
sCur = aLanguages[ i ];
OString sContent;
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index ced58e3c473a..25b2cdbf31b6 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -662,7 +662,7 @@ int Export::Execute( int nToken, const char * pToken )
// the current token must be written to dest. without merging
if( bDefine && sOrig.getLength() > 2 ){
- for( sal_uInt16 n = 0 ; n < sOrig.getLength() ; n++ ){
+ for( sal_Int32 n = 0; n < sOrig.getLength(); n++ ){
if( sOrig[n] == '\n' && sOrig[n-1] != '\\'){
sOrig = sOrig.replaceAt(n++, 0, "\\");
}
@@ -1019,7 +1019,7 @@ void Export::ResData2Output( MergeEntrys *pEntry, sal_uInt16 nType, const OStrin
bool bFirst = true;
OString sCur;
- for( unsigned int n = 0; n < aLanguages.size(); n++ ){
+ for( size_t n = 0; n < aLanguages.size(); n++ ){
sCur = aLanguages[ n ];
OString sText;
@@ -1048,7 +1048,7 @@ void Export::ResData2Output( MergeEntrys *pEntry, sal_uInt16 nType, const OStrin
sOutput.append(";\n");
else
bAddSemicolon = true;
- for ( sal_uInt16 j = 1; j < nLevel; j++ )
+ for ( size_t j = 1; j < nLevel; j++ )
sOutput.append("\t");
WriteToMerged( sOutput.makeStringAndClear() , true );
}
@@ -1103,7 +1103,7 @@ void Export::MergeRest( ResData *pResData )
sSpace += "\t";
OString sCur;
- for( unsigned int n = 0; n < aLanguages.size(); n++ )
+ for( size_t n = 0; n < aLanguages.size(); n++ )
{
sCur = aLanguages[ n ];
diff --git a/l10ntools/source/propmerge.cxx b/l10ntools/source/propmerge.cxx
index a41cd154d4c3..513cb79cb59c 100644
--- a/l10ntools/source/propmerge.cxx
+++ b/l10ntools/source/propmerge.cxx
@@ -135,7 +135,7 @@ void PropParser::Extract( const OString& rPOFile )
return;
}
- for( unsigned nIndex = 0; nIndex < m_vLines.size(); ++nIndex )
+ for( size_t nIndex = 0; nIndex < m_vLines.size(); ++nIndex )
{
const OString sLine = m_vLines[nIndex];
const sal_Int32 nEqualSign = sLine.indexOf('=');
@@ -184,7 +184,7 @@ void PropParser::Merge( const OString &rMergeSrc, const OString &rDestinationFil
}
}
- for( unsigned nIndex = 0; nIndex < m_vLines.size(); ++nIndex )
+ for( size_t nIndex = 0; nIndex < m_vLines.size(); ++nIndex )
{
const OString sLine = m_vLines[nIndex];
const sal_Int32 nEqualSign = sLine.indexOf('=');
diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx
index 421195d54e10..b47c7c38dcdd 100644
--- a/l10ntools/source/xrmmerge.cxx
+++ b/l10ntools/source/xrmmerge.cxx
@@ -413,7 +413,7 @@ void XRMResMerge::WorkOnDesc(
if ( pEntrys ) {
OString sCur;
OString sDescFilename = GetAttribute ( rOpenTag, "xlink:href" );
- for( unsigned int n = 0; n < aLanguages.size(); n++ ){
+ for( size_t n = 0; n < aLanguages.size(); n++ ){
sCur = aLanguages[ n ];
OString sContent;
if ( !sCur.equalsIgnoreAsciiCase("en-US") &&
@@ -502,7 +502,7 @@ void XRMResMerge::EndOfText(
MergeEntrys *pEntrys = pMergeDataFile->GetMergeEntrys( pResData );
if ( pEntrys ) {
OString sCur;
- for( unsigned int n = 0; n < aLanguages.size(); n++ ){
+ for( size_t n = 0; n < aLanguages.size(); n++ ){
sCur = aLanguages[ n ];
OString sContent;
if (!sCur.equalsIgnoreAsciiCase("en-US") &&