summaryrefslogtreecommitdiff
path: root/i18nutil
diff options
context:
space:
mode:
Diffstat (limited to 'i18nutil')
-rw-r--r--i18nutil/source/utility/oneToOneMapping.cxx12
-rw-r--r--i18nutil/source/utility/widthfolding.cxx12
2 files changed, 11 insertions, 13 deletions
diff --git a/i18nutil/source/utility/oneToOneMapping.cxx b/i18nutil/source/utility/oneToOneMapping.cxx
index 39c74ded40bf..2ced0f898f41 100644
--- a/i18nutil/source/utility/oneToOneMapping.cxx
+++ b/i18nutil/source/utility/oneToOneMapping.cxx
@@ -38,10 +38,9 @@ sal_Unicode oneToOneMapping::find(const sal_Unicode nKey) const
// binary search
int bottom = 0;
int top = mnSize - 1;
- int current;
for (;;) {
- current = (top + bottom) / 2;
+ const int current = (top + bottom) / 2;
if( nKey < mpTable[current].first )
top = current - 1;
else if( nKey > mpTable[current].first )
@@ -78,15 +77,15 @@ void oneToOneMappingWithFlag::makeIndex()
{
if( !mbHasIndex && mpTableWF )
{
- int i, j, high, low, current = -1;
+ int i, j, current = -1;
for( i = 0; i < 256; i++ )
mpIndex[i] = NULL;
for( size_t k = 0; k < mnSize; k++ )
{
- high = (mpTableWF[k].first >> 8) & 0xFF;
- low = (mpTableWF[k].first) & 0xFF;
+ const int high = (mpTableWF[k].first >> 8) & 0xFF;
+ const int low = (mpTableWF[k].first) & 0xFF;
if( high != current )
{
current = high;
@@ -124,10 +123,9 @@ sal_Unicode oneToOneMappingWithFlag::find( const sal_Unicode nKey ) const
// binary search
int bottom = 0;
int top = mnSize - 1;
- int current;
for (;;) {
- current = (top + bottom) / 2;
+ const int current = (top + bottom) / 2;
if( nKey < mpTableWF[current].first )
top = current - 1;
else if( nKey > mpTableWF[current].first )
diff --git a/i18nutil/source/utility/widthfolding.cxx b/i18nutil/source/utility/widthfolding.cxx
index 2d3fcb1a93c9..a47152333eda 100644
--- a/i18nutil/source/utility/widthfolding.cxx
+++ b/i18nutil/source/utility/widthfolding.cxx
@@ -222,12 +222,12 @@ oneToOneMapping& widthfolding::getfull2halfTableForASC()
//
// See the following page for detail:
// http://wiki.openoffice.org/wiki/Calc/Features/JIS_and_ASC_functions
- int i, j, high, low;
+ int i, j;
int n = sizeof(full2halfASCException) / sizeof(UnicodePairWithFlag);
for( i = 0; i < n; i++ )
{
- high = (full2halfASCException[i].first >> 8) & 0xFF;
- low = (full2halfASCException[i].first) & 0xFF;
+ const int high = (full2halfASCException[i].first >> 8) & 0xFF;
+ const int low = (full2halfASCException[i].first) & 0xFF;
if( !table.mpIndex[high] )
{
@@ -256,12 +256,12 @@ oneToOneMapping& widthfolding::gethalf2fullTableForJIS()
//
// See the following page for detail:
// http://wiki.openoffice.org/wiki/Calc/Features/JIS_and_ASC_functions
- int i, j, high, low;
+ int i, j;
int n = sizeof(half2fullJISException) / sizeof(UnicodePairWithFlag);
for( i = 0; i < n; i++ )
{
- high = (half2fullJISException[i].first >> 8) & 0xFF;
- low = (half2fullJISException[i].first) & 0xFF;
+ const int high = (half2fullJISException[i].first >> 8) & 0xFF;
+ const int low = (half2fullJISException[i].first) & 0xFF;
if( !table.mpIndex[high] )
{