diff options
author | Kenneth Venken <kenneth.venken@gmail.com> | 2010-10-18 12:28:33 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2010-10-18 12:28:33 +0200 |
commit | bbe30ed8144fbfee7500b98a67224731c581663e (patch) | |
tree | 69c3c4238eb51d2be523c9eb9e1e2a498c36b9cf /vcl/unx/source/app/wmadaptor.cxx | |
parent | 309b89b93489c785a7ed2460ad5064ff0422dfd3 (diff) |
replace sizeof(foo)/sizeof(foo[0]) by SAL_N_ELEMENTS
Diffstat (limited to 'vcl/unx/source/app/wmadaptor.cxx')
-rw-r--r-- | vcl/unx/source/app/wmadaptor.cxx | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/vcl/unx/source/app/wmadaptor.cxx b/vcl/unx/source/app/wmadaptor.cxx index 77ae674bd36e..955d7098192f 100644 --- a/vcl/unx/source/app/wmadaptor.cxx +++ b/vcl/unx/source/app/wmadaptor.cxx @@ -41,6 +41,7 @@ #include <osl/thread.h> #include <rtl/locale.h> #include <osl/process.h> +#include <sal/macros.h> #include <tools/prex.h> #include <X11/X.h> @@ -493,7 +494,7 @@ NetWMAdaptor::NetWMAdaptor( SalDisplay* pSalDisplay ) : WMAdaptorProtocol* pMatch = (WMAdaptorProtocol*) bsearch( &aSearch, aProtocolTab, - sizeof( aProtocolTab )/sizeof( aProtocolTab[0] ), + SAL_N_ELEMENTS( aProtocolTab ), sizeof( struct WMAdaptorProtocol ), compareProtocol ); if( pMatch ) @@ -749,7 +750,7 @@ GnomeWMAdaptor::GnomeWMAdaptor( SalDisplay* pSalDisplay ) : WMAdaptorProtocol* pMatch = (WMAdaptorProtocol*) bsearch( &aSearch, aProtocolTab, - sizeof( aProtocolTab )/sizeof( aProtocolTab[0] ), + SAL_N_ELEMENTS( aProtocolTab ), sizeof( struct WMAdaptorProtocol ), compareProtocol ); if( pMatch ) @@ -1006,7 +1007,7 @@ bool GnomeWMAdaptor::isValid() const void WMAdaptor::initAtoms() { // get basic atoms - for( unsigned int i = 0; i < sizeof( aAtomTab )/sizeof( aAtomTab[0] ); i++ ) + for( unsigned int i = 0; i < SAL_N_ELEMENTS( aAtomTab ); i++ ) m_aWMAtoms[ aAtomTab[i].nProtocol ] = XInternAtom( m_pDisplay, aAtomTab[i].pProtocol, False ); m_aWMAtoms[ NET_SUPPORTING_WM_CHECK ] = XInternAtom( m_pDisplay, "_NET_SUPPORTING_WM_CHECK", True ); m_aWMAtoms[ NET_WM_NAME ] = XInternAtom( m_pDisplay, "_NET_WM_NAME", True ); |