From 394235bba1f7c474c9655f929f4fe27a550aba45 Mon Sep 17 00:00:00 2001 From: Kenneth Venken Date: Fri, 15 Oct 2010 18:15:35 +0100 Subject: SAL_N_ELEMENTS changes for components --- .../source/win32/customactions/reg4msdoc/reg4msdocmsi.cxx | 2 -- .../source/win32/customactions/sellang/sellang.cxx | 2 +- setup_native/source/win32/stwrapper/stwrapper.cxx | 14 ++++++-------- 3 files changed, 7 insertions(+), 11 deletions(-) (limited to 'setup_native') diff --git a/setup_native/source/win32/customactions/reg4msdoc/reg4msdocmsi.cxx b/setup_native/source/win32/customactions/reg4msdoc/reg4msdocmsi.cxx index ffbbafc9a68d..e3f930ccfcbd 100644 --- a/setup_native/source/win32/customactions/reg4msdoc/reg4msdocmsi.cxx +++ b/setup_native/source/win32/customactions/reg4msdoc/reg4msdocmsi.cxx @@ -43,8 +43,6 @@ #include #include -#define ELEMENTS_OF_ARRAY(a) (sizeof(a)/sizeof(a[0])) - void DetermineWordPreselectionState(MSIHANDLE handle) { if (query_preselect_registration_for_ms_application(handle, MSWORD)) diff --git a/setup_native/source/win32/customactions/sellang/sellang.cxx b/setup_native/source/win32/customactions/sellang/sellang.cxx index 3b52d7ee0373..ecae30371082 100644 --- a/setup_native/source/win32/customactions/sellang/sellang.cxx +++ b/setup_native/source/win32/customactions/sellang/sellang.cxx @@ -185,7 +185,7 @@ enum_ui_lang_proc (LPTSTR language, LONG_PTR /* unused_lParam */) return TRUE; ui_langs[num_ui_langs] = langid_to_string((LANGID) langid, NULL); num_ui_langs++; - if (num_ui_langs == sizeof(ui_langs) / sizeof(ui_langs[0])) + if (num_ui_langs == SAL_N_ELEMENTS(ui_langs) ) return FALSE; return TRUE; } diff --git a/setup_native/source/win32/stwrapper/stwrapper.cxx b/setup_native/source/win32/stwrapper/stwrapper.cxx index d2c72c6422d4..0a12b3a80f61 100644 --- a/setup_native/source/win32/stwrapper/stwrapper.cxx +++ b/setup_native/source/win32/stwrapper/stwrapper.cxx @@ -13,8 +13,6 @@ #include -#define elementsof(buf) (sizeof(buf) / sizeof(buf[0])) - enum PathResult { PATHRESULT_OK, @@ -281,7 +279,7 @@ int WINAPI _tWinMain( HINSTANCE /*hInstance*/, HINSTANCE, LPTSTR, int ) { if ( i < nArgs ) ++i; - SafeCopy( szInstanceURN, lpArgs[i], elementsof( szInstanceURN )); + SafeCopy( szInstanceURN, lpArgs[i], SAL_N_ELEMENTS( szInstanceURN )); break; } @@ -289,35 +287,35 @@ int WINAPI _tWinMain( HINSTANCE /*hInstance*/, HINSTANCE, LPTSTR, int ) { if ( i < nArgs ) ++i; - SafeCopy( szTargetURN, lpArgs[i], elementsof( szTargetURN )); + SafeCopy( szTargetURN, lpArgs[i], SAL_N_ELEMENTS( szTargetURN )); break; } case 'p': { if ( i < nArgs ) ++i; - SafeCopy( szProductName, lpArgs[i], elementsof( szProductName )); + SafeCopy( szProductName, lpArgs[i], SAL_N_ELEMENTS( szProductName )); break; } case 'e': { if ( i < nArgs ) ++i; - SafeCopy( szProductVersion, lpArgs[i], elementsof( szProductVersion )); + SafeCopy( szProductVersion, lpArgs[i], SAL_N_ELEMENTS( szProductVersion )); break; } case 'P': { if ( i < nArgs ) ++i; - SafeCopy( szParentProductName, lpArgs[i], elementsof( szParentProductName )); + SafeCopy( szParentProductName, lpArgs[i], SAL_N_ELEMENTS( szParentProductName )); break; } case 'S': { if ( i < nArgs ) ++i; - SafeCopy( szProductSource, lpArgs[i], elementsof( szProductSource )); + SafeCopy( szProductSource, lpArgs[i], SAL_N_ELEMENTS( szProductSource )); break; } -- cgit v1.2.3