wbemdisp: Use the ARRAY_SIZE() macro.

Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
Signed-off-by: Hans Leidekker <hans@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Michael Stefaniuc 2018-07-18 23:01:35 +02:00 committed by Alexandre Julliard
parent c77defede1
commit be4cb86b75
2 changed files with 3 additions and 3 deletions

View File

@ -1641,7 +1641,7 @@ static HRESULT WINAPI services_DeleteAsync(
static BSTR build_query_string( const WCHAR *class )
{
static const WCHAR selectW[] = {'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ',0};
UINT len = strlenW(class) + sizeof(selectW) / sizeof(selectW[0]);
UINT len = strlenW(class) + ARRAY_SIZE(selectW);
BSTR ret;
if (!(ret = SysAllocStringLen( NULL, len ))) return NULL;
@ -2074,7 +2074,7 @@ static BSTR build_resource_string( BSTR server, BSTR namespace )
if (server && *server) len_server = strlenW( server );
else len_server = 1;
if (namespace && *namespace) len_namespace = strlenW( namespace );
else len_namespace = sizeof(defaultW) / sizeof(defaultW[0]) - 1;
else len_namespace = ARRAY_SIZE(defaultW) - 1;
if (!(ret = SysAllocStringLen( NULL, 2 + len_server + 1 + len_namespace ))) return NULL;

View File

@ -374,7 +374,7 @@ static HRESULT WINAPI WinMGMTS_ParseDisplayName(IParseDisplayName *iface, IBindC
ULONG *pchEaten, IMoniker **ppmkOut)
{
static const WCHAR prefixW[] = {'w','i','n','m','g','m','t','s',':',0};
const DWORD prefix_len = sizeof(prefixW) / sizeof(prefixW[0]) - 1;
const DWORD prefix_len = ARRAY_SIZE(prefixW) - 1;
ISWbemLocator *locator = NULL;
ISWbemServices *services = NULL;
ISWbemObject *obj = NULL;