summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-03-28 17:12:04 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-03-31 08:00:13 +0000
commit1aa4df615fa5599d05e9dd5e925b5852676185fa (patch)
tree1f637fa13140941a5775c91f058d0742f911693f /tools
parent2bd1e7aafeebdfe0e1656ed1ff01762039be5af1 (diff)
use SAL_N_ELEMENTS in for loops
for with git grep -n 'for.*sizeof' Change-Id: I6211024385e03ac5eeeb38690d2c1c699e015c2f Reviewed-on: https://gerrit.libreoffice.org/23569 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/source/inet/inetmime.cxx5
1 files changed, 2 insertions, 3 deletions
diff --git a/tools/source/inet/inetmime.cxx b/tools/source/inet/inetmime.cxx
index 539496cd0917..3491964f8628 100644
--- a/tools/source/inet/inetmime.cxx
+++ b/tools/source/inet/inetmime.cxx
@@ -2046,7 +2046,7 @@ struct EncodingEntry
// The source for the following table is <ftp://ftp.iana.org/in-notes/iana/
// assignments/character-sets> as of Jan, 21 2000 12:46:00, unless otherwise
// noted:
-EncodingEntry const aEncodingMap[]
+static EncodingEntry const aEncodingMap[]
= { { "US-ASCII", RTL_TEXTENCODING_ASCII_US },
{ "ANSI_X3.4-1968", RTL_TEXTENCODING_ASCII_US },
{ "ISO-IR-6", RTL_TEXTENCODING_ASCII_US },
@@ -2226,8 +2226,7 @@ EncodingEntry const aEncodingMap[]
rtl_TextEncoding getCharsetEncoding(sal_Char const * pBegin,
sal_Char const * pEnd)
{
- for (sal_Size i = 0; i < sizeof aEncodingMap / sizeof (EncodingEntry);
- ++i)
+ for (sal_Size i = 0; i < SAL_N_ELEMENTS(aEncodingMap); ++i)
if (equalIgnoreCase(pBegin, pEnd, aEncodingMap[i].m_aName))
return aEncodingMap[i].m_eEncoding;
return RTL_TEXTENCODING_DONTKNOW;