[Libreoffice-commits] .: i18npool/source regexp/orig
David Tardon
dtardon at kemper.freedesktop.org
Tue Oct 19 22:23:26 PDT 2010
i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx | 37 +++-------
regexp/orig/regex.c | 3
2 files changed, 14 insertions(+), 26 deletions(-)
New commits:
commit 362a83dde18e114b817c53459b76b953e3fb89a5
Author: David Tardon <dtardon at redhat.com>
Date: Wed Oct 20 07:23:14 2010 +0200
replace sizeof(foo)/sizeof(foo[0]) with SAL_N_ELEMENTS(foo)
diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
index 65cd795..91e098f 100644
--- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
+++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
@@ -45,6 +45,7 @@
#define S_CYR_B "\xD0\xB1"
#include <math.h>
+#include <sal/macros.h>
#include <rtl/ustring.hxx>
#include <rtl/ustrbuf.hxx>
#include <com/sun/star/i18n/XTransliteration.hpp>
@@ -558,79 +559,67 @@ DefaultNumberingProvider::makeNumberingString( const Sequence<beans::PropertyVal
case CHARS_CYRILLIC_UPPER_LETTER_BG:
lcl_formatChars2( table_CyrillicUpperLetter_bg,
table_CyrillicLowerLetter_bg,
- sizeof(table_CyrillicLowerLetter_bg) /
- sizeof(table_CyrillicLowerLetter_bg[0]), number-1,
+ SAL_N_ELEMENTS(table_CyrillicLowerLetter_bg), number-1,
result); // 1=>a, 2=>b, ..., 28=>z, 29=>Aa, 30=>Ab, ...
break;
case CHARS_CYRILLIC_LOWER_LETTER_BG:
lcl_formatChars( table_CyrillicLowerLetter_bg,
- sizeof(table_CyrillicLowerLetter_bg) /
- sizeof(table_CyrillicLowerLetter_bg[0]), number-1,
+ SAL_N_ELEMENTS(table_CyrillicLowerLetter_bg), number-1,
result); // 1=>a, 2=>b, ..., 28=>z, 29=>aa, 30=>ab, ...
break;
case CHARS_CYRILLIC_UPPER_LETTER_N_BG:
lcl_formatChars3( table_CyrillicUpperLetter_bg,
table_CyrillicLowerLetter_bg,
- sizeof(table_CyrillicLowerLetter_bg) /
- sizeof(table_CyrillicLowerLetter_bg[0]), number-1,
+ SAL_N_ELEMENTS(table_CyrillicLowerLetter_bg), number-1,
result); // 1=>a, 2=>b, ..., 28=>z, 29=>Aa, 30=>Bb, ...
break;
case CHARS_CYRILLIC_LOWER_LETTER_N_BG:
lcl_formatChars1( table_CyrillicLowerLetter_bg,
- sizeof(table_CyrillicLowerLetter_bg) /
- sizeof(table_CyrillicLowerLetter_bg[0]), number-1,
+ SAL_N_ELEMENTS(table_CyrillicLowerLetter_bg), number-1,
result); // 1=>a, 2=>b, ..., 28=>z, 29=>aa, 30=>bb, ...
break;
case CHARS_CYRILLIC_UPPER_LETTER_RU:
lcl_formatChars2( table_CyrillicUpperLetter_ru,
table_CyrillicLowerLetter_ru,
- sizeof(table_CyrillicLowerLetter_ru) /
- sizeof(table_CyrillicLowerLetter_ru[0]), number-1,
+ SAL_N_ELEMENTS(table_CyrillicLowerLetter_ru), number-1,
result); // 1=>a, 2=>b, ..., 27=>z, 28=>Aa, 29=>Ab, ...
break;
case CHARS_CYRILLIC_LOWER_LETTER_RU:
lcl_formatChars( table_CyrillicLowerLetter_ru,
- sizeof(table_CyrillicLowerLetter_ru) /
- sizeof(table_CyrillicLowerLetter_ru[0]), number-1,
+ SAL_N_ELEMENTS(table_CyrillicLowerLetter_ru), number-1,
result); // 1=>a, 2=>b, ..., 27=>z, 28=>aa, 29=>ab, ...
break;
case CHARS_CYRILLIC_UPPER_LETTER_N_RU:
lcl_formatChars3( table_CyrillicUpperLetter_ru,
table_CyrillicLowerLetter_ru,
- sizeof(table_CyrillicLowerLetter_ru) /
- sizeof(table_CyrillicLowerLetter_ru[0]), number-1,
+ SAL_N_ELEMENTS(table_CyrillicLowerLetter_ru), number-1,
result); // 1=>a, 2=>b, ..., 27=>z, 28=>Aa, 29=>Bb, ...
break;
case CHARS_CYRILLIC_LOWER_LETTER_N_RU:
lcl_formatChars1( table_CyrillicLowerLetter_ru,
- sizeof(table_CyrillicLowerLetter_ru) /
- sizeof(table_CyrillicLowerLetter_ru[0]), number-1,
+ SAL_N_ELEMENTS(table_CyrillicLowerLetter_ru), number-1,
result); // 1=>a, 2=>b, ..., 27=>z, 28=>aa, 29=>bb, ...
break;
case CHARS_CYRILLIC_UPPER_LETTER_SR:
lcl_formatChars2( table_CyrillicUpperLetter_sr,
table_CyrillicLowerLetter_sr,
- sizeof(table_CyrillicLowerLetter_sr) /
- sizeof(table_CyrillicLowerLetter_sr[0]), number-1,
+ SAL_N_ELEMENTS(table_CyrillicLowerLetter_sr), number-1,
result); // 1=>a, 2=>b, ..., 27=>z, 28=>Aa, 29=>Ab, ...
break;
case CHARS_CYRILLIC_LOWER_LETTER_SR:
lcl_formatChars( table_CyrillicLowerLetter_sr,
- sizeof(table_CyrillicLowerLetter_sr) /
- sizeof(table_CyrillicLowerLetter_sr[0]), number-1,
+ SAL_N_ELEMENTS(table_CyrillicLowerLetter_sr), number-1,
result); // 1=>a, 2=>b, ..., 27=>z, 28=>aa, 29=>ab, ...
break;
case CHARS_CYRILLIC_UPPER_LETTER_N_SR:
lcl_formatChars3( table_CyrillicUpperLetter_sr,
table_CyrillicLowerLetter_sr,
- sizeof(table_CyrillicLowerLetter_sr) /
- sizeof(table_CyrillicLowerLetter_sr[0]), number-1,
+ SAL_N_ELEMENTS(table_CyrillicLowerLetter_sr), number-1,
result); // 1=>a, 2=>b, ..., 27=>z, 28=>Aa, 29=>Bb, ...
break;
case CHARS_CYRILLIC_LOWER_LETTER_N_SR:
lcl_formatChars1( table_CyrillicLowerLetter_sr,
- sizeof(table_CyrillicLowerLetter_sr) /
- sizeof(table_CyrillicLowerLetter_sr[0]), number-1,
+ SAL_N_ELEMENTS(table_CyrillicLowerLetter_sr), number-1,
result); // 1=>a, 2=>b, ..., 27=>z, 28=>aa, 29=>bb, ...
break;
case CHARS_PERSIAN:
diff --git a/regexp/orig/regex.c b/regexp/orig/regex.c
index 6cde9f4..55be9ac 100644
--- a/regexp/orig/regex.c
+++ b/regexp/orig/regex.c
@@ -5817,8 +5817,7 @@ regerror (errcode, preg, errbuf, errbuf_size)
size_t msg_size;
if (errcode < 0
- || errcode >= (int) (sizeof (re_error_msgid_idx)
- / sizeof (re_error_msgid_idx[0])))
+ || errcode >= (int)SAL_N_ELEMENTS(re_error_msgid_idx))
/* Only error codes returned by the rest of the code should be passed
to this routine. If we are given anything else, or if other regex
code generates an invalid error code, then the program has a bug.
More information about the Libreoffice-commits
mailing list