diff options
author | Kenneth Venken <kenneth.venken@gmail.com> | 2010-10-18 19:47:47 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@novell.com> | 2010-10-18 19:47:47 +0100 |
commit | 5ecab7a09f86843667520dafb158d569715ea214 (patch) | |
tree | 6f5d36081c7a4981a5553e83beecd4e3ee4704aa /sal/rtl | |
parent | a8ac6c40db8f3b0ba1693c6e7135fb559e56be2c (diff) |
cleanup to use SAL_N_ELEMENTS
Diffstat (limited to 'sal/rtl')
-rw-r--r-- | sal/rtl/source/alloc_global.c | 3 | ||||
-rw-r--r-- | sal/rtl/source/hash.cxx | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sal/rtl/source/alloc_global.c b/sal/rtl/source/alloc_global.c index b7612bc6f..9171b492e 100644 --- a/sal/rtl/source/alloc_global.c +++ b/sal/rtl/source/alloc_global.c @@ -26,6 +26,7 @@ ************************************************************************/ #include "rtl/alloc.h" +#include <sal/macros.h> #ifndef INCLUDED_STRING_H #include <string.h> @@ -72,7 +73,7 @@ static const sal_Size g_alloc_sizes[] = }; #define RTL_MEMORY_CACHED_LIMIT 4 * 4096 -#define RTL_MEMORY_CACHED_SIZES (sizeof(g_alloc_sizes) / sizeof(g_alloc_sizes[0])) +#define RTL_MEMORY_CACHED_SIZES (SAL_N_ELEMENTS(g_alloc_sizes)) static rtl_cache_type * g_alloc_caches[RTL_MEMORY_CACHED_SIZES] = { diff --git a/sal/rtl/source/hash.cxx b/sal/rtl/source/hash.cxx index 8e4d94ceb..5ae56a6a0 100644 --- a/sal/rtl/source/hash.cxx +++ b/sal/rtl/source/hash.cxx @@ -32,6 +32,7 @@ #include "hash.h" #include "strimp.h" #include <osl/diagnose.h> +#include <sal/macros.h> struct StringHashTableImpl { sal_uInt32 nEntries; @@ -68,8 +69,8 @@ getNextSize (sal_uInt32 nSize) 65521, 131071,262139, 524287, 1048573, 2097143, 4194301, 8388593, 16777213, 33554393, 67108859, 134217689 }; - #define NUM_PRIMES (sizeof (nPrimes)/ sizeof (nPrimes[0])) - for (sal_uInt32 i = 0; i < NUM_PRIMES; i++) + + for (sal_uInt32 i = 0; i < SAL_N_ELEMENTS(nPrimes); i++) { if (nPrimes[i] > nSize) return nPrimes[i]; |