From ec8c98f59869bee0e327d32f39480a0e4b1330bc Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 14 Jun 2017 11:31:15 +0200 Subject: use more SAL_N_ELEMENTS part 3 Change-Id: I82e366fefd2e31928b99840fe76649cc3521e623 Reviewed-on: https://gerrit.libreoffice.org/38789 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- i18nutil/source/utility/widthfolding.cxx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'i18nutil/source') diff --git a/i18nutil/source/utility/widthfolding.cxx b/i18nutil/source/utility/widthfolding.cxx index acc413598613..3b948025e318 100644 --- a/i18nutil/source/utility/widthfolding.cxx +++ b/i18nutil/source/utility/widthfolding.cxx @@ -220,9 +220,7 @@ oneToOneMapping& widthfolding::getfull2halfTableForASC() // // See the following page for detail: // http://wiki.openoffice.org/wiki/Calc/Features/JIS_and_ASC_functions - int i, j; - int n = sizeof(full2halfASCException) / sizeof(UnicodePairWithFlag); - for( i = 0; i < n; i++ ) + for( int i = 0; i < int(SAL_N_ELEMENTS(full2halfASCException)); i++ ) { const int high = (full2halfASCException[i].first >> 8) & 0xFF; const int low = (full2halfASCException[i].first) & 0xFF; @@ -231,7 +229,7 @@ oneToOneMapping& widthfolding::getfull2halfTableForASC() { table.mpIndex[high] = new UnicodePairWithFlag*[256]; - for( j = 0; j < 256; j++ ) + for( int j = 0; j < 256; j++ ) table.mpIndex[high][j] = nullptr; } table.mpIndex[high][low] = &full2halfASCException[i]; @@ -255,7 +253,7 @@ oneToOneMapping& widthfolding::gethalf2fullTableForJIS() // See the following page for detail: // http://wiki.openoffice.org/wiki/Calc/Features/JIS_and_ASC_functions int i, j; - int n = sizeof(half2fullJISException) / sizeof(UnicodePairWithFlag); + int n = SAL_N_ELEMENTS(half2fullJISException); for( i = 0; i < n; i++ ) { const int high = (half2fullJISException[i].first >> 8) & 0xFF; -- cgit