summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/source/debug/debug.cxx3
-rw-r--r--tools/workben/urltest.cxx15
2 files changed, 10 insertions, 8 deletions
diff --git a/tools/source/debug/debug.cxx b/tools/source/debug/debug.cxx
index 5d2ec86b6e63..7972c76dca59 100644
--- a/tools/source/debug/debug.cxx
+++ b/tools/source/debug/debug.cxx
@@ -63,6 +63,7 @@
#include <tools/debug.hxx>
#include <rtl/string.h>
+#include <sal/macros.h>
#include <vector>
@@ -486,7 +487,7 @@ namespace
size_t nValueLen = lcl_tryReadConfigString( _pLine, _nLineLen, _pKeyName, aBuf, sizeof( aBuf ) );
if ( nValueLen )
{
- for ( ULONG name = 0; name < sizeof( names ) / sizeof( names[0] ); ++name )
+ for ( ULONG name = 0; name < SAL_N_ELEMENTS( names ); ++name )
{
if ( strcmp( aBuf, names[ name ] ) == 0 )
{
diff --git a/tools/workben/urltest.cxx b/tools/workben/urltest.cxx
index 80e0e4c664b6..0b0239a96f5a 100644
--- a/tools/workben/urltest.cxx
+++ b/tools/workben/urltest.cxx
@@ -39,6 +39,7 @@
#include "rtl/textenc.h"
#include "rtl/ustring.h"
#include "rtl/ustring.hxx"
+#include <sal/macros.h>
#include <cstddef>
#include <cstdlib>
@@ -497,7 +498,7 @@ main()
{ "vnd.sun.star.help://swriter?foo",
"vnd.sun.star.help://swriter/?foo" },
{ "vnd.sun.star.help://swriter/?foo", 0 } };
- for (std::size_t i = 0; i < sizeof aTest / sizeof aTest[0]; ++i)
+ for (std::size_t i = 0; i < SAL_N_ELEMENTS( aTest ); ++i)
{
INetURLObject aUrl(aTest[i].in);
if (aUrl.HasError())
@@ -531,7 +532,7 @@ main()
/*TODO "wfs:///c|/xyz/",*/
/*TODO "wfs://xxx/yyy?zzz",*/
/*TODO "wfs:///x/y/z"*/ };
- for (std::size_t i = 0; i < sizeof aTest / sizeof aTest[0]; ++i)
+ for (std::size_t i = 0; i < SAL_N_ELEMENTS(aTest); ++i)
{
INetURLObject aUrl(aTest[i]);
if (aUrl.HasError())
@@ -566,7 +567,7 @@ main()
"vnd.sun.star.pkg://file:%2F%2F%2Fa:%2Fb%20c/xx",
/*TODO "vnd.sun.star.pkg://file:%2F%2F%2Fa:%2Fb%20c/xx;yy",*/
"vnd.sun.star.pkg://file:%2F%2F%2Fa:%2Fb%20c/xx//yy" };
- for (std::size_t i = 0; i < sizeof aTest / sizeof aTest[0]; ++i)
+ for (std::size_t i = 0; i < SAL_N_ELEMENTS(aTest); ++i)
{
INetURLObject aUrl(aTest[i]);
if (aUrl.HasError())
@@ -591,7 +592,7 @@ main()
"vnd.sun.star.cmd:log/out",
/*TODO "vnd.sun.star.cmd:[logout]",*/
"vnd.sun.star.cmd:log[out]" };
- for (std::size_t i = 0; i < sizeof aTest / sizeof aTest[0]; ++i)
+ for (std::size_t i = 0; i < SAL_N_ELEMENTS( aTest ); ++i)
{
INetURLObject aUrl(aTest[i]);
if (aUrl.HasError())
@@ -1220,7 +1221,7 @@ main()
{ "smb://foo", "smb://foo/" },
{ "smb://x;foo:bar@baz.xyz:12345/ab?cd",
"smb://x;foo:bar@baz.xyz:12345/ab?cd" } };
- for (std::size_t i = 0; i < sizeof aTest / sizeof aTest[0]; ++i)
+ for (std::size_t i = 0; i < SAL_N_ELEMENTS( aTest ); ++i)
{
INetURLObject aUrl(aTest[i].m_pInput);
if (aTest[i].m_pOutput == 0
@@ -1250,7 +1251,7 @@ main()
static Test const aTest[]
= { { "file://d:\\dir1\\file1", "file:///d:/dir1/file1" },
{ "http://as@alaska:8000/test/test.sxw", 0 } };
- for (std::size_t i = 0; i < sizeof aTest / sizeof aTest[0]; ++i)
+ for (std::size_t i = 0; i < SAL_N_ELEMENTS( aTest ); ++i)
{
INetURLObject aUrl = INetURLObject(
String(aTest[i].m_pInput, RTL_TEXTENCODING_UTF8),
@@ -1379,7 +1380,7 @@ main()
{ INET_PROT_NEWS, "abc@def.ghi@", 0 },
{ INET_PROT_NEWS, "!\"#@def", "news:!%22%23@def" },
{ INET_PROT_NEWS, " @def", "news:%20@def" } };
- for (std::size_t i = 0; i < sizeof aTest / sizeof aTest[0]; ++i)
+ for (std::size_t i = 0; i < SAL_N_ELEMENTS( aTest ); ++i)
{
INetURLObject aUri;
bool bOk = aUri.ConcatData(aTest[i].eScheme, String(), String(),