Kaydet (Commit) ae635c1e authored tarafından Florian Bircher's avatar Florian Bircher Kaydeden (comit) Norbert Thiebaud

use SAL_N_ELEMENTS

üst bc8fcf20
...@@ -411,13 +411,13 @@ int _tmain( int, _TCHAR ** ) ...@@ -411,13 +411,13 @@ int _tmain( int, _TCHAR ** )
}; };
#ifdef UNOPKG #ifdef UNOPKG
dwWaitResult = WaitForMultipleObjects( elementsof(hObjects), hObjects, TRUE, INFINITE ); dwWaitResult = WaitForMultipleObjects( SAL_N_ELEMENTS(hObjects), hObjects, TRUE, INFINITE );
#else #else
bool bDetach = false; bool bDetach = false;
int nOpenPipes = 2; int nOpenPipes = 2;
do do
{ {
dwWaitResult = WaitForMultipleObjects( elementsof(hObjects), hObjects, FALSE, INFINITE ); dwWaitResult = WaitForMultipleObjects( SAL_N_ELEMENTS(hObjects), hObjects, FALSE, INFINITE );
switch ( dwWaitResult ) switch ( dwWaitResult )
{ {
......
...@@ -230,7 +230,7 @@ int WINAPI _tWinMain( HINSTANCE, HINSTANCE, LPTSTR, int ) ...@@ -230,7 +230,7 @@ int WINAPI _tWinMain( HINSTANCE, HINSTANCE, LPTSTR, int )
TEXT("FastPipeCommunication"), TEXT("FastPipeCommunication"),
TEXT("0"), TEXT("0"),
szKey, szKey,
elementsof(szKey), SAL_N_ELEMENTS(szKey),
szPerfTuneIniFile szPerfTuneIniFile
); );
...@@ -258,10 +258,10 @@ int WINAPI _tWinMain( HINSTANCE, HINSTANCE, LPTSTR, int ) ...@@ -258,10 +258,10 @@ int WINAPI _tWinMain( HINSTANCE, HINSTANCE, LPTSTR, int )
fSuccess = ConvertSidToStringSid( pSid, &szUserIdent ); fSuccess = ConvertSidToStringSid( pSid, &szUserIdent );
_tcsncpy( szPipeName, PIPE_PREFIX, elementsof(szPipeName) ); _tcsncpy( szPipeName, PIPE_PREFIX, SAL_N_ELEMENTS(szPipeName) );
_tcsncat( szPipeName, szUserIdent, elementsof(szPipeName) - _tcslen(szPipeName) - 1 ); _tcsncat( szPipeName, szUserIdent, SAL_N_ELEMENTS(szPipeName) - _tcslen(szPipeName) - 1 );
_tcsncat( szPipeName, PIPE_POSTFIX, elementsof(szPipeName) - _tcslen(szPipeName) - 1 ); _tcsncat( szPipeName, PIPE_POSTFIX, SAL_N_ELEMENTS(szPipeName) - _tcslen(szPipeName) - 1 );
_tcsncat( szPipeName, _ultot( SUPD, szSUPD, 10), elementsof(szPipeName) - _tcslen(szPipeName) - 1 ); _tcsncat( szPipeName, _ultot( SUPD, szSUPD, 10), SAL_N_ELEMENTS(szPipeName) - _tcslen(szPipeName) - 1 );
LocalFree( szUserIdent ); LocalFree( szUserIdent );
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
#include <tchar.h> #include <tchar.h>
#include <stdio.h> #include <stdio.h>
#include <systools/win32/uwinapi.h> #include <systools/win32/uwinapi.h>
#include <sal/macros.h>
// need to undef min and max macros from MS headers here to make // need to undef min and max macros from MS headers here to make
// the std::min and std::max from stl visible again // the std::min and std::max from stl visible again
...@@ -199,7 +200,7 @@ namespace svx{ ...@@ -199,7 +200,7 @@ namespace svx{
TCHAR szTempPath[MAX_PATH]; TCHAR szTempPath[MAX_PATH];
TCHAR szFileName[MAX_PATH]; TCHAR szFileName[MAX_PATH];
GetTempPath( elementsof(szTempPath), szTempPath ); GetTempPath( SAL_N_ELEMENTS(szTempPath), szTempPath );
GetTempFileName( szTempPath, TEXT("DSC"), 0, szFileName ); GetTempFileName( szTempPath, TEXT("DSC"), 0, szFileName );
FILE *fp = _tfopen( szFileName, _T("wb") ); FILE *fp = _tfopen( szFileName, _T("wb") );
...@@ -226,7 +227,7 @@ namespace svx{ ...@@ -226,7 +227,7 @@ namespace svx{
ZeroMemory( &StartupInfo, sizeof(StartupInfo) ); ZeroMemory( &StartupInfo, sizeof(StartupInfo) );
StartupInfo.cb = sizeof(StartupInfo.cb); StartupInfo.cb = sizeof(StartupInfo.cb);
sntprintf( szBuffer, elementsof(szBuffer), sntprintf( szBuffer, SAL_N_ELEMENTS(szBuffer),
_T("%s -noui -load -send"), _T("%s -noui -load -send"),
szPath ); szPath );
......
...@@ -102,11 +102,11 @@ void NotifyListener( HWND hWnd ) ...@@ -102,11 +102,11 @@ void NotifyListener( HWND hWnd )
nid.cbSize = sizeof(NOTIFYICONDATA); nid.cbSize = sizeof(NOTIFYICONDATA);
nid.hWnd = hWnd; nid.hWnd = hWnd;
nid.uID = IDM_QUICKSTART; nid.uID = IDM_QUICKSTART;
nid.szTip[elementsof(nid.szTip) - 1] = 0; nid.szTip[SAL_N_ELEMENTS(nid.szTip) - 1] = 0;
// nid.hIcon = bTerminateVeto ? hIconActive : hIconInActive; // nid.hIcon = bTerminateVeto ? hIconActive : hIconInActive;
// strncpy(nid.szTip, bTerminateVeto ? STRING_QUICKSTARTACTIVE : STRING_QUICKSTARTINACTIVE, elementsof(nid.szTip) - 1 ); // strncpy(nid.szTip, bTerminateVeto ? STRING_QUICKSTARTACTIVE : STRING_QUICKSTARTINACTIVE, SAL_N_ELEMENTS(nid.szTip) - 1 );
nid.hIcon = hIconActive; nid.hIcon = hIconActive;
strncpy(nid.szTip, szTooltipString, elementsof(nid.szTip) - 1); strncpy(nid.szTip, szTooltipString, SAL_N_ELEMENTS(nid.szTip) - 1);
nid.uFlags = NIF_TIP|NIF_ICON; nid.uFlags = NIF_TIP|NIF_ICON;
// update systray // update systray
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment