From 39fc2df3c1d8e8bc8b689e2d21c193bc4886bf8c Mon Sep 17 00:00:00 2001 From: Kenneth Venken Date: Fri, 3 Dec 2010 13:59:47 +0000 Subject: more Sal n elements --- extensions/source/nsplugin/source/so_main.cxx | 4 ++-- extensions/source/propctrlr/formmetadata.cxx | 4 ++-- extensions/source/update/check/updatecheck.cxx | 5 +++-- extensions/source/update/check/updatecheckconfig.cxx | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-) (limited to 'extensions') diff --git a/extensions/source/nsplugin/source/so_main.cxx b/extensions/source/nsplugin/source/so_main.cxx index 76381fab9c61..f2f6c131d610 100644 --- a/extensions/source/nsplugin/source/so_main.cxx +++ b/extensions/source/nsplugin/source/so_main.cxx @@ -66,6 +66,7 @@ #include "nsp_func.hxx" #include "sal/main.h" +#include #include "rtl/process.h" #include "rtl/bootstrap.hxx" @@ -85,7 +86,6 @@ #include "com/sun/star/bridge/XUnoUrlResolver.hpp" #define OUSTR(x) ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(x) ) -#define ARLEN(x) sizeof (x) / sizeof *(x) using namespace ::rtl; using namespace ::osl; @@ -389,7 +389,7 @@ Reference< lang::XMultiServiceFactory > SAL_CALL start_office(NSP_PIPE_FD read_f oslProcessError rc = osl_executeProcess( aOfficePath.pData, ar_args, - ARLEN( ar_args ), + SAL_N_ELEMENTS( ar_args ), osl_Process_DETACHED, sec.getHandle(), 0, // => current working dir diff --git a/extensions/source/propctrlr/formmetadata.cxx b/extensions/source/propctrlr/formmetadata.cxx index d4790a44350b..a5b26feaf9ca 100644 --- a/extensions/source/propctrlr/formmetadata.cxx +++ b/extensions/source/propctrlr/formmetadata.cxx @@ -36,7 +36,7 @@ #include #include #include - +#include #include #include @@ -360,7 +360,7 @@ namespace pcr }; s_pPropertyInfos = aPropertyInfos; - s_nCount = sizeof(aPropertyInfos) / sizeof(OPropertyInfoImpl); + s_nCount = SAL_N_ELEMENTS(aPropertyInfos); // sort ::std::sort( s_pPropertyInfos, s_pPropertyInfos + s_nCount, PropertyInfoLessByName() ); diff --git a/extensions/source/update/check/updatecheck.cxx b/extensions/source/update/check/updatecheck.cxx index ccfcda6157cb..5e42f7f0fa00 100644 --- a/extensions/source/update/check/updatecheck.cxx +++ b/extensions/source/update/check/updatecheck.cxx @@ -49,6 +49,7 @@ #include #include #include +#include #ifdef WNT #ifdef _MSC_VER @@ -577,7 +578,7 @@ UpdateCheckThread::run() // Increase next by 15, 60, .. minutes static const sal_Int32 nRetryInterval[] = { 900, 3600, 14400, 86400 }; - if( n < sizeof(nRetryInterval) / sizeof(sal_Int32) ) + if( n < SAL_N_ELEMENTS(nRetryInterval) ) ++n; tv.Seconds = nRetryInterval[n-1]; @@ -689,7 +690,7 @@ DownloadThread::run() // Increase next by 1, 5, 15, 60, .. minutes static const sal_Int16 nRetryInterval[] = { 60, 300, 900, 3600 }; - if( n < sizeof(nRetryInterval) / sizeof(sal_Int16) ) + if( n < SAL_N_ELEMENTS(nRetryInterval) ) ++n; tv.Seconds = nRetryInterval[n-1]; diff --git a/extensions/source/update/check/updatecheckconfig.cxx b/extensions/source/update/check/updatecheckconfig.cxx index f897eb668b3e..854638c26e52 100644 --- a/extensions/source/update/check/updatecheckconfig.cxx +++ b/extensions/source/update/check/updatecheckconfig.cxx @@ -39,6 +39,7 @@ #include #include #include +#include #ifdef WNT #ifdef _MSC_VER @@ -91,7 +92,7 @@ static const sal_Char * const aUpdateEntryProperties[] = { OLD_VERSION }; -static const sal_uInt32 nUpdateEntryProperties = sizeof(aUpdateEntryProperties) / sizeof(sal_Char *); +static const sal_uInt32 nUpdateEntryProperties = SAL_N_ELEMENTS(aUpdateEntryProperties); //------------------------------------------------------------------------------ -- cgit